source: libcfa/src/fstream.hfa@ c2cec21d

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr no_list persistent-indexer pthread-emulation qualifiedEnum
Last change on this file since c2cec21d was 0e0f128c, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

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

  • Property mode set to 100644
File size: 2.2 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
[93c2e0a]12// Last Modified On : Sat Aug 11 13:54:27 2018
13// Update Count : 132
[86bd7c1f]14//
15
[53a6c2a]16#pragma once
[51b73452]17
[58b6d1b]18#include "iostream.hfa"
[51b73452]19
[53a6c2a]20enum { sepSize = 16 };
[53ba273]21struct ofstream {
[829c907]22 void * file;
[93c2e0a]23 bool sepDefault;
24 bool sepOnOff;
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
[93c2e0a]32bool sepPrt( ofstream & );
[09687aa]33void sepReset( ofstream & );
[93c2e0a]34void sepReset( ofstream &, bool );
[09687aa]35const char * sepGetCur( ofstream & );
36void sepSetCur( ofstream &, const char * );
[93c2e0a]37bool getNL( ofstream & );
38void setNL( ofstream &, bool );
[9ebd778]39
40// public
[09687aa]41void sepOn( ofstream & );
42void sepOff( ofstream & );
[93c2e0a]43bool sepDisable( ofstream & );
44bool 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 );
[8da74119]54void open( ofstream &, const char * name );
[09687aa]55void close( ofstream & );
[91d766d]56ofstream & write( ofstream &, const char * data, size_t size );
[09687aa]57int fmt( ofstream &, const char fmt[], ... );
[829c907]58
[09687aa]59void ?{}( ofstream & os );
60void ?{}( ofstream & os, const char * name, const char * mode );
[8da74119]61void ?{}( ofstream & os, const char * name );
[09687aa]62
63extern ofstream & sout, & serr;
[51b73452]64
65
[53ba273]66struct ifstream {
[829c907]67 void * file;
[53ba273]68}; // ifstream
[6ba0659]69
[09687aa]70// public
71int fail( ifstream & is );
72int eof( ifstream & is );
[8da74119]73void open( ifstream & is, const char * name, const char * mode );
[09687aa]74void open( ifstream & is, const char * name );
75void close( ifstream & is );
[91d766d]76ifstream & read( ifstream & is, char * data, size_t size );
[09687aa]77ifstream & ungetc( ifstream & is, char c );
78int fmt( ifstream &, const char fmt[], ... );
79
80void ?{}( ifstream & is );
[8da74119]81void ?{}( ifstream & is, const char * name, const char * mode );
[09687aa]82void ?{}( ifstream & is, const char * name );
[51b73452]83
[09687aa]84extern ifstream & sin;
[51b73452]85
[86bd7c1f]86// Local Variables: //
[d3b7937]87// mode: c //
[86bd7c1f]88// tab-width: 4 //
89// End: //
Note: See TracBrowser for help on using the repository browser.