Changeset 0efb269
- Timestamp:
- Apr 20, 2019, 3:18:16 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- e7fdd76
- Parents:
- 4e84ef7
- Location:
- libcfa/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r4e84ef7 r0efb269 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 28 17:39:53 201913 // Update Count : 3 0712 // Last Modified On : Sat Apr 20 12:03:43 2019 13 // Update Count : 311 14 14 // 15 15 … … 33 33 os.nlOnOff = nlOnOff; 34 34 os.prt = prt; 35 os.sawNL = false; 35 36 sepSet( os, separator ); 36 37 sepSetCur( os, sepGet( os ) ); … … 162 163 void ?{}( ifstream & is, void * file ) { 163 164 is.file = file; 165 is.nlOnOff = false; 164 166 } 165 167 … … 173 175 open( is, name, "r" ); 174 176 } 177 178 void nlOn( ifstream & os ) { os.nlOnOff = true; } 179 void nlOff( ifstream & os ) { os.nlOnOff = false; } 180 bool getANL( ifstream & os ) { return os.nlOnOff; } 175 181 176 182 int fail( ifstream & is ) { -
libcfa/src/fstream.hfa
r4e84ef7 r0efb269 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 24 18:33:41 201813 // Update Count : 1 4912 // Last Modified On : Sat Apr 20 12:03:58 2019 13 // Update Count : 151 14 14 // 15 15 … … 73 73 struct ifstream { 74 74 void * file; 75 bool nlOnOff; 75 76 }; // ifstream 76 77 77 78 // public 79 void nlOn( ifstream & ); 80 void nlOff( ifstream & ); 81 bool getANL( ifstream & ); 78 82 int fail( ifstream & is ); 79 83 int eof( ifstream & is ); -
libcfa/src/iostream.cfa
r4e84ef7 r0efb269 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 4 20:57:24201913 // Update Count : 59312 // Last Modified On : Sat Apr 20 14:02:43 2019 13 // Update Count : 617 14 14 // 15 15 … … 396 396 397 397 istype & ?|?( istype & is, char & c ) { 398 fmt( is, "%c", &c ); // must pass pointer through varg to fmt 398 char temp; 399 for () { 400 fmt( is, "%c", &temp ); // must pass pointer through varg to fmt 401 // do not overwrite parameter with newline unless appropriate 402 if ( temp != '\n' || getANL( is ) ) { c = temp; break; } 403 if ( eof( is ) ) break; 404 } // for 399 405 return is; 400 406 } // ?|? … … 498 504 return is; 499 505 } // nl 506 507 istype & nlOn( istype & is ) { 508 nlOn( is ); // call void returning 509 return is; 510 } // nlOn 511 512 istype & nlOff( istype & is ) { 513 nlOff( is ); // call void returning 514 return is; 515 } // nlOff 500 516 } // distribution 501 517 -
libcfa/src/iostream.hfa
r4e84ef7 r0efb269 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 26 16:57:22201913 // Update Count : 22 112 // Last Modified On : Sat Apr 20 12:04:07 2019 13 // Update Count : 226 14 14 // 15 15 … … 149 149 150 150 trait istream( dtype istype ) { 151 void nlOn( istype & ); // read newline 152 void nlOff( istype & ); // scan newline 153 bool getANL( istype & ); // get scan newline (on/off) 151 154 int fail( istype & ); 152 155 int eof( istype & ); … … 187 190 188 191 // manipulators 192 istype & nlOn( istype & ); 193 istype & nlOff( istype & ); 189 194 istype & ?|?( istype &, istype & (*)( istype & ) ); 190 195 istype & nl( istype & is );
Note: See TracChangeset
for help on using the changeset viewer.