Changeset 00e9be9
- Timestamp:
- Apr 28, 2021, 9:29:07 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 99b2407
- Parents:
- c7015e6b
- Location:
- libcfa/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
rc7015e6b r00e9be9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 27 22:08:57202113 // Update Count : 44 212 // Last Modified On : Wed Apr 28 20:37:53 2021 13 // Update Count : 445 14 14 // 15 15 … … 114 114 } // fail 115 115 116 void clear( ofstream & os ) { 117 clearerr( (FILE *)(os.file$) ); 118 } // clear 119 116 120 int flush( ofstream & os ) { 117 121 return fflush( (FILE *)(os.file$) ); … … 207 211 } // nl 208 212 213 209 214 // *********************************** ifstream *********************************** 210 215 … … 240 245 } // fail 241 246 247 void clear( ifstream & is ) { 248 clearerr( (FILE *)(is.file$) ); 249 } // clear 250 242 251 void ends( ifstream & is ) { 243 252 if ( is.acquired$ ) { is.acquired$ = false; release( is ); } 244 253 } // ends 245 254 246 inteof( ifstream & is ) {255 bool eof( ifstream & is ) { 247 256 return feof( (FILE *)(is.file$) ); 248 257 } // eof … … 273 282 } // close 274 283 275 ifstream & read( ifstream & is, char * data, size_t size ) {284 ifstream & read( ifstream & is, char data[], size_t size ) { 276 285 if ( fail( is ) ) { 277 286 abort | IO_MSG "attempt read I/O on failed stream"; -
libcfa/src/fstream.hfa
rc7015e6b r00e9be9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 27 22:00:30202113 // Update Count : 2 2612 // Last Modified On : Wed Apr 28 20:37:57 2021 13 // Update Count : 230 14 14 // 15 15 … … 70 70 71 71 bool fail( ofstream & ); 72 void clear( ofstream & ); 72 73 int flush( ofstream & ); 73 74 void open( ofstream &, const char name[], const char mode[] ); // FIX ME: use default = "w" … … 119 120 120 121 bool fail( ifstream & is ); 121 int eof( ifstream & is ); 122 void clear( ifstream & ); 123 bool eof( ifstream & is ); 122 124 void open( ifstream & is, const char name[], const char mode[] ); // FIX ME: use default = "r" 123 125 void open( ifstream & is, const char name[] ); 124 126 void close( ifstream & is ); 125 ifstream & read( ifstream & is, char * data, size_t size );127 ifstream & read( ifstream & is, char data[], size_t size ); 126 128 ifstream & ungetc( ifstream & is, char c ); 127 129 -
libcfa/src/iostream.hfa
rc7015e6b r00e9be9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 27 17:59:21202113 // Update Count : 39812 // Last Modified On : Wed Apr 28 20:37:56 2021 13 // Update Count : 401 14 14 // 15 15 … … 52 52 53 53 trait ostream( ostype & | basic_ostream( ostype ) ) { 54 bool fail( ostype & ); // operation failed? 55 void clear( ostype & ); 54 56 int flush( ostype & ); 55 bool fail( ostype & ); // operation failed?56 57 void open( ostype &, const char name[], const char mode[] ); 57 58 void close( ostype & ); … … 302 303 int fmt( istype &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) )); 303 304 istype & ungetc( istype &, char ); 304 inteof( istype & );305 bool eof( istype & ); 305 306 }; // basic_istream 306 307 307 308 trait istream( istype & | basic_istream( istype ) ) { 308 309 bool fail( istype & ); 310 void clear( istype & ); 309 311 void open( istype & is, const char name[] ); 310 312 void close( istype & is ); 311 istype & read( istype &, char *, size_t );313 istype & read( istype &, char [], size_t ); 312 314 void acquire( istype & ); // concurrent access 313 315 }; // istream
Note: See TracChangeset
for help on using the changeset viewer.