Changeset 1073 for branches/corba
- Timestamp:
- 2000-04-05T22:19:39+12:00 (24 years ago)
- Location:
- branches/corba/gsdl/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/corba/gsdl/lib/text_t.cpp
r1067 r1073 28 28 /* 29 29 $Log$ 30 Revision 1.15.2.2 2000/04/05 10:19:38 syeates 31 added automatic conversion to allow text_t's to be <<'ed to ostreams 32 30 33 Revision 1.15.2.1 2000/04/04 15:02:29 cs025 31 34 Corba first commit … … 107 110 // text_t methods 108 111 //////////////////////////////////// 112 113 // new stream converter ... 114 ostream& operator<< (ostream &o, const text_t text) 115 { 116 text_t::const_iterator ithere = text.begin(); 117 text_t::const_iterator itend = text.end(); 118 119 while (ithere != itend) 120 { 121 if (*ithere < 256) 122 { 123 o << (unsigned char)(*ithere); 124 } 125 else 126 { 127 // put a space or a question mark depending on what 128 // the character is. Question marks tell the user that 129 // they are missing some information. 130 if (is_unicode_space (*ithere)) 131 o << ' '; 132 else 133 o << '?'; 134 } 135 ithere++; 136 } 137 138 return o; 139 } 109 140 110 141 text_t::text_t () -
branches/corba/gsdl/lib/text_t.h
r1067 r1073 167 167 char *getcarr(size_type &len) const; 168 168 char *getcstr() const; 169 }; 170 169 170 }; 171 172 // new stream converter ... 173 ostream& operator<< (ostream &o, const text_t text); 171 174 172 175 inline text_t operator+(const text_t &t1, const text_t &t2)
Note:
See TracChangeset
for help on using the changeset viewer.