source: src/libcfa/fstream @ b1672e1

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since b1672e1 was 91d766d, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

use size_t

  • Property mode set to 100644
File size: 2.2 KB
Line 
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//
7// fstream --
8//
9// Author           : Peter A. Buhr
10// Created On       : Wed May 27 17:56:53 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Tue Jun  5 10:20:25 2018
13// Update Count     : 131
14//
15
16#pragma once
17
18#include "iostream"
19
20enum { sepSize = 16 };
21struct ofstream {
22        void * file;
23        _Bool sepDefault;
24        _Bool sepOnOff;
25        _Bool sawNL;
26        const char * sepCur;
27        char separator[sepSize];
28        char tupleSeparator[sepSize];
29}; // ofstream
30
31// private
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 );
39
40// public
41void sepOn( ofstream & );
42void sepOff( ofstream & );
43_Bool sepDisable( ofstream & );
44_Bool sepEnable( ofstream & );
45
46const char * sepGet( ofstream & );
47void sepSet( ofstream &, const char * );
48const char * sepGetTuple( ofstream & );
49void sepSetTuple( ofstream &, const char * );
50
51int fail( ofstream & );
52int flush( ofstream & );
53void open( ofstream &, const char * name, const char * mode );
54void open( ofstream &, const char * name );
55void close( ofstream & );
56ofstream & write( ofstream &, const char * data, size_t size );
57int fmt( ofstream &, const char fmt[], ... );
58
59void ?{}( ofstream & os );
60void ?{}( ofstream & os, const char * name, const char * mode );
61void ?{}( ofstream & os, const char * name );
62
63extern ofstream & sout, & serr;
64
65
66struct ifstream {
67        void * file;
68}; // ifstream
69
70// public
71int fail( ifstream & is );
72int eof( ifstream & is );
73void open( ifstream & is, const char * name, const char * mode );
74void open( ifstream & is, const char * name );
75void close( ifstream & is );
76ifstream & read( ifstream & is, char * data, size_t size );
77ifstream & ungetc( ifstream & is, char c );
78int fmt( ifstream &, const char fmt[], ... );
79
80void ?{}( ifstream & is );
81void ?{}( ifstream & is, const char * name, const char * mode );
82void ?{}( ifstream & is, const char * name );
83
84extern ifstream & sin;
85
86// Local Variables: //
87// mode: c //
88// tab-width: 4 //
89// End: //
Note: See TracBrowser for help on using the repository browser.