Changeset 8d321f9
- Timestamp:
- Jun 19, 2020, 5:46:38 PM (3 years ago)
- Branches:
- arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6c4bd02
- Parents:
- 1d2314f
- Location:
- libcfa/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
r1d2314f r8d321f9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 18 15:37:21202013 // Update Count : 38 012 // Last Modified On : Fri Jun 19 16:24:54 2020 13 // Update Count : 384 14 14 // 15 15 … … 26 26 27 27 28 // *********************************** ofstream ***********************************28 // *********************************** ofstream *********************************** 29 29 30 30 … … 123 123 #ifdef __CFA_DEBUG__ 124 124 if ( file == 0p ) { 125 throw ( IO_OPEN_FAILURE){ os };126 abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno );125 throw (Open_Failure){ os }; 126 // abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno ); 127 127 } // if 128 128 #endif // __CFA_DEBUG__ … … 182 182 183 183 184 // *********************************** ifstream ***********************************184 // *********************************** ifstream *********************************** 185 185 186 186 … … 222 222 #ifdef __CFA_DEBUG__ 223 223 if ( file == 0p ) { 224 throw ( IO_OPEN_FAILURE){ is };225 abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno );224 throw (Open_Failure){ is }; 225 // abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno ); 226 226 } // if 227 227 #endif // __CFA_DEBUG__ … … 283 283 284 284 285 // *********************************** exceptions ***********************************286 287 288 void ?{}( IO_OPEN_FAILURE& this, ofstream & ostream ) {289 VTABLE_INIT(this, IO_OPEN_FAILURE);285 // *********************************** exceptions *********************************** 286 287 288 void ?{}( Open_Failure & this, ofstream & ostream ) { 289 VTABLE_INIT(this, Open_Failure); 290 290 this.ostream = &ostream; 291 } 292 void ?{}( IO_OPEN_FAILURE & this, ifstream & istream ) { 293 VTABLE_INIT(this, IO_OPEN_FAILURE); 291 this.tag = 1; 292 } 293 void ?{}( Open_Failure & this, ifstream & istream ) { 294 VTABLE_INIT(this, Open_Failure); 294 295 this.istream = &istream; 295 } 296 const char * IO_OPEN_FAILURE_msg(IO_OPEN_FAILURE * this) { 297 return "IO_OPEN_FAILURE"; 298 } 299 VTABLE_INSTANCE(IO_OPEN_FAILURE)(IO_OPEN_FAILURE_msg); 300 void throwIO_OPEN_FAILURE( ofstream & ostream ) { 301 IO_OPEN_FAILURE exc = { ostream }; 302 } 303 void throwIO_OPEN_FAILURE( ifstream & istream ) { 304 IO_OPEN_FAILURE exc = { istream }; 296 this.tag = 0; 297 } 298 const char * Open_Failure_msg(Open_Failure * this) { 299 return "Open_Failure"; 300 } 301 VTABLE_INSTANCE(Open_Failure)(Open_Failure_msg); 302 void throwOpen_Failure( ofstream & ostream ) { 303 Open_Failure exc = { ostream }; 304 } 305 void throwOpen_Failure( ifstream & istream ) { 306 Open_Failure exc = { istream }; 305 307 } 306 308 -
libcfa/src/fstream.hfa
r1d2314f r8d321f9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 16 20:41:21202013 // Update Count : 18 412 // Last Modified On : Fri Jun 19 16:29:17 2020 13 // Update Count : 189 14 14 // 15 15 … … 20 20 21 21 22 // *********************************** ofstream ***********************************22 // *********************************** ofstream *********************************** 23 23 24 24 … … 79 79 80 80 81 // *********************************** ifstream ***********************************81 // *********************************** ifstream *********************************** 82 82 83 83 … … 108 108 109 109 110 // *********************************** exceptions ***********************************110 // *********************************** exceptions *********************************** 111 111 112 112 113 DATA_EXCEPTION( IO_OPEN_FAILURE)(113 DATA_EXCEPTION(Open_Failure)( 114 114 union { 115 115 ofstream * ostream; 116 116 ifstream * istream; 117 117 }; 118 // TEMPORARY: need polymorphic exceptions 119 int tag; // 1 => ostream; 0 => istream 118 120 ); 119 121 120 void ?{}( IO_OPEN_FAILURE& this, ofstream & ostream );121 void ?{}( IO_OPEN_FAILURE& this, ifstream & istream );122 void ?{}( Open_Failure & this, ofstream & ostream ); 123 void ?{}( Open_Failure & this, ifstream & istream ); 122 124 123 125 // Local Variables: // -
libcfa/src/iostream.cfa
r1d2314f r8d321f9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 08:48:53202013 // Update Count : 101 812 // Last Modified On : Fri Jun 19 16:15:34 2020 13 // Update Count : 1019 14 14 // 15 15 … … 33 33 34 34 35 // *********************************** ostream ***********************************35 // *********************************** ostream *********************************** 36 36 37 37 … … 447 447 } // distribution 448 448 449 // *********************************** manipulators ***********************************450 451 // *********************************** integral ***********************************449 // *********************************** manipulators *********************************** 450 451 // *********************************** integral *********************************** 452 452 453 453 static const char * shortbin[] = { "0", "1", "10", "11", "100", "101", "110", "111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" }; … … 664 664 #endif // __SIZEOF_INT128__ 665 665 666 // *********************************** floating point ***********************************666 // *********************************** floating point *********************************** 667 667 668 668 #define PrintWithDP2( os, format, val, ... ) \ … … 720 720 FloatingPointFMTImpl( long double, "% *L ", "% *.*L " ) 721 721 722 // *********************************** character ***********************************722 // *********************************** character *********************************** 723 723 724 724 forall( dtype ostype | ostream( ostype ) ) { … … 753 753 } // distribution 754 754 755 // *********************************** C string ***********************************755 // *********************************** C string *********************************** 756 756 757 757 forall( dtype ostype | ostream( ostype ) ) { … … 800 800 801 801 802 // *********************************** istream ***********************************802 // *********************************** istream *********************************** 803 803 804 804 … … 946 946 } // distribution 947 947 948 // *********************************** manipulators ***********************************948 // *********************************** manipulators *********************************** 949 949 950 950 forall( dtype istype | istream( istype ) ) -
libcfa/src/iostream.hfa
r1d2314f r8d321f9 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 20 15:30:56 202013 // Update Count : 33 712 // Last Modified On : Fri Jun 19 16:15:56 2020 13 // Update Count : 338 14 14 // 15 15 … … 19 19 20 20 21 // *********************************** ostream ***********************************21 // *********************************** ostream *********************************** 22 22 23 23 … … 156 156 } // distribution 157 157 158 // *********************************** manipulators ***********************************158 // *********************************** manipulators *********************************** 159 159 160 160 forall( otype T ) … … 175 175 }; // _Ostream_Manip 176 176 177 // *********************************** integral ***********************************177 // *********************************** integral *********************************** 178 178 179 179 // See 6.7.9. 19) The initialization shall occur in initializer list order, each initializer provided for a particular … … 217 217 #endif 218 218 219 // *********************************** floating point ***********************************219 // *********************************** floating point *********************************** 220 220 221 221 // Default suffix for values with no fraction is "." … … 246 246 FloatingPointFMTDecl( long double ) 247 247 248 // *********************************** character ***********************************248 // *********************************** character *********************************** 249 249 250 250 static inline { … … 263 263 } // ?|? 264 264 265 // *********************************** C string ***********************************265 // *********************************** C string *********************************** 266 266 267 267 static inline { … … 282 282 283 283 284 // *********************************** istream ***********************************284 // *********************************** istream *********************************** 285 285 286 286 … … 336 336 } // distribution 337 337 338 // *********************************** manipulators ***********************************338 // *********************************** manipulators *********************************** 339 339 340 340 struct _Istream_Cstr { … … 413 413 414 414 415 // *********************************** time ***********************************415 // *********************************** time *********************************** 416 416 417 417
Note: See TracChangeset
for help on using the changeset viewer.