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

#include <IOBStream.h>

Public Member Functions

 OBStream (const Path &file_path, bool append=false, bool text=true)
 
 OBStream (AString &s)
 
 OBStream (StringBuffer &s)
 
 OBStream (CommBuffer &s, bool text)
 
bool open (const Path &file_path, bool append=false, bool text=true)
 
bool open (AString &s)
 
bool open (StringBuffer &s)
 
bool open (CommBuffer &c, bool text)
 
bool is_open ()
 
void put (int c)
 
void put (const char *s)
 
void flush ()
 
void indent (int i=1)
 
void unindent (int i=1)
 
int get_indent ()
 
int get_current_col ()
 
OBStreamFormat format (const AChar *format)
 
OBStreamFormat operator() (const AChar *format)
 
void close ()
 
bool is_text () const
 

Protected Attributes

Impl * impl_
 

Detailed Description

Generig stream writer

Constructor & Destructor Documentation

commore::OBStream::OBStream ( const Path file_path,
bool  append = false,
bool  text = true 
)
Parameters
file_pathof file where stream will be write
appendif true append stream to file
textif true stream is a text stream
commore::OBStream::OBStream ( AString s)
Parameters
sstring where stream will be write
commore::OBStream::OBStream ( StringBuffer s)
Parameters
sstring buffer where stream will be write
commore::OBStream::OBStream ( CommBuffer s,
bool  text 
)
Parameters
scommunication buffer where stream will be write
textif true stream is a text stream (force xml format)

Member Function Documentation

void commore::OBStream::close ( )

Close stream Flush remaining data

void commore::OBStream::flush ( )

Write remaining data in stream to data container

OBStreamFormat commore::OBStream::format ( const AChar *  format)

Write formated data to text stream

int commore::OBStream::get_current_col ( )
Returns
current column
int commore::OBStream::get_indent ( )
Returns
curent indent column
void commore::OBStream::indent ( int  i = 1)

Increment indetation

Parameters
i
Remarks
only for text stream
bool commore::OBStream::is_open ( )
Returns
true if stream regulary open
bool commore::OBStream::open ( const Path file_path,
bool  append = false,
bool  text = true 
)

Open stream on a file

Parameters
file_pathof file where stream will be write
appendif true append stream to file
textif true stream is a text stream
bool commore::OBStream::open ( AString s)

Open stream on a string

Parameters
sstring where stream will be write
bool commore::OBStream::open ( StringBuffer s)

Open stream on a string buffer

Parameters
sstring buffer where stream will be write
bool commore::OBStream::open ( CommBuffer c,
bool  text 
)

Open stream on a communication buffer

Parameters
ccommunication buffer where stream will be write
text
OBStreamFormat commore::OBStream::operator() ( const AChar *  format)

Write formated data to text stream

void commore::OBStream::put ( int  c)

Add a character to stream

Parameters
ccharater
void commore::OBStream::put ( const char *  s)

Add a character string to stream

Parameters
snull terminated string
void commore::OBStream::unindent ( int  i = 1)

Decrement indetation

Parameters
i
Remarks
only for text stream

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