commore  1.0.6-SNAPSHOT
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
commore::IBStream Class Reference

#include <IOBStream.h>

Public Member Functions

 IBStream (const AChar *s)
 
 IBStream (const StringBuffer &s)
 
 IBStream (const Path &file_path, bool text=true)
 
 IBStream (const CommBuffer &buffer)
 
bool open (const Path &file_path, bool text=true)
 
bool open (const AChar *s)
 
bool open (const StringBuffer &s)
 
bool open (const CommBuffer &b)
 
bool is_open ()
 
bool eof ()
 
int get ()
 
int get (char *dest, size_t len)
 
int peek ()
 
void eatwhite ()
 
const AChar * dump ()
 
void close ()
 

Protected Attributes

Impl * impl_
 

Detailed Description

Genenic stream reader

Constructor & Destructor Documentation

commore::IBStream::IBStream ( const AChar *  s)
Parameters
sas text input stream in a null terminated string
commore::IBStream::IBStream ( const StringBuffer s)
Parameters
sas text input stream in a StringBuffer
commore::IBStream::IBStream ( const Path file_path,
bool  text = true 
)
Parameters
file_pathpath of a file as input stream
textif true file is a text file
commore::IBStream::IBStream ( const CommBuffer buffer)
Parameters
bufferinput stream in a communication buffer

Member Function Documentation

void commore::IBStream::close ( )

Close stream

const AChar* commore::IBStream::dump ( )

Debug pupose

void commore::IBStream::eatwhite ( )

Read all white space

bool commore::IBStream::eof ( )
Returns
true if stream is terminated
int commore::IBStream::get ( )

Get current character and go to next

Returns
-1 if end of stream
int commore::IBStream::get ( char *  dest,
size_t  len 
)

Get len character and copy them to dest

Returns
number of read character
bool commore::IBStream::is_open ( )
Returns
true if stream is open
bool commore::IBStream::open ( const Path file_path,
bool  text = true 
)

Open stream on a file content

Parameters
file_pathpath of a file as input stream
textif true file is a text file
bool commore::IBStream::open ( const AChar *  s)

Open stream on a string content

Parameters
s
bool commore::IBStream::open ( const StringBuffer s)

Open stream on a string buffer content

Parameters
s
bool commore::IBStream::open ( const CommBuffer b)

Open stream on a communication buffer content

Parameters
bCommBuffer to use as input
int commore::IBStream::peek ( )

Get current character

Returns
-1 if end of stream

The documentation for this class was generated from the following file: