Zen
A cross-platform functional programming language

stream Class Reference

Abstract stream type. More...

#include <zbl.hpp>

Inheritance diagram for stream:
filestream nullstream stringstream

List of all members.

Public Member Functions

 stream ()
 Default Constructor.
 stream (const stream &src)
 Copy constructor.
 stream (const z::string &txt)
 String Constructor.
 stream (FILE *file, QIODevice::OpenModeFlag flags)
 File Constructor.
 stream (file &f)
 File Constructor.
QTextStream & get ()
 Returns the stored value.
int pos ()
 Return current position in stream.
bool end ()
 Check if stream is at end.
void seek (const int &pos)
 Seek to specified position in stream, if possible.
void flush ()
 Flush the stream.
void setDevice (z::file &file)
 Set stream device.
const QString & getString () const
 If string stream, return the underlying string.
int getChar ()
 Get a char from the stream.

Private Attributes

QTextStream _val
 The value.

Detailed Description

Abstract stream type.


Constructor & Destructor Documentation

stream ( const stream src) [inline]

Copy constructor.

Parameters:
srcThe source instance
stream ( const z::string txt) [inline, explicit]

String Constructor.

Parameters:
txtThe string
stream ( FILE *  file,
QIODevice::OpenModeFlag  flags 
) [inline, explicit]

File Constructor.

Parameters:
fileThe file
flagsOpen mode
stream ( file f) [inline]

File Constructor.

Parameters:
fThe file

Member Function Documentation

bool end ( ) [inline]

Check if stream is at end.

Returns:
True if end of stream, else false
QTextStream& get ( ) [inline]

Returns the stored value.

Returns:
The value
int getChar ( ) [inline]

Get a char from the stream.

Returns:
The char
const QString& getString ( ) const [inline]

If string stream, return the underlying string.

Returns:
The underlying string.
int pos ( ) [inline]

Return current position in stream.

Returns:
Current position
void seek ( const int &  pos) [inline]

Seek to specified position in stream, if possible.

Parameters:
posThe position to seek to
void setDevice ( z::file file) [inline]

Set stream device.

Parameters:
fileThe device

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines