- Timestamp:
- Dec 22, 2018, 11:19:24 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- bd07b15
- Parents:
- 760235a
- Location:
- libcfa/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 08:34:28201813 // Update Count : 29812 // Last Modified On : Sat Dec 22 17:01:54 2018 13 // Update Count : 302 14 14 // 15 15 … … 26 26 #define IO_MSG "I/O error: " 27 27 28 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool nonlManip, const char * separator, const char * tupleSeparator ) {28 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool prt, const char * separator, const char * tupleSeparator ) { 29 29 os.file = file; 30 30 os.sepDefault = sepDefault; 31 31 os.sepOnOff = sepOnOff; 32 32 os.nlOnOff = nlOnOff; 33 os. nonlManip = nonlManip;33 os.prt = prt; 34 34 sepSet( os, separator ); 35 35 sepSetCur( os, sepGet( os ) ); … … 46 46 void setNL( ofstream & os, bool state ) { os.sawNL = state; } 47 47 bool getANL( ofstream & os ) { return os.nlOnOff; } 48 bool get Nonl( ofstream & os ) { return os.nonlManip; }49 void set Nonl( ofstream & os, bool state ) { os.nonlManip= state; }48 bool getPrt( ofstream & os ) { return os.prt; } 49 void setPrt( ofstream & os, bool state ) { os.prt = state; } 50 50 51 51 // public … … 150 150 va_end( args ); 151 151 152 setPrt( os, true ); 152 153 sepReset( os ); // reset separator 153 154 return len; -
libcfa/src/fstream.hfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 07:52:41201813 // Update Count : 14 312 // Last Modified On : Sat Dec 22 17:55:37 2018 13 // Update Count : 148 14 14 // 15 15 … … 24 24 bool sepOnOff; 25 25 bool nlOnOff; 26 bool nonlManip;26 bool prt; // print text 27 27 bool sawNL; 28 28 const char * sepCur; … … 40 40 void setNL( ofstream &, bool ); 41 41 bool getANL( ofstream & ); 42 bool get Nonl( ofstream & );43 void set Nonl( ofstream &, bool );42 bool getPrt( ofstream & ); 43 void setPrt( ofstream &, bool ); 44 44 45 45 // public -
libcfa/src/iostream.cfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 13 14:13:22201813 // Update Count : 5 4812 // Last Modified On : Sat Dec 22 23:09:56 2018 13 // Update Count : 569 14 14 // 15 15 … … 34 34 void ?|?( ostype & os, bool b ) { 35 35 (ostype)(os | b); if ( getANL( os ) ) nl( os ); 36 setPrt( os, false ); // turn off 36 37 } // ?|? 37 38 … … 43 44 void ?|?( ostype & os, char c ) { 44 45 (ostype)(os | c); if ( getANL( os ) ) nl( os ); 46 setPrt( os, false ); // turn off 45 47 } // ?|? 46 48 … … 52 54 void ?|?( ostype & os, signed char sc ) { 53 55 (ostype)(os | sc); if ( getANL( os ) ) nl( os ); 56 setPrt( os, false ); // turn off 54 57 } // ?|? 55 58 … … 61 64 void ?|?( ostype & os, unsigned char usc ) { 62 65 (ostype)(os | usc); if ( getANL( os ) ) nl( os ); 66 setPrt( os, false ); // turn off 63 67 } // ?|? 64 68 … … 70 74 void & ?|?( ostype & os, short int si ) { 71 75 (ostype)(os | si); if ( getANL( os ) ) nl( os ); 76 setPrt( os, false ); // turn off 72 77 } // ?|? 73 78 … … 79 84 void & ?|?( ostype & os, unsigned short int usi ) { 80 85 (ostype)(os | usi); if ( getANL( os ) ) nl( os ); 86 setPrt( os, false ); // turn off 81 87 } // ?|? 82 88 … … 88 94 void & ?|?( ostype & os, int i ) { 89 95 (ostype)(os | i); if ( getANL( os ) ) nl( os ); 96 setPrt( os, false ); // turn off 90 97 } // ?|? 91 98 … … 97 104 void & ?|?( ostype & os, unsigned int ui ) { 98 105 (ostype)(os | ui); if ( getANL( os ) ) nl( os ); 106 setPrt( os, false ); // turn off 99 107 } // ?|? 100 108 … … 106 114 void & ?|?( ostype & os, long int li ) { 107 115 (ostype)(os | li); if ( getANL( os ) ) nl( os ); 116 setPrt( os, false ); // turn off 108 117 } // ?|? 109 118 … … 115 124 void & ?|?( ostype & os, unsigned long int uli ) { 116 125 (ostype)(os | uli); if ( getANL( os ) ) nl( os ); 126 setPrt( os, false ); // turn off 117 127 } // ?|? 118 128 … … 124 134 void & ?|?( ostype & os, long long int lli ) { 125 135 (ostype)(os | lli); if ( getANL( os ) ) nl( os ); 136 setPrt( os, false ); // turn off 126 137 } // ?|? 127 138 … … 133 144 void & ?|?( ostype & os, unsigned long long int ulli ) { 134 145 (ostype)(os | ulli); if ( getANL( os ) ) nl( os ); 146 setPrt( os, false ); // turn off 135 147 } // ?|? 136 148 … … 142 154 void & ?|?( ostype & os, float f ) { 143 155 (ostype)(os | f); if ( getANL( os ) ) nl( os ); 156 setPrt( os, false ); // turn off 144 157 } // ?|? 145 158 … … 151 164 void & ?|?( ostype & os, double d ) { 152 165 (ostype)(os | d); if ( getANL( os ) ) nl( os ); 166 setPrt( os, false ); // turn off 153 167 } // ?|? 154 168 … … 160 174 void & ?|?( ostype & os, long double ld ) { 161 175 (ostype)(os | ld); if ( getANL( os ) ) nl( os ); 176 setPrt( os, false ); // turn off 162 177 } // ?|? 163 178 … … 169 184 void & ?|?( ostype & os, float _Complex fc ) { 170 185 (ostype)(os | fc); if ( getANL( os ) ) nl( os ); 186 setPrt( os, false ); // turn off 171 187 } // ?|? 172 188 … … 178 194 void & ?|?( ostype & os, double _Complex dc ) { 179 195 (ostype)(os | dc); if ( getANL( os ) ) nl( os ); 196 setPrt( os, false ); // turn off 180 197 } // ?|? 181 198 … … 187 204 void & ?|?( ostype & os, long double _Complex ldc ) { 188 205 (ostype)(os | ldc); if ( getANL( os ) ) nl( os ); 206 setPrt( os, false ); // turn off 189 207 } // ?|? 190 208 … … 229 247 void ?|?( ostype & os, const char * str ) { 230 248 (ostype)(os | str); if ( getANL( os ) ) nl( os ); 249 setPrt( os, false ); // turn off 231 250 } // ?|? 232 251 … … 258 277 void ?|?( ostype & os, const void * p ) { 259 278 (ostype)(os | p); if ( getANL( os ) ) nl( os ); 279 setPrt( os, false ); // turn off 260 280 } // ?|? 261 281 … … 263 283 ostype & ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 264 284 (ostype)(manip( os )); 265 setNonl( os, false ); // ignore nonl in middle266 285 return os; 267 286 } // ?|? 268 287 void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 269 288 (ostype)(manip( os )); 270 if ( getANL( os ) && ! getNonl( os ) ) nl( os ); // ignore nl if nonl at end271 set Nonl( os, false );289 if ( getANL( os ) && getPrt( os ) ) nl( os ); // ignore auto nl? 290 setPrt( os, false ); // turn off 272 291 } // ?|? 273 292 … … 282 301 ostype & nl( ostype & os ) { 283 302 (ostype)(os | '\n'); 303 setPrt( os, false ); // turn off 284 304 setNL( os, true ); 285 305 flush( os ); … … 288 308 289 309 ostype & nonl( ostype & os ) { 290 set Nonl( os, true ); // indicate nonl manipulator310 setPrt( os, false ); // turn off 291 311 return os; 292 312 } // nonl … … 339 359 sepSetCur( os, sepGet( os ) ); // switch to regular separator 340 360 if ( getANL( os ) ) nl( os ); 361 setPrt( os, false ); // turn off 341 362 } // ?|? 342 363 } // distribution -
libcfa/src/iostream.hfa
r760235a r5ea5b28 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 22:01:31201813 // Update Count : 21 312 // Last Modified On : Sat Dec 22 17:00:39 2018 13 // Update Count : 218 14 14 // 15 15 … … 28 28 void setNL( ostype &, bool ); // saw newline 29 29 bool getANL( ostype & ); // check auto newline 30 bool get Nonl( ostype & ); // check nonnl manipulator31 void set Nonl( ostype &, bool ); // set nonnl manipulator30 bool getPrt( ostype & ); // check ignore auto NL 31 void setPrt( ostype &, bool ); // set ignore auto NL 32 32 // public 33 33 void sepOn( ostype & ); // turn separator state on … … 63 63 forall( dtype ostype | ostream( ostype ) ) { 64 64 ostype & ?|?( ostype &, bool ); 65 void &?|?( ostype &, bool );65 void ?|?( ostype &, bool ); 66 66 67 67 ostype & ?|?( ostype &, char ); 68 void &?|?( ostype &, char );68 void ?|?( ostype &, char ); 69 69 ostype & ?|?( ostype &, signed char ); 70 void &?|?( ostype &, signed char );70 void ?|?( ostype &, signed char ); 71 71 ostype & ?|?( ostype &, unsigned char ); 72 void &?|?( ostype &, unsigned char );72 void ?|?( ostype &, unsigned char ); 73 73 74 74 ostype & ?|?( ostype &, short int ); 75 void &?|?( ostype &, short int );75 void ?|?( ostype &, short int ); 76 76 ostype & ?|?( ostype &, unsigned short int ); 77 void &?|?( ostype &, unsigned short int );77 void ?|?( ostype &, unsigned short int ); 78 78 ostype & ?|?( ostype &, int ); 79 void &?|?( ostype &, int );79 void ?|?( ostype &, int ); 80 80 ostype & ?|?( ostype &, unsigned int ); 81 void &?|?( ostype &, unsigned int );81 void ?|?( ostype &, unsigned int ); 82 82 ostype & ?|?( ostype &, long int ); 83 void &?|?( ostype &, long int );83 void ?|?( ostype &, long int ); 84 84 ostype & ?|?( ostype &, long long int ); 85 void &?|?( ostype &, long long int );85 void ?|?( ostype &, long long int ); 86 86 ostype & ?|?( ostype &, unsigned long int ); 87 void &?|?( ostype &, unsigned long int );87 void ?|?( ostype &, unsigned long int ); 88 88 ostype & ?|?( ostype &, unsigned long long int ); 89 void &?|?( ostype &, unsigned long long int );89 void ?|?( ostype &, unsigned long long int ); 90 90 91 91 ostype & ?|?( ostype &, float ); // FIX ME: should not be required 92 void &?|?( ostype &, float ); // FIX ME: should not be required92 void ?|?( ostype &, float ); // FIX ME: should not be required 93 93 ostype & ?|?( ostype &, double ); 94 void &?|?( ostype &, double );94 void ?|?( ostype &, double ); 95 95 ostype & ?|?( ostype &, long double ); 96 void &?|?( ostype &, long double );96 void ?|?( ostype &, long double ); 97 97 98 98 ostype & ?|?( ostype &, float _Complex ); 99 void &?|?( ostype &, float _Complex );99 void ?|?( ostype &, float _Complex ); 100 100 ostype & ?|?( ostype &, double _Complex ); 101 void &?|?( ostype &, double _Complex );101 void ?|?( ostype &, double _Complex ); 102 102 ostype & ?|?( ostype &, long double _Complex ); 103 void &?|?( ostype &, long double _Complex );103 void ?|?( ostype &, long double _Complex ); 104 104 105 105 ostype & ?|?( ostype &, const char * ); 106 void &?|?( ostype &, const char * );106 void ?|?( ostype &, const char * ); 107 107 // ostype & ?|?( ostype &, const char16_t * ); 108 108 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous … … 111 111 // ostype & ?|?( ostype &, const wchar_t * ); 112 112 ostype & ?|?( ostype &, const void * ); 113 void &?|?( ostype &, const void * );113 void ?|?( ostype &, const void * ); 114 114 115 115 // manipulators -
libcfa/src/stdlib.hfa
r760235a r5ea5b28 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 27 07:21:36201813 // Update Count : 34 512 // Last Modified On : Mon Dec 17 15:37:45 2018 13 // Update Count : 346 14 14 // 15 15 … … 178 178 179 179 static inline { 180 int ato( const char * sptr ) { return (int)strtol( sptr, 0, 10 ); }180 int ato( const char * sptr ) { return (int)strtol( sptr, 0, 10 ); } 181 181 unsigned int ato( const char * sptr ) { return (unsigned int)strtoul( sptr, 0, 10 ); } 182 182 long int ato( const char * sptr ) { return strtol( sptr, 0, 10 ); }
Note: See TracChangeset
for help on using the changeset viewer.