Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.hfa

    r9d362a0 r58b6d1b  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 24 18:33:40 2018
    13 // Update Count     : 220
     12// Last Modified On : Sun Jul  1 12:12:22 2018
     13// Update Count     : 155
    1414//
    1515
     
    2020trait ostream( dtype ostype ) {
    2121        // private
    22         bool sepPrt( ostype & );                                                        // get separator state (on/off)
     22        _Bool sepPrt( ostype & );                                                       // return separator state (on/off)
    2323        void sepReset( ostype & );                                                      // set separator state to default state
    24         void sepReset( ostype &, bool );                                        // set separator and default state
     24        void sepReset( ostype &, _Bool );                                       // set separator and default state
    2525        const char * sepGetCur( ostype & );                                     // get current separator string
    2626        void sepSetCur( ostype &, const char * );                       // set current separator string
    27         bool getNL( ostype & );                                                         // check newline
    28         void setNL( ostype &, bool );                                           // saw newline
    29         bool getANL( ostype & );                                                        // get auto newline (on/off)
    30         bool getPrt( ostype & );                                                        // get fmt called in output cascade
    31         void setPrt( ostype &, bool );                                          // set fmt called in output cascade
     27        _Bool getNL( ostype & );                                                        // check newline
     28        void setNL( ostype &, _Bool );                                          // saw newline
    3229        // public
    3330        void sepOn( ostype & );                                                         // turn separator state on
    3431        void sepOff( ostype & );                                                        // turn separator state off
    35         bool sepDisable( ostype & );                                            // set default state to off, and return previous state
    36         bool sepEnable( ostype & );                                                     // set default state to on, and return previous state
    37         void nlOn( ostype & );                                                          // turn auto-newline state on
    38         void nlOff( ostype & );                                                         // turn auto-newline state off
     32        _Bool sepDisable( ostype & );                                           // set default state to off, and return previous state
     33        _Bool sepEnable( ostype & );                                            // set default state to on, and return previous state
    3934
    4035        const char * sepGet( ostype & );                                        // get separator string
     
    4843        void close( ostype & os );
    4944        ostype & write( ostype &, const char *, size_t );
    50         int fmt( ostype &, const char format[], ... );
     45        int fmt( ostype &, const char fmt[], ... );
    5146}; // ostream
    5247
     
    6257
    6358forall( dtype ostype | ostream( ostype ) ) {
    64         ostype & ?|?( ostype &, bool );
    65         void ?|?( ostype &, bool );
     59        ostype & ?|?( ostype &, _Bool );
    6660
    6761        ostype & ?|?( ostype &, char );
    68         void ?|?( ostype &, char );
    6962        ostype & ?|?( ostype &, signed char );
    70         void ?|?( ostype &, signed char );
    7163        ostype & ?|?( ostype &, unsigned char );
    72         void ?|?( ostype &, unsigned char );
    7364
    7465        ostype & ?|?( ostype &, short int );
    75         void ?|?( ostype &, short int );
    7666        ostype & ?|?( ostype &, unsigned short int );
    77         void ?|?( ostype &, unsigned short int );
    7867        ostype & ?|?( ostype &, int );
    79         void ?|?( ostype &, int );
    8068        ostype & ?|?( ostype &, unsigned int );
    81         void ?|?( ostype &, unsigned int );
    8269        ostype & ?|?( ostype &, long int );
    83         void ?|?( ostype &, long int );
    8470        ostype & ?|?( ostype &, long long int );
    85         void ?|?( ostype &, long long int );
    8671        ostype & ?|?( ostype &, unsigned long int );
    87         void ?|?( ostype &, unsigned long int );
    8872        ostype & ?|?( ostype &, unsigned long long int );
    89         void ?|?( ostype &, unsigned long long int );
    9073
    9174        ostype & ?|?( ostype &, float ); // FIX ME: should not be required
    92         void ?|?( ostype &, float ); // FIX ME: should not be required
    9375        ostype & ?|?( ostype &, double );
    94         void ?|?( ostype &, double );
    9576        ostype & ?|?( ostype &, long double );
    96         void ?|?( ostype &, long double );
    9777
    9878        ostype & ?|?( ostype &, float _Complex );
    99         void ?|?( ostype &, float _Complex );
    10079        ostype & ?|?( ostype &, double _Complex );
    101         void ?|?( ostype &, double _Complex );
    10280        ostype & ?|?( ostype &, long double _Complex );
    103         void ?|?( ostype &, long double _Complex );
    10481
    10582        ostype & ?|?( ostype &, const char * );
    106         void ?|?( ostype &, const char * );
    10783        // ostype & ?|?( ostype &, const char16_t * );
    10884#if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
     
    11187        // ostype & ?|?( ostype &, const wchar_t * );
    11288        ostype & ?|?( ostype &, const void * );
    113         void ?|?( ostype &, const void * );
    11489
    11590        // manipulators
    11691        ostype & ?|?( ostype &, ostype & (*)( ostype & ) );
    117         void ?|?( ostype &, ostype & (*)( ostype & ) );
    118         ostype & nl( ostype & );
    119         void nl( ostype & );
    120         ostype & nonl( ostype & );
     92        ostype & endl( ostype & );
    12193        ostype & sep( ostype & );
    12294        ostype & sepTuple( ostype & );
     
    12597        ostype & sepDisable( ostype & );
    12698        ostype & sepEnable( ostype & );
    127         ostype & nlOn( ostype & );
    128         ostype & nlOff( ostype & );
    12999} // distribution
    130100
    131101// tuples
    132 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
    133         ostype & ?|?( ostype & os, T arg, Params rest );
    134         void ?|?( ostype & os, T arg, Params rest );
    135 } // distribution
     102forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } )
     103ostype & ?|?( ostype & os, T arg, Params rest );
    136104
    137105// writes the range [begin, end) to the given stream
    138 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) {
    139         void write( iterator_type begin, iterator_type end, ostype & os );
    140         void write_reverse( iterator_type begin, iterator_type end, ostype & os );
    141 } // distribution
     106forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
     107void write( iterator_type begin, iterator_type end, ostype & os );
     108
     109forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
     110void write_reverse( iterator_type begin, iterator_type end, ostype & os );
    142111
    143112//---------------------------------------
     
    150119        istype & read( istype &, char *, size_t );
    151120        istype & ungetc( istype &, char );
    152         int fmt( istype &, const char format[], ... );
     121        int fmt( istype &, const char fmt[], ... );
    153122}; // istream
    154123
     
    158127
    159128forall( dtype istype | istream( istype ) ) {
    160         istype & ?|?( istype &, bool & );
     129        istype & ?|?( istype &, _Bool & );
    161130
    162131        istype & ?|?( istype &, char & );
     
    183152        // manipulators
    184153        istype & ?|?( istype &, istype & (*)( istype & ) );
    185         istype & nl( istype & is );
     154        istype & endl( istype & is );
    186155} // distribution
    187156
     
    195164
    196165
    197 #include <time_t.hfa>                                                                   // Duration (constructors) / Time (constructors)
     166#include <time_t.hfa>                                                                           // Duration (constructors) / Time (constructors)
    198167
    199 forall( dtype ostype | ostream( ostype ) ) {
    200         ostype & ?|?( ostype & os, Duration dur );
    201         void ?|?( ostype & os, Duration dur );
    202         ostype & ?|?( ostype & os, Time time );
    203         void ?|?( ostype & os, Time time );
    204 } // distribution
     168forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Duration dur );
     169forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time );
     170
    205171
    206172// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.