Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    rdc5072f r65240bb  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 13 17:21:10 2019
    13 // Update Count     : 812
     12// Last Modified On : Fri Jul 12 12:04:13 2019
     13// Update Count     : 819
    1414//
    1515
     
    3030
    3131
    32 //*********************************** Ostream ***********************************
     32//*********************************** ostream ***********************************
    3333
    3434
     
    4040        } // ?|?
    4141        void ?|?( ostype & os, zero_t z ) {
    42                 (ostype &)(os | z); nl( os );
     42                (ostype &)(os | z); ends( os );
    4343        } // ?|?
    4444
     
    4949        } // ?|?
    5050        void ?|?( ostype & os, one_t o ) {
    51                 (ostype &)(os | o); nl( os );
     51                (ostype &)(os | o); ends( os );
    5252        } // ?|?
    5353
     
    5858        } // ?|?
    5959        void ?|?( ostype & os, bool b ) {
    60                 (ostype &)(os | b); nl( os );
     60                (ostype &)(os | b); ends( os );
    6161        } // ?|?
    6262
     
    6767        } // ?|?
    6868        void ?|?( ostype & os, char c ) {
    69                 (ostype &)(os | c); nl( os );
     69                (ostype &)(os | c); ends( os );
    7070        } // ?|?
    7171
     
    7676        } // ?|?
    7777        void ?|?( ostype & os, signed char sc ) {
    78                 (ostype &)(os | sc); nl( os );
     78                (ostype &)(os | sc); ends( os );
    7979        } // ?|?
    8080
     
    8585        } // ?|?
    8686        void ?|?( ostype & os, unsigned char usc ) {
    87                 (ostype &)(os | usc); nl( os );
     87                (ostype &)(os | usc); ends( os );
    8888        } // ?|?
    8989
     
    9494        } // ?|?
    9595        void & ?|?( ostype & os, short int si ) {
    96                 (ostype &)(os | si); nl( os );
     96                (ostype &)(os | si); ends( os );
    9797        } // ?|?
    9898
     
    103103        } // ?|?
    104104        void & ?|?( ostype & os, unsigned short int usi ) {
    105                 (ostype &)(os | usi); nl( os );
     105                (ostype &)(os | usi); ends( os );
    106106        } // ?|?
    107107
     
    112112        } // ?|?
    113113        void & ?|?( ostype & os, int i ) {
    114                 (ostype &)(os | i); nl( os );
     114                (ostype &)(os | i); ends( os );
    115115        } // ?|?
    116116
     
    121121        } // ?|?
    122122        void & ?|?( ostype & os, unsigned int ui ) {
    123                 (ostype &)(os | ui); nl( os );
     123                (ostype &)(os | ui); ends( os );
    124124        } // ?|?
    125125
     
    130130        } // ?|?
    131131        void & ?|?( ostype & os, long int li ) {
    132                 (ostype &)(os | li); nl( os );
     132                (ostype &)(os | li); ends( os );
    133133        } // ?|?
    134134
     
    139139        } // ?|?
    140140        void & ?|?( ostype & os, unsigned long int uli ) {
    141                 (ostype &)(os | uli); nl( os );
     141                (ostype &)(os | uli); ends( os );
    142142        } // ?|?
    143143
     
    148148        } // ?|?
    149149        void & ?|?( ostype & os, long long int lli ) {
    150                 (ostype &)(os | lli); nl( os );
     150                (ostype &)(os | lli); ends( os );
    151151        } // ?|?
    152152
     
    157157        } // ?|?
    158158        void & ?|?( ostype & os, unsigned long long int ulli ) {
    159                 (ostype &)(os | ulli); nl( os );
     159                (ostype &)(os | ulli); ends( os );
    160160        } // ?|?
    161161
     
    180180        } // ?|?
    181181        void & ?|?( ostype & os, float f ) {
    182                 (ostype &)(os | f); nl( os );
     182                (ostype &)(os | f); ends( os );
    183183        } // ?|?
    184184
     
    189189        } // ?|?
    190190        void & ?|?( ostype & os, double d ) {
    191                 (ostype &)(os | d); nl( os );
     191                (ostype &)(os | d); ends( os );
    192192        } // ?|?
    193193
     
    198198        } // ?|?
    199199        void & ?|?( ostype & os, long double ld ) {
    200                 (ostype &)(os | ld); nl( os );
     200                (ostype &)(os | ld); ends( os );
    201201        } // ?|?
    202202
     
    210210        } // ?|?
    211211        void & ?|?( ostype & os, float _Complex fc ) {
    212                 (ostype &)(os | fc); nl( os );
     212                (ostype &)(os | fc); ends( os );
    213213        } // ?|?
    214214
     
    222222        } // ?|?
    223223        void & ?|?( ostype & os, double _Complex dc ) {
    224                 (ostype &)(os | dc); nl( os );
     224                (ostype &)(os | dc); ends( os );
    225225        } // ?|?
    226226
     
    234234        } // ?|?
    235235        void & ?|?( ostype & os, long double _Complex ldc ) {
    236                 (ostype &)(os | ldc); nl( os );
     236                (ostype &)(os | ldc); ends( os );
    237237        } // ?|?
    238238
     
    276276        } // ?|?
    277277        void ?|?( ostype & os, const char * str ) {
    278                 (ostype &)(os | str); nl( os );
     278                (ostype &)(os | str); ends( os );
    279279        } // ?|?
    280280
     
    305305        } // ?|?
    306306        void ?|?( ostype & os, const void * p ) {
    307                 (ostype &)(os | p); nl( os );
     307                (ostype &)(os | p); ends( os );
    308308        } // ?|?
    309309
     
    315315        void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) {
    316316                (ostype &)(manip( os ));
    317                 if ( getPrt( os ) ) nl( os );                                   // something printed ?
     317                if ( getPrt( os ) ) ends( os );                                 // something printed ?
    318318                setPrt( os, false );                                                    // turn off
    319319        } // ?|?
     
    335335        } // nl
    336336
    337         void nl( ostype & os ) {
    338                 if ( getANL( os ) ) (ostype &)(nl( os ));               // implementation only
    339                 else setPrt( os, false );                                               // turn off
    340         } // nl
    341 
    342337        ostype & nonl( ostype & os ) {
    343338                setPrt( os, false );                                                    // turn off
     
    386381        } // ?|?
    387382        void ?|?( ostype & os, T arg, Params rest ) {
    388                 // (ostype &)(?|?( os, arg, rest )); nl( os );
     383                // (ostype &)(?|?( os, arg, rest )); ends( os );
    389384                (ostype &)(os | arg);                                                   // print first argument
    390385                sepSetCur( os, sepGetTuple( os ) );                             // switch to tuple separator
    391386                (ostype &)(os | rest);                                                  // print remaining arguments
    392387                sepSetCur( os, sepGet( os ) );                                  // switch to regular separator
    393                 nl( os );
     388                ends( os );
    394389        } // ?|?
    395390} // distribution
     
    408403} // distribution
    409404
    410 //*********************************** Manipulators ***********************************
    411 
    412 //*********************************** Integral ***********************************
     405//*********************************** manipulators ***********************************
     406
     407//*********************************** integral ***********************************
    413408
    414409static const char * shortbin[] = { "0", "1", "10", "11", "100", "101", "110", "111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" };
     
    478473                return os; \
    479474        } /* ?|? */ \
    480         void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); nl( os ); } \
     475        void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); ends( os ); } \
    481476} // distribution
    482477
     
    492487IntegralFMTImpl( unsigned long long int, 'u', "%    *ll ", "%    *.*ll " )
    493488
    494 //*********************************** Floating Point ***********************************
     489//*********************************** floating point ***********************************
    495490
    496491#define PrintWithDP2( os, format, val, ... ) \
     
    541536                return os; \
    542537        } /* ?|? */ \
    543         void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); nl( os ); } \
     538        void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); ends( os ); } \
    544539} // distribution
    545540
     
    547542FloatingPointFMTImpl( long double, "%    *L ", "%    *.*L " )
    548543
    549 //*********************************** Character ***********************************
     544//*********************************** character ***********************************
    550545
    551546forall( dtype ostype | ostream( ostype ) ) {
     
    576571                return os;
    577572        } // ?|?
    578         void ?|?( ostype & os, _Ostream_Manip(char) f ) { (ostype &)(os | f); nl( os ); }
     573        void ?|?( ostype & os, _Ostream_Manip(char) f ) { (ostype &)(os | f); ends( os ); }
    579574} // distribution
    580575
    581 //*********************************** C String ***********************************
     576//*********************************** C string ***********************************
    582577
    583578forall( dtype ostype | ostream( ostype ) ) {
     
    621616                return os;
    622617        } // ?|?
    623         void ?|?( ostype & os, _Ostream_Manip(const char *) f ) { (ostype &)(os | f); nl( os ); }
     618        void ?|?( ostype & os, _Ostream_Manip(const char *) f ) { (ostype &)(os | f); ends( os ); }
    624619} // distribution
    625620
    626621
    627 //*********************************** Istream ***********************************
     622//*********************************** istream ***********************************
    628623
    629624
     
    771766} // distribution
    772767
    773 //*********************************** Manipulators ***********************************
     768//*********************************** manipulators ***********************************
    774769
    775770forall( dtype istype | istream( istype ) )
Note: See TracChangeset for help on using the changeset viewer.