Ignore:
Timestamp:
Jun 29, 2023, 12:07:50 PM (14 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
7d25f44
Parents:
70e47fec
Message:

harmonize separator manipulators names with newline names: change from sep, sepTuple, sepEnable, sepDisable, sepOn, sepOff to sepVal, sepTupleVal, sepOn, sepOff, sep, nosep; fix bug printing null string with WD so no separator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r70e47fec rf5d9c37  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 17 08:51:12 2023
    13 // Update Count     : 528
     12// Last Modified On : Thu Jun 29 11:09:52 2023
     13// Update Count     : 533
    1414//
    1515
     
    4343} // ?{}
    4444
     45inline bool getNL$( ofstream & os ) { return os.sawNL$; }
     46inline void setNL$( ofstream & os, bool state ) { os.sawNL$ = state; }
     47inline bool getANL$( ofstream & os ) { return os.nlOnOff$; }
     48
    4549inline bool sepPrt$( ofstream & os ) { setNL$( os, false ); return os.sepOnOff$; }
    4650inline void sepReset$( ofstream & os ) { os.sepOnOff$ = os.sepDefault$; }
     
    4852inline const char * sepGetCur$( ofstream & os ) { return os.sepCur$; }
    4953inline void sepSetCur$( ofstream & os, const char sepCur[] ) { os.sepCur$ = sepCur; }
    50 inline bool getNL$( ofstream & os ) { return os.sawNL$; }
    51 inline void setNL$( ofstream & os, bool state ) { os.sawNL$ = state; }
    52 inline bool getANL$( ofstream & os ) { return os.nlOnOff$; }
     54
    5355inline bool getPrt$( ofstream & os ) { return os.prt$; }
    5456inline void setPrt$( ofstream & os, bool state ) { os.prt$ = state; }
     
    6365void ^?{}( ofstream & os ) { close( os ); }
    6466
    65 void sepOn( ofstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
    66 void sepOff( ofstream & os ) { os.sepOnOff$ = false; }
    67 
    68 bool sepDisable( ofstream & os ) {
     67void nlOn( ofstream & os ) { os.nlOnOff$ = true; }
     68void nlOff( ofstream & os ) { os.nlOnOff$ = false; }
     69
     70void sep( ofstream & os ) { os.sepOnOff$ = ! getNL$( os ); }
     71void nosep( ofstream & os ) { os.sepOnOff$ = false; }
     72
     73bool sepOn( ofstream & os ) {
     74        bool temp = os.sepDefault$;
     75        os.sepDefault$ = true;
     76        if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
     77        return temp;
     78} // sepOn
     79
     80bool sepOff( ofstream & os ) {
    6981        bool temp = os.sepDefault$;
    7082        os.sepDefault$ = false;
    7183        sepReset$( os );
    7284        return temp;
    73 } // sepDisable
    74 
    75 bool sepEnable( ofstream & os ) {
    76         bool temp = os.sepDefault$;
    77         os.sepDefault$ = true;
    78         if ( os.sepOnOff$ ) sepReset$( os );                            // start of line ?
    79         return temp;
    80 } // sepEnable
    81 
    82 void nlOn( ofstream & os ) { os.nlOnOff$ = true; }
    83 void nlOff( ofstream & os ) { os.nlOnOff$ = false; }
     85} // sepOff
    8486
    8587const char * sepGet( ofstream & os ) { return os.separator$; }
Note: See TracChangeset for help on using the changeset viewer.