xsil::Stream Class Reference
[Xsil document preparation]

#include <stream.hh>

Inheritance diagram for xsil::Stream:

xsil::xobj

List of all members.

Public Member Functions

 Stream (void)
 Stream (const char *Name, const char *Type=0, const char *Data=0)
 Stream (const Stream &x)
 ~Stream ()
Streamoperator= (const Stream &x)
void Spew (Xwriter &xout) const
void append (const std::string &s)
StreamClone (void) const
bool empty (void) const
const char * getDelimit (void) const
const char * getEncode (void) const
const char * getObjType (void) const
void delimit (char Delim)
void Add (float x)
void Add (const std::string &x, bool escsp=false)
void Add (int x)
void Add (double x)
void Add (const UCVec &x)
void Clear (void)
void Fill (int N, const float *x, int perLine=0)
void Fill (int N, const double *x, int perLine=0)
void Fill (int N, const int *x, int perLine=0)
void Fill (int N, const std::string x[], int perLine=0)
bool decode64Data (void *data, int dLen, int N)
void encode64Data (const char *data, int N)
void open (void)
void lineBreak (void)
bool read (double data[], int N)
 Read N data words.
bool read (float data[], int N)
 Read N data words.
bool read (int data[], int N)
 Read N data words.
bool read (std::string data[], int N)
 Read N data strings.
void setRemote (const char *File)
void setData (const char *Data)
void setEncode (const char *Code)
void setSize (int Size)


Detailed Description

An XSIL stream may be an internal list of data or it may point to a local file or remote data. brief XSIL data stream class.
Author:
J. Zweizig
Version:
1.1; Modified December 13, 1999

Constructor & Destructor Documentation

xsil::Stream::Stream ( void   ) 

Construct an unnamed empty stream. brief XSIL Stream default Constructor.

xsil::Stream::Stream ( const char *  Name,
const char *  Type = 0,
const char *  Data = 0 
)

Construct a stream. By default an empty stream is produced. brief XSIL Stream Constructor.

xsil::Stream::Stream ( const Stream x  ) 

Stream copy constructor.

xsil::Stream::~Stream (  ) 

XSIL stream destructor.


Member Function Documentation

Stream& xsil::Stream::operator= ( const Stream x  ) 

Stream copy constructor.

void xsil::Stream::Spew ( Xwriter xout  )  const [virtual]

Write it out as an XML document.

Implements xsil::xobj.

void xsil::Stream::append ( const std::string &  s  ) 

Append a string to the current local stream contents. Each striing is assumed to be a lexically complete token and is separated by the current delimiter character from the preceding data. If the string pushes the current line length beyond the maximum length, a new-line character is added and the white space is inserted so that the string will start at the current indent level. brief Add a string to the current local stream.

Parameters:
s Lexically complete token to be added to the stream.

Stream* xsil::Stream::Clone ( void   )  const [virtual]

Create a identical copy of the current Stream. brief Clone a stream.

Returns:
Pointer to the copy.

Implements xsil::xobj.

bool xsil::Stream::empty ( void   )  const [inline]

Test for data in stream.

Returns:
true if the stream is empty.

const char * xsil::Stream::getDelimit ( void   )  const [inline]

Get the delimiter character. brief Get delimiter.

const char * xsil::Stream::getEncode ( void   )  const [inline]

Get encoding type. brief Get encoding.

const char* xsil::Stream::getObjType ( void   )  const [virtual]

Get object type

Implements xsil::xobj.

void xsil::Stream::delimit ( char  Delim  ) 

Set the delimiter character. The delimiter character must be unique. brief Set the delimiter character.

void xsil::Stream::Add ( float  x  ) 

Append a floating point entry to the stream string. brief Append a float.

Parameters:
x float point number to be added to the stream.

void xsil::Stream::Add ( const std::string &  x,
bool  escsp = false 
)

Append a string to the stream string. brief Append a string.

Parameters:
x Character string to be appended to the stream.
escsp Escape blanks.

void xsil::Stream::Add ( int  x  ) 

Append a floating point entry to the stream string. brief Append an integer.

Parameters:
x Integer number to be added to the stream.

void xsil::Stream::Add ( double  x  ) 

Append a floating point entry to the stream string. brief Add a double float.

Parameters:
x Double floating point number to be added to the stream.

void xsil::Stream::Add ( const UCVec x  ) 

Append an unsigned byte string. brief Add a byte string.

Parameters:
x reference to the byte string descriptor.

void xsil::Stream::Clear ( void   ) 

Clear out the stream data. brief Clear the stream data.

void xsil::Stream::Fill ( int  N,
const float *  x,
int  perLine = 0 
)

Fill stream from a floating point array. brief Fill from floats.

Parameters:
N Number of strings to be copied to the stream.
x float point array to be converted and copied to the stream.
perLine Number of data values to print per line.

void xsil::Stream::Fill ( int  N,
const double *  x,
int  perLine = 0 
)

Fill stream from a double floating point array. brief Fill from doubles.

Parameters:
N Number of strings to be copied to the stream.
x double array to be converted and copied to the stream.
perLine Number of data values to print per line.

void xsil::Stream::Fill ( int  N,
const int *  x,
int  perLine = 0 
)

Fill stream from an integer array. brief Fill with integers.

Parameters:
N Number of strings to be copied to the stream.
x Integer array to be converted and copied to the stream.
perLine Number of data values to print per line.

void xsil::Stream::Fill ( int  N,
const std::string  x[],
int  perLine = 0 
)

Fill stream from a string array. brief Fill from strings.

Parameters:
N Number of strings to be copied to the stream.
x String array to be copied to the stream.
perLine Number of data values to print per line.

bool xsil::Stream::decode64Data ( void *  data,
int  dLen,
int  N 
)

Decode and copy base64 encoded data from the strem into a data array. The data are swapped if the specified byte ordering is different than that of the node. The byte-swapping granularity is specified by the dLen parameter. brief Fill from stream.

Parameters:
data String array to be encoded into the stream.
dLen Data granularity for use in byte swapping.
N Length of data to be encoded into the stream.
Returns:
Read error if true

void xsil::Stream::encode64Data ( const char *  data,
int  N 
)

Fill stream with base64 encoded data. brief Fill from string.

Parameters:
data String array to be encoded into the stream.
N length of data to be encoded into the stream.

void xsil::Stream::open ( void   ) 

Open the stream for input.

void xsil::Stream::lineBreak ( void   ) 

Insert a line break at the current position. brief Insert a line break.

bool xsil::Stream::read ( double  data[],
int  N 
)

Read N data words.

Read N double float data words from the input stream.

Parameters:
data Double vector to receive requested data.
N Number of data words to read.
Returns:
True if the requested data were read.

bool xsil::Stream::read ( float  data[],
int  N 
)

Read N data words.

Read N float data words from the input stream.

Parameters:
data Float vector to receive requested data.
N Number of data words to read.
Returns:
True if the requested data were read.

bool xsil::Stream::read ( int  data[],
int  N 
)

Read N data words.

Read N integer data words from the input stream.

Parameters:
data Integer vector to receive requested data.
N Number of data words to read.
Returns:
True if the requested data were read.

bool xsil::Stream::read ( std::string  data[],
int  N 
)

Read N data strings.

Read N character strings from the input stream.

Parameters:
data String vector to receive requested data.
N Number of data strings to read.
Returns:
True if the requested data were read.

void xsil::Stream::setRemote ( const char *  File  ) 

Make the stream a remote stream and define the file name. brief Define file for remote stream.

Parameters:
File File name or web address from which data are to be read.

void xsil::Stream::setData ( const char *  Data  ) 

Set the input data to the specified character string. brief set stream data.

Parameters:
Data pointer to a data string.

void xsil::Stream::setEncode ( const char *  Code  ) 

Specify the encoding technique used for binary data. brief Specify the encoding technique.

Parameters:
Code pointer to a string describing the encodeing technique.

void xsil::Stream::setSize ( int  Size  ) 

Set the Maximum line size. brief set line size.

Parameters:
Size Maximum line size to be used when printing the stream.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:50 2009 for dmt by  doxygen 1.5.4