Logo
~Sockets~
~Examples~
~Contact~


StreamWriter Class Reference

#include <StreamWriter.h>

Collaboration diagram for StreamWriter:

List of all members.


Public Member Functions

 StreamWriter (IStream &stream)
virtual ~StreamWriter ()
StreamWriteroperator<< (const char *)
StreamWriteroperator<< (const std::string &)
StreamWriteroperator<< (short)
StreamWriteroperator<< (int)
StreamWriteroperator<< (long)
StreamWriteroperator<< (double)

Private Attributes

IStreamm_stream

Detailed Description

Definition at line 45 of file StreamWriter.h.


Constructor & Destructor Documentation

StreamWriter::StreamWriter ( IStream stream  ) 

Definition at line 43 of file StreamWriter.cpp.

00043                                           : m_stream(stream)
00044 {
00045 }

virtual StreamWriter::~StreamWriter (  )  [inline, virtual]

Definition at line 49 of file StreamWriter.h.

00049 {}


Member Function Documentation

StreamWriter & StreamWriter::operator<< ( const char *  buf  ) 

Definition at line 48 of file StreamWriter.cpp.

References IStream::IStreamWrite(), and m_stream.

00049 {
00050   m_stream.IStreamWrite(buf, strlen(buf));
00051   return *this;
00052 }

StreamWriter & StreamWriter::operator<< ( const std::string &  str  ) 

Definition at line 55 of file StreamWriter.cpp.

References IStream::IStreamWrite(), and m_stream.

00056 {
00057   m_stream.IStreamWrite(str.c_str(), str.size());
00058   return *this;
00059 }

StreamWriter & StreamWriter::operator<< ( short  x  ) 

Definition at line 62 of file StreamWriter.cpp.

References Utility::l2string().

00063 {
00064   *this << Utility::l2string(x);
00065   return *this;
00066 }

StreamWriter & StreamWriter::operator<< ( int  x  ) 

Definition at line 69 of file StreamWriter.cpp.

References Utility::l2string().

00070 {
00071   *this << Utility::l2string(x);
00072   return *this;
00073 }

StreamWriter & StreamWriter::operator<< ( long  x  ) 

Definition at line 76 of file StreamWriter.cpp.

References Utility::l2string().

00077 {
00078   *this << Utility::l2string(x);
00079   return *this;
00080 }

StreamWriter & StreamWriter::operator<< ( double  x  ) 

Definition at line 83 of file StreamWriter.cpp.

References Utility::ToString().

00084 {
00085   *this << Utility::ToString(x);
00086   return *this;
00087 }


Member Data Documentation

Definition at line 59 of file StreamWriter.h.

Referenced by operator<<().


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2007 by Anders Hedström
Generated for C++ Sockets by  doxygen 1.4.4