Changeset f451177


Ignore:
Timestamp:
Apr 27, 2021, 10:10:38 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
666483d
Parents:
ef3ac46
Message:

remember basic_ostream nl and then override it using the basic_ostream version

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    ref3ac46 rf451177  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr 24 09:05:16 2021
    13 // Update Count     : 426
    14 //
    15 
    16 #include "fstream.hfa"
     12// Last Modified On : Tue Apr 27 22:08:57 2021
     13// Update Count     : 442
     14//
     15
     16#include "fstream.hfa"                                                                  // also includes iostream.hfa
    1717
    1818#include <stdio.h>                                                                              // vfprintf, vfscanf
     
    196196ofstream & abort = abortFile;
    197197
     198ofstream & nl( ofstream & os ) {
     199        nl$( os );                                                                                      // call basic_ostream nl
     200        flush( os );
     201        return os;
     202        // (ofstream &)(os | '\n');
     203        // setPrt$( os, false );                                                        // turn off
     204        // setNL$( os, true );
     205        // flush( os );
     206        // return sepOff( os );                                                 // prepare for next line
     207} // nl
    198208
    199209// *********************************** ifstream ***********************************
  • libcfa/src/fstream.hfa

    ref3ac46 rf451177  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr 24 09:04:03 2021
    13 // Update Count     : 219
     12// Last Modified On : Tue Apr 27 22:00:30 2021
     13// Update Count     : 226
    1414//
    1515
     
    7171bool fail( ofstream & );
    7272int flush( ofstream & );
    73 void open( ofstream &, const char name[], const char mode[] );
     73void open( ofstream &, const char name[], const char mode[] ); // FIX ME: use default = "w"
    7474void open( ofstream &, const char name[] );
    7575void close( ofstream & );
     
    8686
    8787void ?{}( ofstream & );
    88 void ?{}( ofstream &, const char name[], const char mode[] );
     88void ?{}( ofstream &, const char name[], const char mode[] ); // FIX ME: use default = "w"
    8989void ?{}( ofstream &, const char name[] );
    9090void ^?{}( ofstream & );
     91
     92// private
     93static inline ofstream & nl$( ofstream & os ) { return nl( os ); } // remember basic_ostream nl
     94// public
     95ofstream & nl( ofstream & os );                                                 // override basic_ostream nl
    9196
    9297extern ofstream & sout, & stdout, & serr, & stderr;             // aliases
     
    111116bool getANL( ifstream & );
    112117void ends( ifstream & );
     118int fmt( ifstream &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) ));
     119
    113120bool fail( ifstream & is );
    114121int eof( ifstream & is );
    115 void open( ifstream & is, const char name[], const char mode[] );
     122void open( ifstream & is, const char name[], const char mode[] ); // FIX ME: use default = "r"
    116123void open( ifstream & is, const char name[] );
    117124void close( ifstream & is );
    118125ifstream & read( ifstream & is, char * data, size_t size );
    119126ifstream & ungetc( ifstream & is, char c );
    120 int fmt( ifstream &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) ));
     127
    121128void acquire( ifstream & is );
    122129void release( ifstream & is );
     
    129136
    130137void ?{}( ifstream & is );
    131 void ?{}( ifstream & is, const char name[], const char mode[] );
     138void ?{}( ifstream & is, const char name[], const char mode[] ); // FIX ME: use default = "r"
    132139void ?{}( ifstream & is, const char name[] );
    133140void ^?{}( ifstream & is );
Note: See TracChangeset for help on using the changeset viewer.