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/fstream.cfa

    r3d99498 r200fcb3  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 10 18:19:40 2018
    13 // Update Count     : 284
     12// Last Modified On : Wed Dec 12 08:34:28 2018
     13// Update Count     : 298
    1414//
    1515
     
    2020#include <stdarg.h>                                                                             // varargs
    2121#include <string.h>                                                                             // strlen
    22 #include <stdbool.h>                                                                    // true/false
    2322#include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    2423#include <complex.h>                                                                    // creal, cimag
     
    2726#define IO_MSG "I/O error: "
    2827
    29 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, const char * separator, const char * tupleSeparator ) {
     28void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool nonlManip, const char * separator, const char * tupleSeparator ) {
    3029        os.file = file;
    3130        os.sepDefault = sepDefault;
    3231        os.sepOnOff = sepOnOff;
     32        os.nlOnOff = nlOnOff;
     33        os.nonlManip = nonlManip;
    3334        sepSet( os, separator );
    3435        sepSetCur( os, sepGet( os ) );
     
    4445bool getNL( ofstream & os ) { return os.sawNL; }
    4546void setNL( ofstream & os, bool state ) { os.sawNL = state; }
     47bool getANL( ofstream & os ) { return os.nlOnOff; }
     48bool getNonl( ofstream & os ) { return os.nonlManip; }
     49void setNonl( ofstream & os, bool state ) { os.nonlManip = state; }
    4650
    4751// public
     
    7276} // sepEnable
    7377
     78void nlOn( ofstream & os ) { os.nlOnOff = true; }
     79void nlOff( ofstream & os ) { os.nlOnOff = false; }
     80
    7481const char * sepGet( ofstream & os ) { return os.separator; }
    7582void sepSet( ofstream & os, const char * s ) {
     
    103110        } // if
    104111        #endif // __CFA_DEBUG__
    105         (os){ file, true, false, " ", ", " };
     112        (os){ file, true, false, true, false, " ", ", " };
    106113} // open
    107114
     
    147154} // fmt
    148155
    149 static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), true, false, " ", ", " };
     156static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), true, false, true, false, " ", ", " };
    150157ofstream & sout = soutFile;
    151 static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), true, false, " ", ", " };
     158static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), true, false, true, false, " ", ", " };
    152159ofstream & serr = serrFile;
    153160
Note: See TracChangeset for help on using the changeset viewer.