source: src/libcfa/fstream @ 5e1adb5

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 5e1adb5 was 09687aa, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

complete conversion of iostream/fstream to use references

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[86bd7c1f]1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
[bb82c03]7// fstream --
[86bd7c1f]8//
[90c3b1c]9// Author           : Peter A. Buhr
[86bd7c1f]10// Created On       : Wed May 27 17:56:53 2015
11// Last Modified By : Peter A. Buhr
[09687aa]12// Last Modified On : Thu Dec  7 08:06:11 2017
13// Update Count     : 129
[86bd7c1f]14//
15
[53a6c2a]16#pragma once
[51b7345]17
[d3b7937]18#include "iostream"
[51b7345]19
[53a6c2a]20enum { sepSize = 16 };
[53ba273]21struct ofstream {
[829c907]22        void * file;
[8bc4ef8]23        _Bool sepDefault;
[6152c81]24        _Bool sepOnOff;
[53a6c2a]25        _Bool sawNL;
[829c907]26        const char * sepCur;
[53a6c2a]27        char separator[sepSize];
28        char tupleSeparator[sepSize];
[53ba273]29}; // ofstream
[90c3b1c]30
[9ebd778]31// private
[09687aa]32_Bool sepPrt( ofstream & );
33void sepReset( ofstream & );
34void sepReset( ofstream &, _Bool );
35const char * sepGetCur( ofstream & );
36void sepSetCur( ofstream &, const char * );
37_Bool getNL( ofstream & );
38void setNL( ofstream &, _Bool );
[9ebd778]39
40// public
[09687aa]41void sepOn( ofstream & );
42void sepOff( ofstream & );
43_Bool sepDisable( ofstream & );
44_Bool sepEnable( ofstream & );
[9ebd778]45
[09687aa]46const char * sepGet( ofstream & );
47void sepSet( ofstream &, const char * );
48const char * sepGetTuple( ofstream & );
49void sepSetTuple( ofstream &, const char * );
[6152c81]50
[09687aa]51int fail( ofstream & );
52int flush( ofstream & );
53void open( ofstream &, const char * name, const char * mode );
54void close( ofstream & );
55ofstream & write( ofstream &, const char * data, unsigned long int size );
56int fmt( ofstream &, const char fmt[], ... );
[829c907]57
[09687aa]58void ?{}( ofstream & os );
59void ?{}( ofstream & os, const char * name, const char * mode );
60
61extern ofstream & sout, & serr;
[51b7345]62
63
[53ba273]64struct ifstream {
[829c907]65        void * file;
[53ba273]66}; // ifstream
[6ba0659]67
[09687aa]68// public
69int fail( ifstream & is );
70int eof( ifstream & is );
71void open( ifstream & is, const char * name );
72void close( ifstream & is );
73ifstream & read( ifstream & is, char * data, unsigned long int size );
74ifstream & ungetc( ifstream & is, char c );
75int fmt( ifstream &, const char fmt[], ... );
76
77void ?{}( ifstream & is );
78void ?{}( ifstream & is, const char * name );
[51b7345]79
[09687aa]80extern ifstream & sin;
[51b7345]81
[86bd7c1f]82// Local Variables: //
[d3b7937]83// mode: c //
[86bd7c1f]84// tab-width: 4 //
85// End: //
Note: See TracBrowser for help on using the repository browser.