Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.hfa

    rf842032 r0d49efb  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Oct 18 21:21:20 2023
    13 // Update Count     : 583
     12// Last Modified On : Sun Oct  8 12:02:55 2023
     13// Update Count     : 568
    1414//
    1515
     
    306306// *********************************** istream ***********************************
    307307
     308#define ISTYPE_VOID( T ) void ?|?( istype &, T )
     309#define ISTYPE_VOID_IMPL( T ) \
     310        void ?|?( istype & is, T t ) { \
     311                (istype &)(is | t); ends( is ); \
     312        } // ?|?
     313
    308314forall( istype & )
    309315trait basic_istream {
     
    314320        void nlOn( istype & );                                                          // read newline
    315321        void nlOff( istype & );                                                         // scan newline
     322        void ends( istype & os );                                                       // end of output statement
    316323        int fmt( istype &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) ));
    317324        istype & ungetc( istype &, char );
    318325        bool eof( istype & );
    319         void clear( istype & );
    320326}; // basic_istream
    321327
     
    323329trait istream {
    324330        bool fail( istype & );
    325         void open( istype & is, const char name[], const char mode[] );
     331        void clear( istype & );
    326332        void open( istype & is, const char name[] );
    327333        void close( istype & is );
     
    336342forall( istype & | basic_istream( istype ) ) {
    337343        istype & ?|?( istype &, bool & );
     344        ISTYPE_VOID( bool & );
    338345
    339346        istype & ?|?( istype &, char & );
     347        ISTYPE_VOID( char & );
    340348        istype & ?|?( istype &, signed char & );
     349        ISTYPE_VOID( signed char & );
    341350        istype & ?|?( istype &, unsigned char & );
     351        ISTYPE_VOID( unsigned char & );
    342352
    343353        istype & ?|?( istype &, short int & );
     354        ISTYPE_VOID( short int & );
    344355        istype & ?|?( istype &, unsigned short int & );
     356        ISTYPE_VOID( unsigned short int & );
    345357        istype & ?|?( istype &, int & );
     358        ISTYPE_VOID( int & );
    346359        istype & ?|?( istype &, unsigned int & );
     360        ISTYPE_VOID( unsigned int & );
    347361        istype & ?|?( istype &, long int & );
     362        ISTYPE_VOID( long int & );
    348363        istype & ?|?( istype &, unsigned long int & );
     364        ISTYPE_VOID( unsigned long int & );
    349365        istype & ?|?( istype &, long long int & );
     366        ISTYPE_VOID( long long int & );
    350367        istype & ?|?( istype &, unsigned long long int & );
     368        ISTYPE_VOID( unsigned long long int & );
    351369        #if defined( __SIZEOF_INT128__ )
    352370        istype & ?|?( istype &, int128 & );
     371        ISTYPE_VOID( int128 & );
    353372        istype & ?|?( istype &, unsigned int128 & );
     373        ISTYPE_VOID( unsigned int128 & );
    354374        #endif // __SIZEOF_INT128__
    355375
    356376        istype & ?|?( istype &, float & );
     377        ISTYPE_VOID( float & );
    357378        istype & ?|?( istype &, double & );
     379        ISTYPE_VOID( double & );
    358380        istype & ?|?( istype &, long double & );
     381        ISTYPE_VOID( long double & );
    359382
    360383        istype & ?|?( istype &, float _Complex & );
     384        ISTYPE_VOID( float _Complex & );
    361385        istype & ?|?( istype &, double _Complex & );
     386        ISTYPE_VOID( double _Complex & );
    362387        istype & ?|?( istype &, long double _Complex & );
     388        ISTYPE_VOID( long double _Complex & );
    363389
    364390        istype & ?|?( istype &, const char [] );
     391        ISTYPE_VOID( const char [] );
    365392
    366393        // manipulators
    367394        istype & ?|?( istype &, istype & (*)( istype & ) );
     395        ISTYPE_VOID( istype & (*)( istype & ) );
    368396        istype & nl( istype & is );
    369397        istype & nlOn( istype & );
     
    374402
    375403ExceptionDecl( cstring_length );
    376 ExceptionDecl( missing_data );
    377404
    378405// *********************************** manipulators ***********************************
    379406
    380 // skip does not compose with other C string manipulators.
    381407struct _Istream_Cskip {
    382408        const char * scanset;
     
    390416forall( istype & | basic_istream( istype ) ) {
    391417        istype & ?|?( istype & is, _Istream_Cskip f );
     418        ISTYPE_VOID( _Istream_Cskip );
    392419}
    393420
     
    431458forall( istype & | basic_istream( istype ) ) {
    432459        istype & ?|?( istype & is, _Istream_Cstr f );
     460        ISTYPE_VOID( _Istream_Cstr );
    433461}
    434462
     
    443471forall( istype & | basic_istream( istype ) ) {
    444472        istype & ?|?( istype & is, _Istream_Char f );
     473        ISTYPE_VOID( _Istream_Char );
    445474}
    446475
     
    461490forall( istype & | basic_istream( istype ) ) { \
    462491        istype & ?|?( istype & is, _Istream_Manip(T) f ); \
     492        ISTYPE_VOID( _Istream_Manip(T) ); \
    463493} // ?|?
    464494
Note: See TracChangeset for help on using the changeset viewer.