Changeset 5cb2b8c


Ignore:
Timestamp:
May 16, 2019, 9:38:21 AM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
3c5dee4
Parents:
e0d19f8
Message:

update ofstream constructor

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    re0d19f8 r5cb2b8c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr 20 12:03:43 2019
    13 // Update Count     : 311
     12// Last Modified On : Thu May 16 08:33:28 2019
     13// Update Count     : 328
    1414//
    1515
     
    2727#define IO_MSG "I/O error: "
    2828
    29 void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool prt, const char * separator, const char * tupleSeparator ) {
     29void ?{}( ofstream & os, void * file ) {
    3030        os.file = file;
    31         os.sepDefault = sepDefault;
    32         os.sepOnOff = sepOnOff;
    33         os.nlOnOff = nlOnOff;
    34         os.prt = prt;
     31        os.sepDefault = true;
     32        os.sepOnOff = false;
     33        os.nlOnOff = true;
     34        os.prt = false;
    3535        os.sawNL = false;
    36         sepSet( os, separator );
     36        sepSet( os, " " );
    3737        sepSetCur( os, sepGet( os ) );
    38         sepSetTuple( os, tupleSeparator );
     38        sepSetTuple( os, ", " );
    3939}
    4040
     
    104104
    105105void open( ofstream & os, const char * name, const char * mode ) {
    106         FILE *file = fopen( name, mode );
     106        FILE * file = fopen( name, mode );
    107107        #ifdef __CFA_DEBUG__
    108108        if ( file == 0 ) {
     
    110110        } // if
    111111        #endif // __CFA_DEBUG__
    112         (os){ file, true, false, true, false, " ", ", " };
     112        (os){ file };
    113113} // open
    114114
     
    152152} // fmt
    153153
    154 static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), true, false, true, false, " ", ", " };
     154static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_) };
    155155ofstream & sout = soutFile;
    156 static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), true, false, true, false, " ", ", " };
     156static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_) };
    157157ofstream & serr = serrFile;
    158158
     159// static ofstream sexitFile = { (FILE *)(&_IO_2_1_stdout_) };
     160// ofstream & sexit = sexitFile;
     161// static ofstream sabortFile = { (FILE *)(&_IO_2_1_stderr_) };
     162// ofstream & sabort = sabortFile;
     163
     164void nl( ofstream & os ) {
     165        if ( getANL( os ) ) (ofstream &)(nl( os ));                     // implementation only
     166        else setPrt( os, false );                                                       // turn off
     167}
    159168
    160169//---------------------------------------
  • libcfa/src/fstream.hfa

    re0d19f8 r5cb2b8c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr 20 12:03:58 2019
    13 // Update Count     : 151
     12// Last Modified On : Thu May 16 08:34:10 2019
     13// Update Count     : 157
    1414//
    1515
     
    7070extern ofstream & sout, & serr;
    7171
     72// extern ofstream & sout, & serr, & sexit, & sabort;
     73// void nl( ofstream & os );
     74
    7275
    7376struct ifstream {
Note: See TracChangeset for help on using the changeset viewer.