Lolly 1.4.27
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tm_ostream Class Reference

#include <tm_ostream.hpp>

Collaboration diagram for tm_ostream:
Collaboration graph
[legend]

Public Member Functions

 tm_ostream ()
 
 tm_ostream (char *)
 
 tm_ostream (FILE *)
 
 tm_ostream (const tm_ostream &)
 
 tm_ostream (tm_ostream_rep *)
 
 ~tm_ostream ()
 
tm_ostream_repoperator-> ()
 
tm_ostreamoperator= (tm_ostream x)
 
bool operator== (tm_ostream &)
 
void clear ()
 
void flush ()
 
void buffer ()
 
string unbuffer ()
 
void redirect (tm_ostream x)
 
tm_ostreamoperator<< (bool)
 
tm_ostreamoperator<< (char)
 
tm_ostreamoperator<< (short)
 
tm_ostreamoperator<< (unsigned short)
 
tm_ostreamoperator<< (int)
 
tm_ostreamoperator<< (unsigned int)
 
tm_ostreamoperator<< (long)
 
tm_ostreamoperator<< (unsigned long)
 
tm_ostreamoperator<< (long long int)
 
tm_ostreamoperator<< (unsigned long long int)
 
tm_ostreamoperator<< (float)
 
tm_ostreamoperator<< (double)
 
tm_ostreamoperator<< (long double)
 
tm_ostreamoperator<< (const char *)
 

Public Attributes

tm_ostream_reprep
 

Static Public Attributes

static tm_ostream private_cout
 
static tm_ostream private_cerr
 
static tm_ostreamcout
 
static tm_ostreamcerr
 

Detailed Description

Definition at line 36 of file tm_ostream.hpp.

Constructor & Destructor Documentation

◆ tm_ostream() [1/5]

tm_ostream::tm_ostream ( )

Definition at line 149 of file tm_ostream.cpp.

150 INC_COUNT (this->rep);
151}
#define INC_COUNT(R)
Macro used to increment the reference count for a structure object.
Definition classdef.hpp:74
The list class represents a linked list.
Definition list.hpp:48
tm_ostream_rep * rep
base class of resources
Definition resource.hpp:23

◆ tm_ostream() [2/5]

tm_ostream::tm_ostream ( char * s)

Definition at line 152 of file tm_ostream.cpp.

153 INC_COUNT (this->rep);
154}

◆ tm_ostream() [3/5]

tm_ostream::tm_ostream ( FILE * f)

Definition at line 155 of file tm_ostream.cpp.

156 INC_COUNT (this->rep);
157}

◆ tm_ostream() [4/5]

tm_ostream::tm_ostream ( const tm_ostream & x)

Definition at line 158 of file tm_ostream.cpp.

158 : rep (x.rep) {
159 INC_COUNT (this->rep);
160}

◆ tm_ostream() [5/5]

tm_ostream::tm_ostream ( tm_ostream_rep * rep2)

Definition at line 161 of file tm_ostream.cpp.

161 : rep (rep2) {
162 INC_COUNT (this->rep);
163}

◆ ~tm_ostream()

tm_ostream::~tm_ostream ( )

Definition at line 164 of file tm_ostream.cpp.

164{ DEC_COUNT (this->rep); }
#define DEC_COUNT(R)
Macro used to decrement the reference count for a structure object and delete it if the count reaches...
Definition classdef.hpp:84

Member Function Documentation

◆ operator->()

tm_ostream_rep * tm_ostream::operator-> ( )

Definition at line 166 of file tm_ostream.cpp.

166 {
167 return rep;
168}

◆ operator=()

tm_ostream & tm_ostream::operator= ( tm_ostream x)

Definition at line 170 of file tm_ostream.cpp.

170 {
171 INC_COUNT (x.rep);
172 DEC_COUNT (this->rep);
173 this->rep= x.rep;
174 return *this;
175}

◆ operator==()

bool tm_ostream::operator== ( tm_ostream & out)

Definition at line 177 of file tm_ostream.cpp.

177 {
178 return (&out == this);
179}

◆ clear()

void tm_ostream::clear ( )

Definition at line 182 of file tm_ostream.cpp.

182 {
183 rep->clear ();
184}

◆ flush()

void tm_ostream::flush ( )

Definition at line 187 of file tm_ostream.cpp.

187 {
188 rep->flush ();
189}

◆ buffer()

void tm_ostream::buffer ( )

Definition at line 192 of file tm_ostream.cpp.

192 {
194 INC_COUNT (rep);
195}

◆ unbuffer()

string tm_ostream::unbuffer ( )

Definition at line 198 of file tm_ostream.cpp.

198 {
200 rep = ptr->master;
201 string r = ptr->buf;
202 INC_COUNT (rep);
203 DEC_COUNT (ptr);
204 return r;
205}

◆ redirect()

void tm_ostream::redirect ( tm_ostream x)

Definition at line 208 of file tm_ostream.cpp.

208 {
209 INC_COUNT (x.rep);
210 DEC_COUNT (this->rep);
211 this->rep= x.rep;
212}

◆ operator<<() [1/14]

tm_ostream & tm_ostream::operator<< ( bool b)

Definition at line 218 of file tm_ostream.cpp.

219 {
220 if (b) rep->write ("true");
221 else rep->write ("false");
222 return *this;
223}
blackbox b[13]

◆ operator<<() [2/14]

tm_ostream & tm_ostream::operator<< ( char c)

Definition at line 225 of file tm_ostream.cpp.

226 {
227 static char _buf[8];
228 sprintf (_buf, "%c", c);
229 rep->write (_buf);
230 return *this;
231}

◆ operator<<() [3/14]

tm_ostream & tm_ostream::operator<< ( short sh)

Definition at line 233 of file tm_ostream.cpp.

234 {
235 static char _buf[32];
236 sprintf (_buf, "%hd", sh);
237 rep->write (_buf);
238 return *this;
239}

◆ operator<<() [4/14]

tm_ostream & tm_ostream::operator<< ( unsigned short ush)

Definition at line 241 of file tm_ostream.cpp.

242 {
243 static char _buf[32];
244 sprintf (_buf, "%hu", ush);
245 rep->write (_buf);
246 return *this;
247}

◆ operator<<() [5/14]

tm_ostream & tm_ostream::operator<< ( int i)

Definition at line 249 of file tm_ostream.cpp.

250 {
251 static char _buf[64];
252 sprintf (_buf, "%d", i);
253 rep->write (_buf);
254 return *this;
255}

◆ operator<<() [6/14]

tm_ostream & tm_ostream::operator<< ( unsigned int ui)

Definition at line 257 of file tm_ostream.cpp.

258 {
259 static char _buf[64];
260 sprintf (_buf, "%u", ui);
261 rep->write (_buf);
262 return *this;
263}

◆ operator<<() [7/14]

tm_ostream & tm_ostream::operator<< ( long l)

Definition at line 265 of file tm_ostream.cpp.

266 {
267 static char _buf[64];
268 sprintf (_buf, "%ld", l);
269 rep->write (_buf);
270 return *this;
271}

◆ operator<<() [8/14]

tm_ostream & tm_ostream::operator<< ( unsigned long ul)

Definition at line 273 of file tm_ostream.cpp.

274 {
275 static char _buf[64];
276 sprintf (_buf, "%lu", ul);
277 rep->write (_buf);
278 return *this;
279}

◆ operator<<() [9/14]

tm_ostream & tm_ostream::operator<< ( long long int )

◆ operator<<() [10/14]

tm_ostream & tm_ostream::operator<< ( unsigned long long int )

◆ operator<<() [11/14]

tm_ostream & tm_ostream::operator<< ( float f)

Definition at line 297 of file tm_ostream.cpp.

298 {
299 static char _buf[32];
300 sprintf (_buf, "%g", f);
301 rep->write (_buf);
302 return *this;
303}

◆ operator<<() [12/14]

tm_ostream & tm_ostream::operator<< ( double d)

Definition at line 305 of file tm_ostream.cpp.

306 {
307 static char _buf[64];
308 sprintf (_buf, "%g", d);
309 rep->write (_buf);
310 return *this;
311}

◆ operator<<() [13/14]

tm_ostream & tm_ostream::operator<< ( long double ld)

Definition at line 313 of file tm_ostream.cpp.

314 {
315 static char _buf[128];
316 sprintf (_buf, "%Lg", ld);
317 rep->write (_buf);
318 return *this;
319}

◆ operator<<() [14/14]

tm_ostream & tm_ostream::operator<< ( const char * s)

Definition at line 321 of file tm_ostream.cpp.

322 {
323 rep->write (s);
324 return *this;
325}

Member Data Documentation

◆ rep

tm_ostream_rep* tm_ostream::rep

Definition at line 38 of file tm_ostream.hpp.

◆ private_cout

tm_ostream tm_ostream::private_cout
static

Definition at line 41 of file tm_ostream.hpp.

◆ private_cerr

tm_ostream tm_ostream::private_cerr
static

Definition at line 42 of file tm_ostream.hpp.

◆ cout

tm_ostream& tm_ostream::cout
static

Definition at line 43 of file tm_ostream.hpp.

◆ cerr

tm_ostream& tm_ostream::cerr
static

Definition at line 44 of file tm_ostream.hpp.


The documentation for this class was generated from the following files: