@@ -84,29 +84,25 @@ pub trait Reader {
84
84
85
85
// FIXME (#2982): This should probably return an error.
86
86
/**
87
- * Reads bytes and puts them into `bytes`, advancing the cursor . Returns the
88
- * number of bytes read.
87
+ * Reads bytes and puts them into `bytes`. Returns the number of
88
+ * bytes read.
89
89
*
90
90
* The number of bytes to be read is `len` or the end of the file,
91
91
* whichever comes first.
92
92
*
93
93
* The buffer must be at least `len` bytes long.
94
94
*
95
- * `read` is conceptually similar to C's `fread`.
96
- *
97
95
* # Examples
98
96
*
99
97
* None right now.
100
98
*/
101
99
fn read ( & self , bytes : & mut [ u8 ] , len : uint ) -> uint ;
102
100
103
101
/**
104
- * Reads a single byte, advancing the cursor .
102
+ * Reads a single byte.
105
103
*
106
104
* In the case of an EOF or an error, returns a negative value.
107
105
*
108
- * `read_byte` is conceptually similar to C's `getc` function.
109
- *
110
106
* # Examples
111
107
*
112
108
* None right now.
@@ -116,8 +112,6 @@ pub trait Reader {
116
112
/**
117
113
* Returns a boolean value: are we currently at EOF?
118
114
*
119
- * `eof` is conceptually similar to C's `feof` function.
120
- *
121
115
* # Examples
122
116
*
123
117
* None right now.
@@ -130,8 +124,6 @@ pub trait Reader {
130
124
* Takes an optional SeekStyle, which affects how we seek from the
131
125
* position. See `SeekStyle` docs for more details.
132
126
*
133
- * `seek` is conceptually similar to C's `fseek`.
134
- *
135
127
* # Examples
136
128
*
137
129
* None right now.
@@ -141,8 +133,6 @@ pub trait Reader {
141
133
/**
142
134
* Returns the current position within the stream.
143
135
*
144
- * `tell` is conceptually similar to C's `ftell` function.
145
- *
146
136
* # Examples
147
137
*
148
138
* None right now.
@@ -1020,6 +1010,16 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
1020
1010
// top-level functions that take a reader, or a set of default methods on
1021
1011
// reader (which can then be called reader)
1022
1012
1013
+ /**
1014
+ * Gives a `Reader` that allows you to read values from standard input.
1015
+ *
1016
+ * # Examples
1017
+ * ~~~
1018
+ * let stdin = core::io::stdin();
1019
+ * let line = stdin.read_line();
1020
+ * core::io::print(line);
1021
+ * ~~~
1022
+ */
1023
1023
pub fn stdin ( ) -> @Reader {
1024
1024
unsafe {
1025
1025
@rustrt:: rust_get_stdin ( ) as @Reader
0 commit comments