Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Status & Roadmap
FAQ
Authors & License
Forums
Wiki
Funding Ultimate++
Search on this site











SourceForge.net Logo



Stream utilities

 

String LoadStream(Stream& in)

Reads the stream starting with the current position till the end is reached and returns data in String.

in

Stream.

Return value

Content of stream.

 

bool SaveStream(Stream& out, const String& data)

Writes data to stream.

out

Output stream.

data

Data to write.

Return value

True if all data were successfully written to the stream.

 

int64 CopyStream(Stream& dest, Stream& src, int64 count)

Copies data from source to destination stream.

dest

Destination stream.

src

Source stream.

count

Number of bytes to copy.

Return value

Number of bytes actually copies.

 

int64 CopyStream(Stream& dest, Stream& src)

Copies all data from source stream starting with current position to the destination stream.

dest

Destination stream.

src

Source stream.

Return value

Number of bytes copied.

 

Stream& Cout()

Returns special output stream representing console output. Data written to this stream are displayed as characters in console.

Return value

Console stream.

 

String ReadStdIn()

Reads one line of input data from the console.

Return value

Console input.

 

Stream& NilStream()

Returns special stream that is always in IsEof state and simply discards all data written to it.

Return value

"Black hole" stream.

 

String LoadFile(const char *filename)

Loads the content of specified file.

filename

File name.

Return value

Content of file.

 

bool SaveFile(const char *filename, const String& data)

Saves data as the file (overwrites existing).

filename

File name.

data

Data to write.

Return value

true if file was successfully written.

 

template <class T>  Stream& operator%(Stream& s, Tx)

Serialization operator. Simply invokes x.Serialize(s);

T

Type of variable to be serialized.

s

Stream.

x

Variable to be serialized.

Return value

s for chaining.

 

Stream& operator<<(Stream& s, const char *x)

Overload of stream insertion operator to get simple case work. Insertion operator uses formatted stream output (Putf).

s

Output stream.

x

Data to write - all characters are written to the stream.

Return value

s for chaining.

 

Stream& operator<<(Stream& s, char *x)

Overload of stream insertion operator to get simple case work. Insertion operator uses formatted stream output (Putf).

s

Output stream.

x

Data to write - all characters are written to the stream.

Return value

s for chaining.

 

Stream& operator<<(Stream& s, const String &x)

Overload of stream insertion operator to get simple case work. Insertion operator uses formatted stream output (Putf).

s

Output stream.

x

Data to write - all characters are written to the stream.

Return value

s for chaining.

 

Stream& operator<<(Stream& s, char x)

Overload of stream insertion operator to get simple case work. Insertion operator uses formatted stream output (Putf).

s

Output stream.

x

Data to write - it is written as single character.

Return value

s for chaining.

 

Stream& operator<<(Stream& s, const void *x)

Overload of stream insertion operator to get simple case work. Insertion operator uses formatted stream output (Putf).

s

Output stream.

x

Data to write - pointer is formatted as hexadecimal value.

Return value

s for chaining.

 

Stream& operator<<(Stream& s, void *x)

Overload of stream insertion operator to get simple case work. Insertion operator uses formatted stream output (Putf).

s

Output stream.

x

Data to write - pointer is formatted as hexadecimal value.

Return value

s for chaining.

 

template <class T>  Stream& operator<<(Stream& s, const Tx)

Global stream insertion operator. Calls AsString for x and stores the result to the stream. Global AsString version in turn calls ToString method of x.

T

Type of data to write to the stream.

s

Output stream.

x

Data to write.

Return value    s for chaining.