Changeset b067d9b for libcfa/src/fstream.hfa
- Timestamp:
- Oct 29, 2019, 4:01:24 PM (6 years ago)
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.hfa
r7951100 rb067d9b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 5 10:20:25 201813 // Update Count : 1 3112 // Last Modified On : Mon Jul 15 18:10:23 2019 13 // Update Count : 167 14 14 // 15 15 16 16 #pragma once 17 17 18 #include "iostream" 18 #include "iostream.hfa" 19 20 21 //*********************************** ofstream *********************************** 22 19 23 20 24 enum { sepSize = 16 }; 21 25 struct ofstream { 22 26 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; 26 32 const char * sepCur; 27 33 char separator[sepSize]; … … 30 36 31 37 // private 32 _Bool sepPrt( ofstream & );38 bool sepPrt( ofstream & ); 33 39 void sepReset( ofstream & ); 34 void sepReset( ofstream &, _Bool );40 void sepReset( ofstream &, bool ); 35 41 const char * sepGetCur( ofstream & ); 36 42 void sepSetCur( ofstream &, const char * ); 37 _Bool getNL( ofstream & ); 38 void setNL( ofstream &, _Bool ); 43 bool getNL( ofstream & ); 44 void setNL( ofstream &, bool ); 45 bool getANL( ofstream & ); 46 bool getPrt( ofstream & ); 47 void setPrt( ofstream &, bool ); 39 48 40 49 // public 41 50 void sepOn( ofstream & ); 42 51 void sepOff( ofstream & ); 43 _Bool sepDisable( ofstream & ); 44 _Bool sepEnable( ofstream & ); 52 bool sepDisable( ofstream & ); 53 bool sepEnable( ofstream & ); 54 void nlOn( ofstream & ); 55 void nlOff( ofstream & ); 45 56 46 57 const char * sepGet( ofstream & ); … … 49 60 void sepSetTuple( ofstream &, const char * ); 50 61 62 void ends( ofstream & os ); 51 63 int fail( ofstream & ); 52 64 int flush( ofstream & ); … … 55 67 void close( ofstream & ); 56 68 ofstream & write( ofstream &, const char * data, size_t size ); 57 int fmt( ofstream &, const char f mt[], ... );69 int fmt( ofstream &, const char format[], ... ); 58 70 59 71 void ?{}( ofstream & os ); … … 61 73 void ?{}( ofstream & os, const char * name ); 62 74 63 extern ofstream & sout, & serr; 75 extern ofstream & sout, & stdout, & serr, & stderr; // aliases 76 extern ofstream & exit, & abort; 77 78 79 //*********************************** ifstream *********************************** 64 80 65 81 66 82 struct ifstream { 67 83 void * file; 84 bool nlOnOff; 68 85 }; // ifstream 69 86 70 87 // public 88 void nlOn( ifstream & ); 89 void nlOff( ifstream & ); 90 bool getANL( ifstream & ); 71 91 int fail( ifstream & is ); 72 92 int eof( ifstream & is ); … … 76 96 ifstream & read( ifstream & is, char * data, size_t size ); 77 97 ifstream & ungetc( ifstream & is, char c ); 78 int fmt( ifstream &, const char f mt[], ... );98 int fmt( ifstream &, const char format[], ... ); 79 99 80 100 void ?{}( ifstream & is ); … … 82 102 void ?{}( ifstream & is, const char * name ); 83 103 84 extern ifstream & sin ;104 extern ifstream & sin, & stdin; // aliases 85 105 86 106 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.