Ignore:
Timestamp:
Oct 29, 2019, 4:01:24 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
773db65, 9421f3d8
Parents:
7951100 (diff), 8364209 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 moved

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.hfa

    r7951100 rb067d9b  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun  5 10:20:25 2018
    13 // Update Count     : 131
     12// Last Modified On : Mon Jul 15 18:10:23 2019
     13// Update Count     : 167
    1414//
    1515
    1616#pragma once
    1717
    18 #include "iostream"
     18#include "iostream.hfa"
     19
     20
     21//*********************************** ofstream ***********************************
     22
    1923
    2024enum { sepSize = 16 };
    2125struct ofstream {
    2226        void * file;
    23         _Bool sepDefault;
    24         _Bool sepOnOff;
    25         _Bool sawNL;
     27        bool sepDefault;
     28        bool sepOnOff;
     29        bool nlOnOff;
     30        bool prt;                                                                                       // print text
     31        bool sawNL;
    2632        const char * sepCur;
    2733        char separator[sepSize];
     
    3036
    3137// private
    32 _Bool sepPrt( ofstream & );
     38bool sepPrt( ofstream & );
    3339void sepReset( ofstream & );
    34 void sepReset( ofstream &, _Bool );
     40void sepReset( ofstream &, bool );
    3541const char * sepGetCur( ofstream & );
    3642void sepSetCur( ofstream &, const char * );
    37 _Bool getNL( ofstream & );
    38 void setNL( ofstream &, _Bool );
     43bool getNL( ofstream & );
     44void setNL( ofstream &, bool );
     45bool getANL( ofstream & );
     46bool getPrt( ofstream & );
     47void setPrt( ofstream &, bool );
    3948
    4049// public
    4150void sepOn( ofstream & );
    4251void sepOff( ofstream & );
    43 _Bool sepDisable( ofstream & );
    44 _Bool sepEnable( ofstream & );
     52bool sepDisable( ofstream & );
     53bool sepEnable( ofstream & );
     54void nlOn( ofstream & );
     55void nlOff( ofstream & );
    4556
    4657const char * sepGet( ofstream & );
     
    4960void sepSetTuple( ofstream &, const char * );
    5061
     62void ends( ofstream & os );
    5163int fail( ofstream & );
    5264int flush( ofstream & );
     
    5567void close( ofstream & );
    5668ofstream & write( ofstream &, const char * data, size_t size );
    57 int fmt( ofstream &, const char fmt[], ... );
     69int fmt( ofstream &, const char format[], ... );
    5870
    5971void ?{}( ofstream & os );
     
    6173void ?{}( ofstream & os, const char * name );
    6274
    63 extern ofstream & sout, & serr;
     75extern ofstream & sout, & stdout, & serr, & stderr;             // aliases
     76extern ofstream & exit, & abort;
     77
     78
     79//*********************************** ifstream ***********************************
    6480
    6581
    6682struct ifstream {
    6783        void * file;
     84        bool nlOnOff;
    6885}; // ifstream
    6986
    7087// public
     88void nlOn( ifstream & );
     89void nlOff( ifstream & );
     90bool getANL( ifstream & );
    7191int fail( ifstream & is );
    7292int eof( ifstream & is );
     
    7696ifstream & read( ifstream & is, char * data, size_t size );
    7797ifstream & ungetc( ifstream & is, char c );
    78 int fmt( ifstream &, const char fmt[], ... );
     98int fmt( ifstream &, const char format[], ... );
    7999
    80100void ?{}( ifstream & is );
     
    82102void ?{}( ifstream & is, const char * name );
    83103
    84 extern ifstream & sin;
     104extern ifstream & sin, & stdin;                                                 // aliases
    85105
    86106// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.