code::AIStream Class Reference

Inheritance diagram for code::AIStream:

code::InputStream List of all members.

Detailed Description

AIStream provides an ASCII stream.

Author:
: Lakshman
Version:
:
Id
code_AsciiStream.h,v 1.6 2009/06/02 20:17:39 lakshman Exp
See also:
NetworkFormat

AsciiDump


Public Member Functions

 AIStream (std::istream &inp_stream, const std::string &separator)
 Pass in the input stream to read from and the separator that separates items.
virtual AIStreamoperator>> (float &val) throw ( std::string )
 Extract a float from the input stream.
virtual AIStreamoperator>> (double &val) throw ( std::string )
 Extract a double from the input stream.
virtual AIStreamoperator>> (bool &val) throw ( std::string )
 Extract a bool from the input stream.
virtual AIStreamoperator>> (char &val) throw ( std::string )
 Extract a char from the input stream.
virtual AIStreamoperator>> (unsigned char &val) throw ( std::string )
 Extract an unsigned char from the input stream.
virtual AIStreamoperator>> (int16_t &val) throw ( std::string )
 Extract an int16_t from the input stream.
virtual AIStreamoperator>> (uint16_t &val) throw ( std::string )
 Extract a uint16_t from the input stream.
virtual AIStreamoperator>> (int32_t &val) throw ( std::string )
 Extract a int32_t from the input stream.
virtual AIStreamoperator>> (uint32_t &val) throw ( std::string )
 Extract a uint32_t from the input stream.
virtual AIStreamoperator>> (int64_t &val) throw ( std::string )
 Extract an int64_t from the input stream.
virtual AIStreamoperator>> (uint64_t &val) throw ( std::string )
 Extract a uint64_t from the input stream.
virtual AIStreamoperator>> (std::string &) throw ( std::string )
 Extract a std::string from the input stream.
virtual ~AIStream ()
 Virtual destructor for subclassing.

Protected Member Functions

virtual void skip_sep ()
 Function called by all the >> functions, to skip the separator.

Protected Attributes

std::istream & is
 Stores reference to input stream.


Constructor & Destructor Documentation

code::AIStream::AIStream ( std::istream &  inp_stream,
const std::string &  separator 
)

Pass in the input stream to read from and the separator that separates items.

This separator may be "\n" or other white-space or it may be symbols such as pipes ("|")

virtual code::AIStream::~AIStream (  )  [inline, virtual]

Virtual destructor for subclassing.


Member Function Documentation

virtual AIStream& code::AIStream::operator>> ( std::string &   )  throw ( std::string ) [virtual]

Extract a std::string from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( uint64_t val  )  throw ( std::string ) [inline, virtual]

Extract a uint64_t from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( int64_t val  )  throw ( std::string ) [inline, virtual]

Extract an int64_t from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( uint32_t val  )  throw ( std::string ) [inline, virtual]

Extract a uint32_t from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( int32_t val  )  throw ( std::string ) [inline, virtual]

Extract a int32_t from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( uint16_t val  )  throw ( std::string ) [inline, virtual]

Extract a uint16_t from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( int16_t val  )  throw ( std::string ) [inline, virtual]

Extract an int16_t from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( unsigned char &  val  )  throw ( std::string ) [inline, virtual]

Extract an unsigned char from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( char &  val  )  throw ( std::string ) [inline, virtual]

Extract a char from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( bool &  val  )  throw ( std::string ) [inline, virtual]

Extract a bool from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( double &  val  )  throw ( std::string ) [inline, virtual]

Extract a double from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual AIStream& code::AIStream::operator>> ( float &  val  )  throw ( std::string ) [inline, virtual]

Extract a float from the input stream.

If an error occurs while reading from the stream, an explanatory std::string will be thrown and the reference argument will be unchanged.

Exceptions:
std::string 

Implements code::InputStream.

virtual void code::AIStream::skip_sep (  )  [protected, virtual]

Function called by all the >> functions, to skip the separator.


Member Data Documentation

std::istream& code::AIStream::is [protected]

Stores reference to input stream.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7