Changes in libcfa/src/iostream.hfa [94d2544:f5d9c37]
- File:
-
- 1 edited
-
libcfa/src/iostream.hfa (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.hfa
r94d2544 rf5d9c37 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 18 10:42:52202313 // Update Count : 4 3812 // Last Modified On : Thu Jun 29 11:07:25 2023 13 // Update Count : 427 14 14 // 15 15 … … 74 74 // implement writable for intrinsic types 75 75 76 #define OSTYPE_VOID( T ) void ?|?( ostype &, T )77 #define OSTYPE_VOID_IMPL( T ) \78 void ?|?( ostype & os, T t ) { \79 (ostype &)(os | t); ends( os ); \80 } // ?|?81 82 76 forall( ostype & | basic_ostream( ostype ) ) { 83 77 ostype & ?|?( ostype &, bool ); 84 OSTYPE_VOID(bool );78 void ?|?( ostype &, bool ); 85 79 86 80 ostype & ?|?( ostype &, char ); 87 OSTYPE_VOID(char );81 void ?|?( ostype &, char ); 88 82 ostype & ?|?( ostype &, signed char ); 89 OSTYPE_VOID(signed char );83 void ?|?( ostype &, signed char ); 90 84 ostype & ?|?( ostype &, unsigned char ); 91 OSTYPE_VOID(unsigned char );85 void ?|?( ostype &, unsigned char ); 92 86 93 87 ostype & ?|?( ostype &, short int ); 94 OSTYPE_VOID(short int );88 void ?|?( ostype &, short int ); 95 89 ostype & ?|?( ostype &, unsigned short int ); 96 OSTYPE_VOID(unsigned short int );90 void ?|?( ostype &, unsigned short int ); 97 91 ostype & ?|?( ostype &, int ); 98 OSTYPE_VOID(int );92 void ?|?( ostype &, int ); 99 93 ostype & ?|?( ostype &, unsigned int ); 100 OSTYPE_VOID(unsigned int );94 void ?|?( ostype &, unsigned int ); 101 95 ostype & ?|?( ostype &, long int ); 102 OSTYPE_VOID(long int );96 void ?|?( ostype &, long int ); 103 97 ostype & ?|?( ostype &, long long int ); 104 OSTYPE_VOID(long long int );98 void ?|?( ostype &, long long int ); 105 99 ostype & ?|?( ostype &, unsigned long int ); 106 OSTYPE_VOID(unsigned long int );100 void ?|?( ostype &, unsigned long int ); 107 101 ostype & ?|?( ostype &, unsigned long long int ); 108 OSTYPE_VOID(unsigned long long int );102 void ?|?( ostype &, unsigned long long int ); 109 103 #if defined( __SIZEOF_INT128__ ) 110 104 ostype & ?|?( ostype &, int128 ); 111 OSTYPE_VOID(int128 );105 void ?|?( ostype &, int128 ); 112 106 ostype & ?|?( ostype &, unsigned int128 ); 113 OSTYPE_VOID(unsigned int128 );107 void ?|?( ostype &, unsigned int128 ); 114 108 #endif // __SIZEOF_INT128__ 115 109 116 110 ostype & ?|?( ostype &, float ); 117 OSTYPE_VOID(float );111 void ?|?( ostype &, float ); 118 112 ostype & ?|?( ostype &, double ); 119 OSTYPE_VOID(double );113 void ?|?( ostype &, double ); 120 114 ostype & ?|?( ostype &, long double ); 121 OSTYPE_VOID(long double );115 void ?|?( ostype &, long double ); 122 116 123 117 ostype & ?|?( ostype &, float _Complex ); 124 OSTYPE_VOID(float _Complex );118 void ?|?( ostype &, float _Complex ); 125 119 ostype & ?|?( ostype &, double _Complex ); 126 OSTYPE_VOID(double _Complex );120 void ?|?( ostype &, double _Complex ); 127 121 ostype & ?|?( ostype &, long double _Complex ); 128 OSTYPE_VOID(long double _Complex );122 void ?|?( ostype &, long double _Complex ); 129 123 130 124 ostype & ?|?( ostype &, const char [] ); 131 OSTYPE_VOID(const char [] );125 void ?|?( ostype &, const char [] ); 132 126 // ostype & ?|?( ostype &, const char16_t * ); 133 127 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous … … 136 130 // ostype & ?|?( ostype &, const wchar_t * ); 137 131 ostype & ?|?( ostype &, const void * ); 138 OSTYPE_VOID(const void * );132 void ?|?( ostype &, const void * ); 139 133 140 134 // manipulators 141 135 ostype & ?|?( ostype &, ostype & (*)( ostype & ) ); 142 OSTYPE_VOID(ostype & (*)( ostype & ) );136 void ?|?( ostype &, ostype & (*)( ostype & ) ); 143 137 144 138 ostype & nl( ostype & ); … … 196 190 // initialized explicitly shall be initialized implicitly the same as objects that have static storage duration.*** 197 191 198 #define I NTEGRAL_FMT_DECL( T, CODE ) \192 #define IntegralFMTDecl( T, CODE ) \ 199 193 static inline { \ 200 194 _Ostream_Manip(T) bin( T val ) { return (_Ostream_Manip(T))@{ val, 1, 0, 'b', { .all : 0 } }; } \ … … 217 211 } // ?|? 218 212 219 I NTEGRAL_FMT_DECL( signed char, 'd' )220 I NTEGRAL_FMT_DECL( unsigned char, 'u' )221 I NTEGRAL_FMT_DECL( signed short int, 'd' )222 I NTEGRAL_FMT_DECL( unsigned short int, 'u' )223 I NTEGRAL_FMT_DECL( signed int, 'd' )224 I NTEGRAL_FMT_DECL( unsigned int, 'u' )225 I NTEGRAL_FMT_DECL( signed long int, 'd' )226 I NTEGRAL_FMT_DECL( unsigned long int, 'u' )227 I NTEGRAL_FMT_DECL( signed long long int, 'd' )228 I NTEGRAL_FMT_DECL( unsigned long long int, 'u' )213 IntegralFMTDecl( signed char, 'd' ) 214 IntegralFMTDecl( unsigned char, 'u' ) 215 IntegralFMTDecl( signed short int, 'd' ) 216 IntegralFMTDecl( unsigned short int, 'u' ) 217 IntegralFMTDecl( signed int, 'd' ) 218 IntegralFMTDecl( unsigned int, 'u' ) 219 IntegralFMTDecl( signed long int, 'd' ) 220 IntegralFMTDecl( unsigned long int, 'u' ) 221 IntegralFMTDecl( signed long long int, 'd' ) 222 IntegralFMTDecl( unsigned long long int, 'u' ) 229 223 #if defined( __SIZEOF_INT128__ ) 230 I NTEGRAL_FMT_DECL( int128, 'd' )231 I NTEGRAL_FMT_DECL( unsigned int128, 'u' )224 IntegralFMTDecl( int128, 'd' ) 225 IntegralFMTDecl( unsigned int128, 'u' ) 232 226 #endif // __SIZEOF_INT128__ 233 227 … … 235 229 236 230 // Default suffix for values with no fraction is "." 237 #define F LOATING_POINT_FMT_DECL( T ) \231 #define FloatingPointFMTDecl( T ) \ 238 232 static inline { \ 239 233 _Ostream_Manip(T) hex( T val ) { return (_Ostream_Manip(T))@{ val, 1, 0, 'a', { .all : 0 } }; } \ … … 262 256 } // ?|? 263 257 264 F LOATING_POINT_FMT_DECL( double )265 F LOATING_POINT_FMT_DECL( long double )258 FloatingPointFMTDecl( double ) 259 FloatingPointFMTDecl( long double ) 266 260 267 261 // *********************************** character *********************************** … … 303 297 // *********************************** istream *********************************** 304 298 305 306 #define ISTYPE_VOID( T ) void ?|?( istype &, T )307 #define ISTYPE_VOID_IMPL( T ) \308 void ?|?( istype & is, T & t ) { \309 (istype &)(is | t); ends( is ); \310 } // ?|?311 299 312 300 forall( istype & ) … … 339 327 forall( istype & | basic_istream( istype ) ) { 340 328 istype & ?|?( istype &, bool & ); 341 ISTYPE_VOID(bool & );329 void ?|?( istype &, bool & ); 342 330 343 331 istype & ?|?( istype &, char & ); 344 ISTYPE_VOID(char & );332 void ?|?( istype &, char & ); 345 333 istype & ?|?( istype &, signed char & ); 346 ISTYPE_VOID(signed char & );334 void ?|?( istype &, signed char & ); 347 335 istype & ?|?( istype &, unsigned char & ); 348 ISTYPE_VOID(unsigned char & );336 void ?|?( istype &, unsigned char & ); 349 337 350 338 istype & ?|?( istype &, short int & ); 351 ISTYPE_VOID(short int & );339 void ?|?( istype &, short int & ); 352 340 istype & ?|?( istype &, unsigned short int & ); 353 ISTYPE_VOID(unsigned short int & );341 void ?|?( istype &, unsigned short int & ); 354 342 istype & ?|?( istype &, int & ); 355 ISTYPE_VOID(int & );343 void ?|?( istype &, int & ); 356 344 istype & ?|?( istype &, unsigned int & ); 357 ISTYPE_VOID(unsigned int & );345 void ?|?( istype &, unsigned int & ); 358 346 istype & ?|?( istype &, long int & ); 359 ISTYPE_VOID(long int & );347 void ?|?( istype &, long int & ); 360 348 istype & ?|?( istype &, unsigned long int & ); 361 ISTYPE_VOID(unsigned long int & );349 void ?|?( istype &, unsigned long int & ); 362 350 istype & ?|?( istype &, long long int & ); 363 ISTYPE_VOID(long long int & );351 void ?|?( istype &, long long int & ); 364 352 istype & ?|?( istype &, unsigned long long int & ); 365 ISTYPE_VOID(unsigned long long int & );353 void ?|?( istype &, unsigned long long int & ); 366 354 #if defined( __SIZEOF_INT128__ ) 367 355 istype & ?|?( istype &, int128 & ); 368 ISTYPE_VOID(int128 & );356 void ?|?( istype &, int128 & ); 369 357 istype & ?|?( istype &, unsigned int128 & ); 370 ISTYPE_VOID(unsigned int128 & );358 void ?|?( istype &, unsigned int128 & ); 371 359 #endif // __SIZEOF_INT128__ 372 360 373 361 istype & ?|?( istype &, float & ); 374 ISTYPE_VOID(float & );362 void ?|?( istype &, float & ); 375 363 istype & ?|?( istype &, double & ); 376 ISTYPE_VOID(double & );364 void ?|?( istype &, double & ); 377 365 istype & ?|?( istype &, long double & ); 378 ISTYPE_VOID(long double & );366 void ?|?( istype &, long double & ); 379 367 380 368 istype & ?|?( istype &, float _Complex & ); 381 ISTYPE_VOID(float _Complex & );369 void ?|?( istype &, float _Complex & ); 382 370 istype & ?|?( istype &, double _Complex & ); 383 ISTYPE_VOID(double _Complex & );371 void ?|?( istype &, double _Complex & ); 384 372 istype & ?|?( istype &, long double _Complex & ); 385 ISTYPE_VOID(long double _Complex & );373 void ?|?( istype &, long double _Complex & ); 386 374 387 375 // istype & ?|?( istype &, const char [] ); … … 391 379 // manipulators 392 380 istype & ?|?( istype &, istype & (*)( istype & ) ); 393 ISTYPE_VOID(istype & (*)( istype & ) );381 void ?|?( istype &, istype & (*)( istype & ) ); 394 382 istype & nl( istype & is ); 395 383 istype & nlOn( istype & ); … … 449 437 }; // _Istream_Manip 450 438 451 #define I NPUT_FMT_DECL( T ) \439 #define InputFMTDecl( T ) \ 452 440 static inline { \ 453 441 _Istream_Manip(T) ignore( const T & val ) { return (_Istream_Manip(T))@{ (T &)val, -1, true }; } \ … … 461 449 } // ?|? 462 450 463 I NPUT_FMT_DECL( signed char )464 I NPUT_FMT_DECL( unsigned char )465 I NPUT_FMT_DECL( signed short int )466 I NPUT_FMT_DECL( unsigned short int )467 I NPUT_FMT_DECL( signed int )468 I NPUT_FMT_DECL( unsigned int )469 I NPUT_FMT_DECL( signed long int )470 I NPUT_FMT_DECL( unsigned long int )471 I NPUT_FMT_DECL( signed long long int )472 I NPUT_FMT_DECL( unsigned long long int )473 474 I NPUT_FMT_DECL( float )475 I NPUT_FMT_DECL( double )476 I NPUT_FMT_DECL( long double )477 478 I NPUT_FMT_DECL( float _Complex )479 I NPUT_FMT_DECL( double _Complex )480 I NPUT_FMT_DECL( long double _Complex )451 InputFMTDecl( signed char ) 452 InputFMTDecl( unsigned char ) 453 InputFMTDecl( signed short int ) 454 InputFMTDecl( unsigned short int ) 455 InputFMTDecl( signed int ) 456 InputFMTDecl( unsigned int ) 457 InputFMTDecl( signed long int ) 458 InputFMTDecl( unsigned long int ) 459 InputFMTDecl( signed long long int ) 460 InputFMTDecl( unsigned long long int ) 461 462 InputFMTDecl( float ) 463 InputFMTDecl( double ) 464 InputFMTDecl( long double ) 465 466 InputFMTDecl( float _Complex ) 467 InputFMTDecl( double _Complex ) 468 InputFMTDecl( long double _Complex ) 481 469 482 470
Note:
See TracChangeset
for help on using the changeset viewer.