Changes in libcfa/src/fstream.cfa [65240bb:5cb2b8c]
- File:
-
- 1 edited
-
libcfa/src/fstream.cfa (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r65240bb r5cb2b8c 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 12 12:03:53201913 // Update Count : 3 4412 // Last Modified On : Thu May 16 08:33:28 2019 13 // Update Count : 328 14 14 // 15 15 … … 24 24 #include <assert.h> 25 25 #include <errno.h> // errno 26 27 28 //*********************************** ofstream ***********************************29 30 26 31 27 #define IO_MSG "I/O error: " … … 41 37 sepSetCur( os, sepGet( os ) ); 42 38 sepSetTuple( os, ", " ); 43 } // ?{}39 } 44 40 45 41 // private … … 60 56 void ?{}( ofstream & os, const char * name, const char * mode ) { 61 57 open( os, name, mode ); 62 } // ?{} 63 58 } 64 59 void ?{}( ofstream & os, const char * name ) { 65 60 open( os, name, "w" ); 66 } // ?{}61 } 67 62 68 63 void sepOn( ofstream & os ) { os.sepOnOff = ! getNL( os ); } … … 99 94 os.tupleSeparator[sepSize - 1] = '\0'; 100 95 } // sepSet 101 102 void ends( ofstream & os ) {103 if ( getANL( os ) ) nl( os );104 else setPrt( os, false ); // turn off105 if ( &os == &exit ) exit( EXIT_FAILURE );106 if ( &os == &abort ) abort();107 } // ends108 96 109 97 int fail( ofstream & os ) { … … 169 157 ofstream & serr = serrFile; 170 158 171 static ofstream exitFile = { (FILE *)(&_IO_2_1_stdout_) }; 172 ofstream & exit = exitFile; 173 static ofstream abortFile = { (FILE *)(&_IO_2_1_stderr_) }; 174 ofstream & abort = abortFile; 175 176 177 //*********************************** ifstream *********************************** 178 159 // static ofstream sexitFile = { (FILE *)(&_IO_2_1_stdout_) }; 160 // ofstream & sexit = sexitFile; 161 // static ofstream sabortFile = { (FILE *)(&_IO_2_1_stderr_) }; 162 // ofstream & sabort = sabortFile; 163 164 void nl( ofstream & os ) { 165 if ( getANL( os ) ) (ofstream &)(nl( os )); // implementation only 166 else setPrt( os, false ); // turn off 167 } 168 169 //--------------------------------------- 179 170 180 171 // private … … 182 173 is.file = file; 183 174 is.nlOnOff = false; 184 } // ?{}175 } 185 176 186 177 // public … … 189 180 void ?{}( ifstream & is, const char * name, const char * mode ) { 190 181 open( is, name, mode ); 191 } // ?{} 192 182 } 193 183 void ?{}( ifstream & is, const char * name ) { 194 184 open( is, name, "r" ); 195 } // ?{}185 } 196 186 197 187 void nlOn( ifstream & os ) { os.nlOnOff = true; }
Note:
See TracChangeset
for help on using the changeset viewer.