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

#include <IOBStream.h>

Classes

class  Impl
 

Public Member Functions

 OBStream ()
 
 OBStream (const Path &file_path, bool append=false, bool text=true)
 
 OBStream (AString &s)
 
 OBStream (StringBuffer &s)
 
 OBStream (CommBuffer &s, bool text)
 
 ~OBStream ()
 
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

Implimpl_
 

Detailed Description

Generig stream writer

Constructor & Destructor Documentation

OBStream::OBStream ( )
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
OBStream::OBStream ( commore::AString s)
Parameters
sstring where stream will be write
OBStream::OBStream ( commore::StringBuffer s)
Parameters
sstring buffer where stream will be write
OBStream::OBStream ( commore::CommBuffer s,
bool  text 
)
Parameters
scommunication buffer where stream will be write
textif true stream is a text stream (force xml format)
OBStream::~OBStream ( )

Member Function Documentation

void OBStream::close ( )

Close stream Flush remaining data

void OBStream::flush ( )

Write remaining data in stream to data container

OBStreamFormat OBStream::format ( const AChar format)

Write formated data to text stream

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

Increment indetation

Parameters
i
Remarks
only for text stream
bool OBStream::is_open ( )
Returns
true if stream regulary open
bool OBStream::is_text ( ) const
bool 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 OBStream::open ( commore::AString s)

Open stream on a string

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

Open stream on a string buffer

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

Open stream on a communication buffer

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

Write formated data to text stream

void OBStream::put ( int  c)

Add a character to stream

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

Add a character string to stream

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

Decrement indetation

Parameters
i
Remarks
only for text stream

Member Data Documentation

Impl* commore::OBStream::impl_
protected

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