Changeset e3fea42 for libcfa/src/fstream.cfa
- Timestamp:
- Feb 4, 2020, 2:03:07 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 52142c2
- Parents:
- 1d94116
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r1d94116 re3fea42 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 29 06:56:46 201913 // Update Count : 35 512 // Last Modified On : Tue Feb 4 11:55:29 2020 13 // Update Count : 356 14 14 // 15 15 … … 48 48 void sepReset( ofstream & os, bool reset ) { os.sepDefault = reset; os.sepOnOff = os.sepDefault; } 49 49 const char * sepGetCur( ofstream & os ) { return os.sepCur; } 50 void sepSetCur( ofstream & os, const char * sepCur) { os.sepCur = sepCur; }50 void sepSetCur( ofstream & os, const char sepCur[] ) { os.sepCur = sepCur; } 51 51 bool getNL( ofstream & os ) { return os.sawNL; } 52 52 void setNL( ofstream & os, bool state ) { os.sawNL = state; } … … 58 58 void ?{}( ofstream & os ) { os.file = 0; } 59 59 60 void ?{}( ofstream & os, const char * name, const char * mode) {60 void ?{}( ofstream & os, const char name[], const char mode[] ) { 61 61 open( os, name, mode ); 62 62 } // ?{} 63 63 64 void ?{}( ofstream & os, const char * name) {64 void ?{}( ofstream & os, const char name[] ) { 65 65 open( os, name, "w" ); 66 66 } // ?{} … … 91 91 92 92 const char * sepGet( ofstream & os ) { return os.separator; } 93 void sepSet( ofstream & os, const char * s) {93 void sepSet( ofstream & os, const char s[] ) { 94 94 assert( s ); 95 95 strncpy( os.separator, s, sepSize - 1 ); … … 98 98 99 99 const char * sepGetTuple( ofstream & os ) { return os.tupleSeparator; } 100 void sepSetTuple( ofstream & os, const char * s) {100 void sepSetTuple( ofstream & os, const char s[] ) { 101 101 assert( s ); 102 102 strncpy( os.tupleSeparator, s, sepSize - 1 ); … … 119 119 } // flush 120 120 121 void open( ofstream & os, const char * name, const char * mode) {121 void open( ofstream & os, const char name[], const char mode[] ) { 122 122 FILE * file = fopen( name, mode ); 123 123 #ifdef __CFA_DEBUG__ … … 129 129 } // open 130 130 131 void open( ofstream & os, const char * name) {131 void open( ofstream & os, const char name[] ) { 132 132 open( os, name, "w" ); 133 133 } // open … … 141 141 } // close 142 142 143 ofstream & write( ofstream & os, const char * data, size_t size ) {143 ofstream & write( ofstream & os, const char data[], size_t size ) { 144 144 if ( fail( os ) ) { 145 145 abort | IO_MSG "attempt write I/O on failed stream"; … … 191 191 void ?{}( ifstream & is ) { is.file = 0; } 192 192 193 void ?{}( ifstream & is, const char * name, const char * mode) {193 void ?{}( ifstream & is, const char name[], const char mode[] ) { 194 194 open( is, name, mode ); 195 195 } // ?{} 196 196 197 void ?{}( ifstream & is, const char * name) {197 void ?{}( ifstream & is, const char name[] ) { 198 198 open( is, name, "r" ); 199 199 } // ?{} … … 215 215 } // eof 216 216 217 void open( ifstream & is, const char * name, const char * mode) {217 void open( ifstream & is, const char name[], const char mode[] ) { 218 218 FILE * file = fopen( name, mode ); 219 219 #ifdef __CFA_DEBUG__ … … 225 225 } // open 226 226 227 void open( ifstream & is, const char * name) {227 void open( ifstream & is, const char name[] ) { 228 228 open( is, name, "r" ); 229 229 } // open
Note: See TracChangeset
for help on using the changeset viewer.