Ignore:
Timestamp:
Dec 12, 2018, 9:16:12 AM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
5ebb1368
Parents:
3d99498
Message:

add auto newline to sout, change endl to nl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.hfa

    r3d99498 r200fcb3  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 11 08:22:49 2018
    13 // Update Count     : 156
     12// Last Modified On : Tue Dec 11 22:01:31 2018
     13// Update Count     : 213
    1414//
    1515
     
    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
     27        bool getNL( ostype & );                                                         // check newline
    2828        void setNL( ostype &, bool );                                           // saw newline
     29        bool getANL( ostype & );                                                        // check auto newline
     30        bool getNonl( ostype & );                                                       // check nonnl manipulator
     31        void setNonl( ostype &, bool );                                         // set nonnl manipulator
    2932        // public
    3033        void sepOn( ostype & );                                                         // turn separator state on
    3134        void sepOff( ostype & );                                                        // turn separator state off
    3235        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
     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
    3439
    3540        const char * sepGet( ostype & );                                        // get separator string
     
    5863forall( dtype ostype | ostream( ostype ) ) {
    5964        ostype & ?|?( ostype &, bool );
     65        void & ?|?( ostype &, bool );
    6066
    6167        ostype & ?|?( ostype &, char );
     68        void & ?|?( ostype &, char );
    6269        ostype & ?|?( ostype &, signed char );
     70        void & ?|?( ostype &, signed char );
    6371        ostype & ?|?( ostype &, unsigned char );
     72        void & ?|?( ostype &, unsigned char );
    6473
    6574        ostype & ?|?( ostype &, short int );
     75        void & ?|?( ostype &, short int );
    6676        ostype & ?|?( ostype &, unsigned short int );
     77        void & ?|?( ostype &, unsigned short int );
    6778        ostype & ?|?( ostype &, int );
     79        void & ?|?( ostype &, int );
    6880        ostype & ?|?( ostype &, unsigned int );
     81        void & ?|?( ostype &, unsigned int );
    6982        ostype & ?|?( ostype &, long int );
     83        void & ?|?( ostype &, long int );
    7084        ostype & ?|?( ostype &, long long int );
     85        void & ?|?( ostype &, long long int );
    7186        ostype & ?|?( ostype &, unsigned long int );
     87        void & ?|?( ostype &, unsigned long int );
    7288        ostype & ?|?( ostype &, unsigned long long int );
     89        void & ?|?( ostype &, unsigned long long int );
    7390
    7491        ostype & ?|?( ostype &, float ); // FIX ME: should not be required
     92        void & ?|?( ostype &, float ); // FIX ME: should not be required
    7593        ostype & ?|?( ostype &, double );
     94        void & ?|?( ostype &, double );
    7695        ostype & ?|?( ostype &, long double );
     96        void & ?|?( ostype &, long double );
    7797
    7898        ostype & ?|?( ostype &, float _Complex );
     99        void & ?|?( ostype &, float _Complex );
    79100        ostype & ?|?( ostype &, double _Complex );
     101        void & ?|?( ostype &, double _Complex );
    80102        ostype & ?|?( ostype &, long double _Complex );
     103        void & ?|?( ostype &, long double _Complex );
    81104
    82105        ostype & ?|?( ostype &, const char * );
     106        void & ?|?( ostype &, const char * );
    83107        // ostype & ?|?( ostype &, const char16_t * );
    84108#if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
     
    87111        // ostype & ?|?( ostype &, const wchar_t * );
    88112        ostype & ?|?( ostype &, const void * );
     113        void & ?|?( ostype &, const void * );
    89114
    90115        // manipulators
    91116        ostype & ?|?( ostype &, ostype & (*)( ostype & ) );
    92         ostype & endl( ostype & );
     117        void ?|?( ostype &, ostype & (*)( ostype & ) );
     118        ostype & nl( ostype & );
     119        ostype & nonl( ostype & );
    93120        ostype & sep( ostype & );
    94121        ostype & sepTuple( ostype & );
     
    97124        ostype & sepDisable( ostype & );
    98125        ostype & sepEnable( ostype & );
     126        ostype & nlOn( ostype & );
     127        ostype & nlOff( ostype & );
    99128} // distribution
    100129
    101130// tuples
    102 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } )
    103 ostype & ?|?( ostype & os, T arg, Params rest );
     131forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {
     132        ostype & ?|?( ostype & os, T arg, Params rest );
     133        void ?|?( ostype & os, T arg, Params rest );
     134} // distribution
    104135
    105136// writes the range [begin, end) to the given stream
    106 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
    107 void write( iterator_type begin, iterator_type end, ostype & os );
    108 
    109 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
    110 void write_reverse( iterator_type begin, iterator_type end, ostype & os );
     137forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) {
     138        void write( iterator_type begin, iterator_type end, ostype & os );
     139        void write_reverse( iterator_type begin, iterator_type end, ostype & os );
     140} // distribution
    111141
    112142//---------------------------------------
     
    152182        // manipulators
    153183        istype & ?|?( istype &, istype & (*)( istype & ) );
    154         istype & endl( istype & is );
     184        istype & nl( istype & is );
    155185} // distribution
    156186
     
    164194
    165195
    166 #include <time_t.hfa>                                                                           // Duration (constructors) / Time (constructors)
    167 
    168 forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Duration dur );
    169 forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time );
    170 
     196#include <time_t.hfa>                                                                   // Duration (constructors) / Time (constructors)
     197
     198forall( dtype ostype | ostream( ostype ) ) {
     199        ostype & ?|?( ostype & os, Duration dur );
     200        void ?|?( ostype & os, Duration dur );
     201        ostype & ?|?( ostype & os, Time time );
     202        void ?|?( ostype & os, Time time );
     203} // distribution
    171204
    172205// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.