Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r5cb2b8c r0efb269  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 16 08:33:28 2019
    13 // Update Count     : 328
     12// Last Modified On : Sat Apr 20 12:03:43 2019
     13// Update Count     : 311
    1414//
    1515
     
    2727#define IO_MSG "I/O error: "
    2828
    29 void ?{}( ofstream & os, void * file ) {
     29void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool prt, const char * separator, const char * tupleSeparator ) {
    3030        os.file = file;
    31         os.sepDefault = true;
    32         os.sepOnOff = false;
    33         os.nlOnOff = true;
    34         os.prt = false;
     31        os.sepDefault = sepDefault;
     32        os.sepOnOff = sepOnOff;
     33        os.nlOnOff = nlOnOff;
     34        os.prt = prt;
    3535        os.sawNL = false;
    36         sepSet( os, " " );
     36        sepSet( os, separator );
    3737        sepSetCur( os, sepGet( os ) );
    38         sepSetTuple( os, ", " );
     38        sepSetTuple( os, tupleSeparator );
    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 };
     112        (os){ file, true, false, true, false, " ", ", " };
    113113} // open
    114114
     
    152152} // fmt
    153153
    154 static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_) };
     154static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), true, false, true, false, " ", ", " };
    155155ofstream & sout = soutFile;
    156 static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_) };
     156static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), true, false, true, false, " ", ", " };
    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 
    164 void nl( ofstream & os ) {
    165         if ( getANL( os ) ) (ofstream &)(nl( os ));                     // implementation only
    166         else setPrt( os, false );                                                       // turn off
    167 }
    168159
    169160//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.