Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    rf5d9c37 rfb907d3  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 29 10:12:39 2023
    13 // Update Count     : 1380
     12// Last Modified On : Mon Jan  9 09:27:58 2023
     13// Update Count     : 1361
    1414//
    1515
     
    5050                fmt( os, "%c", c );
    5151                if ( c == '\n' ) setNL$( os, true );
    52                 return nosep( os );
     52                return sepOff( os );
    5353        } // ?|?
    5454        void ?|?( ostype & os, char c ) {
     
    284284
    285285          if ( s == 0p ) { fmt( os, "%s", "0p" ); return os; } // null pointer
    286           if ( s[0] == '\0' ) { nosep( os ); return os; }       // null string => no leading/trailing separator
     286          if ( s[0] == '\0' ) { sepOff( os ); return os; } // null string => no separator
    287287
    288288                // first character IS NOT spacing or closing punctuation => add left separator
     
    300300                fmt( os, "%s", s );                                                             // fmt resets seperator, but reset it again
    301301                if ( sepPrt$( os ) && mask[ ch ] != Open && mask[ ch ] != OpenClose ) {
    302                         sep( os );
     302                        sepOn( os );
    303303                } else {
    304                         nosep( os );
     304                        sepOff( os );
    305305                } // if
    306306                if ( ch == '\n' ) setNL$( os, true );                   // check *AFTER* sepPrt$ call above as it resets NL flag
     
    351351        } // ?|?
    352352
     353        ostype & sep( ostype & os ) {
     354                return (ostype &)(os | sepGet( os ));
     355        } // sep
     356
     357        ostype & sepTuple( ostype & os ) {
     358                return os | sepGetTuple( os );
     359        } // sepTuple
     360
    353361        ostype & nl( ostype & os ) {
    354362                (ostype &)(os | '\n');
    355363                setPrt$( os, false );                                                   // turn off
    356364                setNL$( os, true );
    357                 return nosep( os );                                                             // prepare for next line
     365                return sepOff( os );                                                    // prepare for next line
    358366        } // nl
    359367
     
    363371        } // nonl
    364372
     373        ostype & sepOn( ostype & os ) {
     374                sepOn( os );                                                                    // call void returning
     375                return os;
     376        } // sepOn
     377
     378        ostype & sepOff( ostype & os ) {
     379                sepOff( os );                                                                   // call void returning
     380                return os;
     381        } // sepOff
     382
     383        ostype & sepEnable( ostype & os ) {
     384                sepEnable( os );                                                                // call void returning
     385                return os;
     386        } // sepEnable
     387
     388        ostype & sepDisable( ostype & os ) {
     389                sepDisable( os );                                                               // call void returning
     390                return os;
     391        } // sepDisable
     392
    365393        ostype & nlOn( ostype & os ) {
    366394                nlOn( os );                                                                             // call void returning
     
    372400                return os;
    373401        } // nlOff
    374 
    375         ostype & sepVal( ostype & os ) {
    376                 return (ostype &)(os | sepGet( os ));
    377         } // sepVal
    378 
    379         ostype & sepTupleVal( ostype & os ) {
    380                 return os | sepGetTuple( os );
    381         } // sepTupleVal
    382 
    383         ostype & sep( ostype & os ) {
    384                 sep( os );                                                                              // call void returning
    385                 return os;
    386         } // sep
    387 
    388         ostype & nosep( ostype & os ) {
    389                 nosep( os );                                                                    // call void returning
    390                 return os;
    391         } // nosep
    392 
    393         ostype & sepOn( ostype & os ) {
    394                 sepOn( os );                                                                    // call void returning
    395                 return os;
    396         } // sepOn
    397 
    398         ostype & sepOff( ostype & os ) {
    399                 sepOff( os );                                                                   // call void returning
    400                 return os;
    401         } // sepOff
    402402} // distribution
    403403
     
    550550                if ( cnt == 1 ) {
    551551                        if ( f.flags.left ) { wd -= maxdig; f.wd = wd < 0 ? 1 : wd; } // update and restore f.wd for printing end chunk
    552                         nosep( os );                                                            // no seperator between chunks
     552                        sepOff( os );                                                           // no seperator between chunks
    553553                } // if
    554554        } else {                                                                                        // print start chunk
     
    595595                else { f.pc = maxdig; f.flags.pc = true; }              // left pad with precision
    596596
    597                 if ( cnt != 0 ) nosep( os );                                    // no seperator between chunks
     597                if ( cnt != 0 ) sepOff( os );                                   // no seperator between chunks
    598598                f.wd = wd;                                                                              // reset f.wd for next chunk
    599599                f.flags.sign = false;                                                   // no leading +/- sign
     
    773773                } // if
    774774
    775                 if ( f.val[0] != '\0' &&                                                // null string => no leading separator
    776                          sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
     775                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    777776
    778777                #define SFMTNP "% * "
     
    796795                        fmt( os, &fmtstr[star], f.wd, f.pc, f.val );
    797796                } // if
    798                 if ( f.val[0] == '\0' ) { nosep( os ); }                // null string => no trailing separator
    799797                return os;
    800798        } // ?|?
Note: See TracChangeset for help on using the changeset viewer.