Changeset e99e43f for libcfa/src/iostream.hfa
- Timestamp:
- Jan 10, 2019, 3:50:34 PM (5 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- d97c3a4
- Parents:
- aeb8f70 (diff), 08222c7 (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. - git-author:
- Aaron Moss <a3moss@…> (01/10/19 14:46:09)
- git-committer:
- Aaron Moss <a3moss@…> (01/10/19 15:50:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.hfa
raeb8f70 re99e43f 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 11 08:22:49201813 // Update Count : 15612 // Last Modified On : Mon Dec 24 18:33:40 2018 13 // Update Count : 220 14 14 // 15 15 … … 20 20 trait ostream( dtype ostype ) { 21 21 // private 22 bool sepPrt( ostype & ); // returnseparator state (on/off)22 bool sepPrt( ostype & ); // get separator state (on/off) 23 23 void sepReset( ostype & ); // set separator state to default state 24 24 void sepReset( ostype &, bool ); // set separator and default state 25 25 const char * sepGetCur( ostype & ); // get current separator string 26 26 void sepSetCur( ostype &, const char * ); // set current separator string 27 bool getNL( ostype & ); // check newline27 bool getNL( ostype & ); // check newline 28 28 void setNL( ostype &, bool ); // saw newline 29 bool getANL( ostype & ); // get auto newline (on/off) 30 bool getPrt( ostype & ); // get fmt called in output cascade 31 void setPrt( ostype &, bool ); // set fmt called in output cascade 29 32 // public 30 33 void sepOn( ostype & ); // turn separator state on 31 34 void sepOff( ostype & ); // turn separator state off 32 35 bool sepDisable( ostype & ); // set default state to off, and return previous state 33 bool sepEnable( ostype & ); // set default state to on, and return previous state 36 bool sepEnable( ostype & ); // set default state to on, and return previous state 37 void nlOn( ostype & ); // turn auto-newline state on 38 void nlOff( ostype & ); // turn auto-newline state off 34 39 35 40 const char * sepGet( ostype & ); // get separator string … … 43 48 void close( ostype & os ); 44 49 ostype & write( ostype &, const char *, size_t ); 45 int fmt( ostype &, const char f mt[], ... );50 int fmt( ostype &, const char format[], ... ); 46 51 }; // ostream 47 52 … … 58 63 forall( dtype ostype | ostream( ostype ) ) { 59 64 ostype & ?|?( ostype &, bool ); 65 void ?|?( ostype &, bool ); 60 66 61 67 ostype & ?|?( ostype &, char ); 68 void ?|?( ostype &, char ); 62 69 ostype & ?|?( ostype &, signed char ); 70 void ?|?( ostype &, signed char ); 63 71 ostype & ?|?( ostype &, unsigned char ); 72 void ?|?( ostype &, unsigned char ); 64 73 65 74 ostype & ?|?( ostype &, short int ); 75 void ?|?( ostype &, short int ); 66 76 ostype & ?|?( ostype &, unsigned short int ); 77 void ?|?( ostype &, unsigned short int ); 67 78 ostype & ?|?( ostype &, int ); 79 void ?|?( ostype &, int ); 68 80 ostype & ?|?( ostype &, unsigned int ); 81 void ?|?( ostype &, unsigned int ); 69 82 ostype & ?|?( ostype &, long int ); 83 void ?|?( ostype &, long int ); 70 84 ostype & ?|?( ostype &, long long int ); 85 void ?|?( ostype &, long long int ); 71 86 ostype & ?|?( ostype &, unsigned long int ); 87 void ?|?( ostype &, unsigned long int ); 72 88 ostype & ?|?( ostype &, unsigned long long int ); 89 void ?|?( ostype &, unsigned long long int ); 73 90 74 91 ostype & ?|?( ostype &, float ); // FIX ME: should not be required 92 void ?|?( ostype &, float ); // FIX ME: should not be required 75 93 ostype & ?|?( ostype &, double ); 94 void ?|?( ostype &, double ); 76 95 ostype & ?|?( ostype &, long double ); 96 void ?|?( ostype &, long double ); 77 97 78 98 ostype & ?|?( ostype &, float _Complex ); 99 void ?|?( ostype &, float _Complex ); 79 100 ostype & ?|?( ostype &, double _Complex ); 101 void ?|?( ostype &, double _Complex ); 80 102 ostype & ?|?( ostype &, long double _Complex ); 103 void ?|?( ostype &, long double _Complex ); 81 104 82 105 ostype & ?|?( ostype &, const char * ); 106 void ?|?( ostype &, const char * ); 83 107 // ostype & ?|?( ostype &, const char16_t * ); 84 108 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous … … 87 111 // ostype & ?|?( ostype &, const wchar_t * ); 88 112 ostype & ?|?( ostype &, const void * ); 113 void ?|?( ostype &, const void * ); 89 114 90 115 // manipulators 91 116 ostype & ?|?( ostype &, ostype & (*)( ostype & ) ); 92 ostype & endl( ostype & ); 117 void ?|?( ostype &, ostype & (*)( ostype & ) ); 118 ostype & nl( ostype & ); 119 void nl( ostype & ); 120 ostype & nonl( ostype & ); 93 121 ostype & sep( ostype & ); 94 122 ostype & sepTuple( ostype & ); … … 97 125 ostype & sepDisable( ostype & ); 98 126 ostype & sepEnable( ostype & ); 127 ostype & nlOn( ostype & ); 128 ostype & nlOff( ostype & ); 99 129 } // distribution 100 130 101 131 // tuples 102 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) 103 ostype & ?|?( ostype & os, T arg, Params rest ); 132 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) { 133 ostype & ?|?( ostype & os, T arg, Params rest ); 134 void ?|?( ostype & os, T arg, Params rest ); 135 } // distribution 104 136 105 137 // writes the range [begin, end) to the given stream 106 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) 107 void write( iterator_type begin, iterator_type end, ostype & os ); 108 109 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) 110 void write_reverse( iterator_type begin, iterator_type end, ostype & os ); 138 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) ) { 139 void write( iterator_type begin, iterator_type end, ostype & os ); 140 void write_reverse( iterator_type begin, iterator_type end, ostype & os ); 141 } // distribution 111 142 112 143 //--------------------------------------- … … 119 150 istype & read( istype &, char *, size_t ); 120 151 istype & ungetc( istype &, char ); 121 int fmt( istype &, const char f mt[], ... );152 int fmt( istype &, const char format[], ... ); 122 153 }; // istream 123 154 … … 152 183 // manipulators 153 184 istype & ?|?( istype &, istype & (*)( istype & ) ); 154 istype & endl( istype & is );185 istype & nl( istype & is ); 155 186 } // distribution 156 187 … … 164 195 165 196 166 #include <time_t.hfa> // Duration (constructors) / Time (constructors) 167 168 forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Duration dur ); 169 forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time ); 170 197 #include <time_t.hfa> // Duration (constructors) / Time (constructors) 198 199 forall( dtype ostype | ostream( ostype ) ) { 200 ostype & ?|?( ostype & os, Duration dur ); 201 void ?|?( ostype & os, Duration dur ); 202 ostype & ?|?( ostype & os, Time time ); 203 void ?|?( ostype & os, Time time ); 204 } // distribution 171 205 172 206 // Local Variables: //
Note: See TracChangeset
for help on using the changeset viewer.