Changeset 9ebd778
- Timestamp:
- May 15, 2017, 6:43:54 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 6c6455f
- Parents:
- 3dafd83
- Location:
- src/libcfa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/fstream
r3dafd83 r9ebd778 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 21 15:57:24201713 // Update Count : 10 212 // Last Modified On : Mon May 15 18:11:09 2017 13 // Update Count : 104 14 14 // 15 15 … … 29 29 }; // ofstream 30 30 31 // private 31 32 _Bool sepPrt( ofstream * ); 32 void sepOn( ofstream * );33 void sepOff( ofstream * );34 33 void sepReset( ofstream * ); 35 34 void sepReset( ofstream *, _Bool ); 36 35 const char * sepGetCur( ofstream * ); 37 36 void sepSetCur( ofstream *, const char * ); 37 38 // public 39 void sepOn( ofstream * ); 40 void sepOff( ofstream * ); 41 _Bool sepDisable( ofstream * ); 42 _Bool sepEnable( ofstream * ); 43 38 44 const char * sepGet( ofstream * ); 39 45 void sepSet( ofstream *, const char * ); 40 46 const char * sepGetTuple( ofstream * ); 41 47 void sepSetTuple( ofstream *, const char * ); 42 _Bool sepDisable( ofstream * );43 _Bool sepEnable( ofstream * );44 48 45 49 int fail( ofstream * ); -
src/libcfa/fstream.c
r3dafd83 r9ebd778 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 23 08:20:41 201713 // Update Count : 2 2612 // Last Modified On : Mon May 15 18:11:11 2017 13 // Update Count : 234 14 14 // 15 15 … … 38 38 } 39 39 40 // private 40 41 _Bool sepPrt( ofstream * os ) { return os->sepOnOff; } 42 void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; } 43 void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; } 44 const char * sepGetCur( ofstream * os ) { return os->sepCur; } 45 void sepSetCur( ofstream * os, const char * sepCur ) { os->sepCur = sepCur; } 46 47 // public 41 48 void sepOn( ofstream * os ) { os->sepOnOff = 1; } 42 49 void sepOff( ofstream * os ) { os->sepOnOff = 0; } 43 void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }44 void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }45 46 const char * sepGetCur( ofstream * os ) { return os->sepCur; }47 void sepSetCur( ofstream * os, const char * sepCur ) { os->sepCur = sepCur; }48 49 const char * sepGet( ofstream * os ) { return os->separator; }50 51 void sepSet( ofstream * os, const char * s ) {52 assert( s );53 strncpy( os->separator, s, separateSize - 1 );54 os->separator[separateSize - 1] = '\0';55 } // sepSet56 57 const char * sepGetTuple( ofstream * os ) { return os->tupleSeparator; }58 59 void sepSetTuple( ofstream * os, const char * s ) {60 assert( s );61 strncpy( os->tupleSeparator, s, separateSize - 1 );62 os->tupleSeparator[separateSize - 1] = '\0';63 } // sepSet64 50 65 51 _Bool sepDisable( ofstream *os ) { … … 73 59 _Bool temp = os->sepDefault; 74 60 os->sepDefault = true; 75 sepReset( os );61 if ( os->sepOnOff ) sepReset( os ); // start of line ? 76 62 return temp; 77 63 } // sepEnable 64 65 const char * sepGet( ofstream * os ) { return os->separator; } 66 void sepSet( ofstream * os, const char * s ) { 67 assert( s ); 68 strncpy( os->separator, s, separateSize - 1 ); 69 os->separator[separateSize - 1] = '\0'; 70 } // sepSet 71 72 const char * sepGetTuple( ofstream * os ) { return os->tupleSeparator; } 73 void sepSetTuple( ofstream * os, const char * s ) { 74 assert( s ); 75 strncpy( os->tupleSeparator, s, separateSize - 1 ); 76 os->tupleSeparator[separateSize - 1] = '\0'; 77 } // sepSet 78 78 79 79 int fail( ofstream * os ) { -
src/libcfa/iostream
r3dafd83 r9ebd778 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 21 15:57:29201713 // Update Count : 10 412 // Last Modified On : Mon May 15 18:08:44 2017 13 // Update Count : 105 14 14 // 15 15 … … 20 20 21 21 trait ostream( dtype ostype ) { 22 // private 22 23 _Bool sepPrt( ostype * ); // return separator state (on/off) 23 void sepOn( ostype * ); // turn separator state on24 void sepOff( ostype * ); // turn separator state off25 24 void sepReset( ostype * ); // set separator state to default state 26 25 void sepReset( ostype *, _Bool ); // set separator and default state 27 26 const char * sepGetCur( ostype * ); // get current separator string 28 27 void sepSetCur( ostype *, const char * ); // set current separator string 28 // public 29 void sepOn( ostype * ); // turn separator state on 30 void sepOff( ostype * ); // turn separator state off 31 _Bool sepDisable( ostype * ); // set default state to off, and return previous state 32 _Bool sepEnable( ostype * ); // set default state to on, and return previous state 33 29 34 const char * sepGet( ostype * ); // get separator string 30 35 void sepSet( ostype *, const char * ); // set separator to string (15 character maximum) 31 36 const char * sepGetTuple( ostype * ); // get tuple separator string 32 37 void sepSetTuple( ostype *, const char * ); // set tuple separator to string (15 character maximum) 33 _Bool sepDisable( ostype * ); // set default state to off, and return previous state34 _Bool sepEnable( ostype * ); // set default state to on, and return previous state35 38 36 39 int fail( ostype * );
Note: See TracChangeset
for help on using the changeset viewer.