source: libcfa/src/fstream.hfa@ 05c34c3

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 05c34c3 was 5cb2b8c, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

update ofstream constructor

  • Property mode set to 100644
File size: 2.6 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
[5cb2b8c]12// Last Modified On : Thu May 16 08:34:10 2019
13// Update Count : 157
[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;
[200fcb3]25 bool nlOnOff;
[5ea5b28]26 bool prt; // print text
[93c2e0a]27 bool sawNL;
[829c907]28 const char * sepCur;
[53a6c2a]29 char separator[sepSize];
30 char tupleSeparator[sepSize];
[53ba273]31}; // ofstream
[90c3b1c]32
[9ebd778]33// private
[93c2e0a]34bool sepPrt( ofstream & );
[09687aa]35void sepReset( ofstream & );
[93c2e0a]36void sepReset( ofstream &, bool );
[09687aa]37const char * sepGetCur( ofstream & );
38void sepSetCur( ofstream &, const char * );
[93c2e0a]39bool getNL( ofstream & );
40void setNL( ofstream &, bool );
[200fcb3]41bool getANL( ofstream & );
[5ea5b28]42bool getPrt( ofstream & );
43void setPrt( ofstream &, bool );
[9ebd778]44
45// public
[09687aa]46void sepOn( ofstream & );
47void sepOff( ofstream & );
[93c2e0a]48bool sepDisable( ofstream & );
49bool sepEnable( ofstream & );
[200fcb3]50void nlOn( ofstream & );
51void nlOff( ofstream & );
[9ebd778]52
[09687aa]53const char * sepGet( ofstream & );
54void sepSet( ofstream &, const char * );
55const char * sepGetTuple( ofstream & );
56void sepSetTuple( ofstream &, const char * );
[6152c81]57
[09687aa]58int fail( ofstream & );
59int flush( ofstream & );
60void open( ofstream &, const char * name, const char * mode );
[8da74119]61void open( ofstream &, const char * name );
[09687aa]62void close( ofstream & );
[91d766d]63ofstream & write( ofstream &, const char * data, size_t size );
[9d362a0]64int fmt( ofstream &, const char format[], ... );
[829c907]65
[09687aa]66void ?{}( ofstream & os );
67void ?{}( ofstream & os, const char * name, const char * mode );
[8da74119]68void ?{}( ofstream & os, const char * name );
[09687aa]69
70extern ofstream & sout, & serr;
[51b73452]71
[5cb2b8c]72// extern ofstream & sout, & serr, & sexit, & sabort;
73// void nl( ofstream & os );
74
[51b73452]75
[53ba273]76struct ifstream {
[829c907]77 void * file;
[0efb269]78 bool nlOnOff;
[53ba273]79}; // ifstream
[6ba0659]80
[09687aa]81// public
[0efb269]82void nlOn( ifstream & );
83void nlOff( ifstream & );
84bool getANL( ifstream & );
[09687aa]85int fail( ifstream & is );
86int eof( ifstream & is );
[8da74119]87void open( ifstream & is, const char * name, const char * mode );
[09687aa]88void open( ifstream & is, const char * name );
89void close( ifstream & is );
[91d766d]90ifstream & read( ifstream & is, char * data, size_t size );
[09687aa]91ifstream & ungetc( ifstream & is, char c );
[9d362a0]92int fmt( ifstream &, const char format[], ... );
[09687aa]93
94void ?{}( ifstream & is );
[8da74119]95void ?{}( ifstream & is, const char * name, const char * mode );
[09687aa]96void ?{}( ifstream & is, const char * name );
[51b73452]97
[09687aa]98extern ifstream & sin;
[51b73452]99
[86bd7c1f]100// Local Variables: //
[d3b7937]101// mode: c //
[86bd7c1f]102// tab-width: 4 //
103// End: //
Note: See TracBrowser for help on using the repository browser.