Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r65240bb r5cb2b8c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 12 12:03:53 2019
    13 // Update Count     : 344
     12// Last Modified On : Thu May 16 08:33:28 2019
     13// Update Count     : 328
    1414//
    1515
     
    2424#include <assert.h>
    2525#include <errno.h>                                                                              // errno
    26 
    27 
    28 //*********************************** ofstream ***********************************
    29 
    3026
    3127#define IO_MSG "I/O error: "
     
    4137        sepSetCur( os, sepGet( os ) );
    4238        sepSetTuple( os, ", " );
    43 } // ?{}
     39}
    4440
    4541// private
     
    6056void ?{}( ofstream & os, const char * name, const char * mode ) {
    6157        open( os, name, mode );
    62 } // ?{}
    63 
     58}
    6459void ?{}( ofstream & os, const char * name ) {
    6560        open( os, name, "w" );
    66 } // ?{}
     61}
    6762
    6863void sepOn( ofstream & os ) { os.sepOnOff = ! getNL( os ); }
     
    9994        os.tupleSeparator[sepSize - 1] = '\0';
    10095} // sepSet
    101 
    102 void ends( ofstream & os ) {
    103         if ( getANL( os ) ) nl( os );
    104         else setPrt( os, false );                                                       // turn off
    105         if ( &os == &exit ) exit( EXIT_FAILURE );
    106         if ( &os == &abort ) abort();
    107 } // ends
    10896
    10997int fail( ofstream & os ) {
     
    169157ofstream & serr = serrFile;
    170158
    171 static ofstream exitFile = { (FILE *)(&_IO_2_1_stdout_) };
    172 ofstream & exit = exitFile;
    173 static ofstream abortFile = { (FILE *)(&_IO_2_1_stderr_) };
    174 ofstream & abort = abortFile;
    175 
    176 
    177 //*********************************** ifstream ***********************************
    178 
     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}
     168
     169//---------------------------------------
    179170
    180171// private
     
    182173        is.file = file;
    183174        is.nlOnOff = false;
    184 } // ?{}
     175}
    185176
    186177// public
     
    189180void ?{}( ifstream & is, const char * name, const char * mode ) {
    190181        open( is, name, mode );
    191 } // ?{}
    192 
     182}
    193183void ?{}( ifstream & is, const char * name ) {
    194184        open( is, name, "r" );
    195 } // ?{}
     185}
    196186
    197187void nlOn( ifstream & os ) { os.nlOnOff = true; }
Note: See TracChangeset for help on using the changeset viewer.