class PStringStream: public PString, public iostream

This class is a standard C++ stream class descendent for reading or writing streamed data to or from a PString class.

Inheritance:


Public Methods

[more] PStringStream ()
Create a new, empty, string stream.
[more] PStringStream ( const PString & str )
Create a new string stream and initialise it to the provided value.
[more] PStringStream ( const char * cstr )
Create a new string stream and initialise it with the provided value.
[more]PStringStream& operator= ( const PStringStream & strm )
Assign the string part of the stream to the current object.
[more]PStringStream& operator= ( const PString & str )
Assign the string to the current object.
[more]PStringStream& operator= ( const char * cstr )
Assign the C string to the string stream.
[more]PStringStream& operator= ( char ch )
Assign the character to the current object.
[more]virtual ~PStringStream ()
Destroy the string stream, deleting the stream buffer


Inherited from PString:

Public

Construction

Overrides from class PObject

Overrides from class PContainer

Size/Length functions

Concatenation operators *

Comparison operators

Search & replace functions

Sub-string functions

Conversion functions


Inherited from PCharArray:


Inherited from PBaseArray:

Public

New functions for class


Inherited from PAbstractArray:

Protected Fields

oPINDEX elementSize
ochar* theArray
oBOOL allocatedDynamically


Inherited from PContainer:

Public

Common functions for containers

Protected Methods

ovirtual void DestroyContents()
ovirtual void AssignContents(const PContainer & c)
ovoid CopyContents(const PContainer & c)
ovoid CloneContents(const PContainer * src)
ovoid Destruct()


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

This class is a standard C++ stream class descendent for reading or writing streamed data to or from a PString class.

All of the standard stream I/O operators, manipulators etc will operate on the PStringStream class.

o PStringStream()
Create a new, empty, string stream. Data may be output to this stream, but attempts to input from it will return end of file.

o PStringStream( const PString & str )
Create a new string stream and initialise it to the provided value. The string stream references the same string buffer as the str parameter until any output to the string stream is attempted. The reference is then broken and the instance of the string stream becomes a unique reference to a string buffer.
Parameters:
str - Initial value for string stream.

o PStringStream( const char * cstr )
Create a new string stream and initialise it with the provided value. The stream may be read or written from. Writes will append to the end of the string.
Parameters:
cstr - Initial value for the string stream.

oPStringStream& operator=( const PStringStream & strm )
Assign the string part of the stream to the current object. The current instance then becomes another reference to the same string in the strm parameter.

This will reset the read pointer for input to the beginning of the string. Also, any data output to the string up until the asasignement will be lost.

Returns:
reference to the current PStringStream object.

oPStringStream& operator=( const PString & str )
Assign the string to the current object. The current instance then becomes another reference to the same string in the str parameter.

This will reset the read pointer for input to the beginning of the string. Also, any data output to the string up until the asasignement will be lost.

Returns:
reference to the current PStringStream object.
Parameters:
str - New string to assign.

oPStringStream& operator=( const char * cstr )
Assign the C string to the string stream. The current instance then becomes a unique reference to a copy of the cstr parameter. The cstr parameter is typically a literal string, eg:
          myStr = "fred";

This will reset the read pointer for input to the beginning of the string. Also, any data output to the string up until the asasignement will be lost.

Returns:
reference to the current PStringStream object.
Parameters:
cstr - C string to assign.

oPStringStream& operator=( char ch )
Assign the character to the current object. The current instance then becomes a unique reference to a copy of the character parameter. eg:
          myStr = 'A';
Returns:
reference to the current PString object.
Parameters:
ch - Character to assign.

ovirtual ~PStringStream()
Destroy the string stream, deleting the stream buffer


Direct child classes:
PHTML

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.