Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

dataio Class Reference

dataio main class to perform data input/output features The primitive data that will read/write are: bool, char, wchar_t (wchar_t work? perphaps, no), string, int, long, unsigned, unsigned long, float, double, long double. More...

#include <dataio.h>

List of all members.

Public Methods

void addcomment (string const &rem)
 add an comment item to comment list
See also:
clearcomment, comment, additemcomment, clearitemcomment, itemcomment.
More...


void clearcomment (bool includemember=false)
 clear comment list
See also:
addcomment, clearcomment, additemcomment, clearitemcomment, itemcomment.
More...


vector<string>& comment ()
 return reference for comment list use carefully
See also:
addcomment, clearcomment, additemcomment, clearitemcomment, itemcomment.
More...


bool addcomment (string const &name, string const &rem)
 add an comment item to comment list of named item return false if not found
See also:
clearcomment, comment, additemcomment, clearitemcomment, itemcomment.
More...


bool additemcomment (void *item, string const &rem)
 add an comment item to comment list of item
See also:
addcomment, clearcomment, comment, clearitemcomment, itemcomment.
More...


void clearcomment (string const &name, bool includemember=false)
 clear comment list of named item
See also:
addcomment, comment, additemcomment, clearitemcomment, itemcomment.
More...


void clearitemcomment (void *item, bool includemember=false)
 clear comment list of item
See also:
addcomment, clearcomment, comment, additemcomment, itemcomment.
More...


void clearitemcomment (bool includemember=false)
 clear comment list of all items
See also:
addcomment, clearcomment, comment, additemcomment, itemcomment.
More...


vector<string>& comment (string const &name)
 return reference for comment list of named item use carefully
See also:
addcomment, clearcomment, additemcomment, clearitemcomment, itemcomment.
More...


vector<string>& itemcomment (void *item)
 return reference for comment list of item use carefully
See also:
addcomment, clearcomment, comment, additemcomment, clearitemcomment.
More...


string& commentline ()
 One line comment start marker. Ignore at end of current line. Default is _DATAIODEFAULTCOMMENTLINE
See also:
_DATAIODEFAULTCOMMENTLINE, commentopen, commentclose.
More...


string& commentline (string const &com)
string& linewrap ()
 This marker is used in the end of line (possible followed by blank space or comment) The next line is appended in the end of line. Caution: it is in sperimental stage and name will change. Default is _DATAIODEFAULTLINEBREAK
See also:
_DATAIODEFAULTLINEBREAK.
More...


string& linewrap (string const &wrap)
void disablesection ()
 disable section (empty sectionnameopen and sectionnameclose) to activate the section, use enablestdsection, or set manually the sectionnameopen and sectionnameclose
See also:
sectionnameopen, sectionnameclose, enablestdsection.
More...


void enablestdsection ()
 set as standard section mode (set the sectionnameopen and sectionnameclose) for non-standard section mode, set sectionnameopen and sectionnameclose manually
See also:
sectionnameopen, sectionnameclose, disablestdsection.
More...


bool throwexception ()
 if this flag is true, throw exception on error default value is _DATAIODEFAULTTHROWEXCEPTION
See also:
printerrormessage, _DATAIODEFAULTTHROWEXCEPTION.
More...


bool throwexception (bool dec, bool includemember=true)
bool printerror ()
 if this flag is true, coutput error message on error default value is _DATAIODEFAULTPRINTEROR
See also:
throwexception, _DATAIODEFAULTPRINTEROR.
More...


bool printerror (bool dec, bool includemember=true)
bool emptyisvalid ()
 if this flag is true, consider empty value as valid value inside of several stringtoitem() conversion Default is _DATAIODEFAULTEMPTYISVALID
See also:
_DATAIODEFAULTEMPTYISVALID.
More...


bool emptyisvalid (bool flag, bool includemember=true)
bool ignorecase ()
 
Returns:
ignore case flag.
More...


bool ignorecase (bool status, bool includemember=true)
 Set ignore case flag. Default value of ignore case frag is _DATAIODEFAULTIGNORECASE
See also:
_DATAIODEFAULTIGNORECASE.
More...


char decimal ()
 
Returns:
decimal character used by floating number.
More...


char decimal (char dec, bool includemember=true)
 set decimal character used by floating number. Default is _DATAIODEFAULTDECIMAL
See also:
_DATAIODEFAULTDECIMAL.
More...


bool validateall ()
 
Returns:
true is all variable is validated.
More...


bool validateall (bool status, bool includemember=true)
 set flag to decide if unrefered variables will be validated. Default is _DATAIODEFAULTVALIDATEALL
See also:
validate, _DATAIODEFAULTVALIDATEALL.
More...


string& commentopen ()
string& commentopen (string const &s)
 
See also:
_DATAIODEFAULTCOMMENTOPEN, commentclose, commentline.
More...


string& commentclose ()
 Comment block endding marker. End the comment started by commentopen. Default is _DATAIODEFAULTCOMMENTCLOSE
See also:
_DATAIODEFAULTCOMMENTCLOSE, commentopen, commentline.
More...


string& commentclose (string const &s)
 < return comment block endding marker Comment block endding marker. End the comment started by commentopen. Default is _DATAIODEFAULTCOMMENTCLOSE
See also:
_DATAIODEFAULTCOMMENTCLOSE, commentopen, commentline.
More...


void disablecommentblock ()
 disable comment block features (empty commentopen and commentclose). More...

void enablestdcommentblock ()
 enable standard comment block mode for non-standard comment block mode, set manually the commentopen and commentclose. More...

bool setted ()
 
Returns:
true if all of value is correctly setted.
More...


bool setted (string const &name)
 
Returns:
true if the value of this, is correctly setted.
More...


bool itemsetted (void *item)
 
Returns:
true if the value of this is correctly setted.
More...


bool collectnames ()
bool collectnames (bool flag, bool includemember=true)
 set the flag for the name collector on value setting stage. if true, the all dataio type class that the value is setted, collect the refered names, inclusive the dataio class added to this collect their own refered names. note that the first level (the class that operator>> is called, always collect their names). CAUTION: name of this methods will change!
See also:
refered, _DATAIODEFAULTREFERSUBNAMES.
More...


bool refered (string const &name)
 return true is name appeared in input data during operator>> data processing
See also:
refersubnames itemrefered.
More...


bool itemrefered (void *item)
 return true is item is tryed to set in the input stage, during operator>> data processing
See also:
refersubnames referedt.
More...


vector<string>& referednames ()
vector<string>& unreferednames ()
 < return (reference of) referenced name list. More...

void add (string const &name, dataio *item)
 add one data record (or data block) with names
Parameters:
item   is pointer to dataio or derived to dataio (the derived class need casting to dataio pointer).
More...


void add (dataio *item)
 add one data record (or data block) without names
Parameters:
item   is pointer to dataio or derived to dataio (need casting to dataio pointer).
More...


template<class T> void add (string const &name, T *item)
 add one variable with names
Parameters:
item   is pointer to class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().
More...


template<class T> void add (T *item)
 add one item without names
Parameters:
item   is pointer to class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().
More...


template<class T> void add (string const &name, vector< T > *item)
 add one vector of class with names
Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().
More...


template<class T> void add (vector< T > *item)
 add one vector of class without names
Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().
More...


template<class T> void add (string const &name, vector< vector< T > > *item)
 add one vector of vector of class with names
Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().
More...


template<class T> void add (vector< vector< T > > *item)
 2 dimensional add one vector of vector of class without names
Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().
More...


template<class T> void addnamed (string const &name, T *item, unsigned long &strsize=*(unsigned long *) 0)
 TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence
Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().
More...


template<class T> void addunnamed (T *item, unsigned long &strsize=*(unsigned long *) 0)
 TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence
Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().
More...


template<class T> void addnamed (string const &name, vector< T > *item, unsigned long &m=*(unsigned long *) 0, unsigned long &strsize=*(unsigned long *) 0)
 TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write vector size in binary i/o. itherwise, assume that is fixed size = m vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence
Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().
More...


template<class T> void addunnamed (vector< T > *item, unsigned long &m=*(unsigned long *) 0, unsigned long &strsize=*(unsigned long *) 0)
 TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write vector size in binary i/o. itherwise, assume that is fixed size = m vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence
Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().
More...


template<class T> void addnamed (string const &name, vector< vector< T > > *item, unsigned long &m=*(unsigned long *) 0, unsigned long &n=*(unsigned long *) 0, unsigned long &strsize=*(unsigned long *) 0)
 TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write row number in binary i/o. itherwise, assume that is fixed row number = m. if &n == 0, read/write vector size in binary i/o. otherwise, assume that is fixed size = n vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence
Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().
More...


template<class T> void addunnamed (vector< vector< T > > *item, unsigned long &m=0, unsigned long &n=*(unsigned long *) 0, unsigned long strsize=*(unsigned long *) 0)
 TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write row number in binary i/o. itherwise, assume that is fixed row number = m. if &n == 0, read/write vector size in binary i/o. otherwise, assume that is fixed size = n vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence
Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().
More...


void setvalue (vector< vector< string > > &item)
 set values stored in vector<vector<string> >
See also:
getvalue,operator>>, operator<<, read, write.
More...


vector<vector <string> >& getvalue (bool includecomment=false)
 get values as vector<vector<string> > The global comment is not included in the list!
See also:
setvalue, operator>>, operator<<, read, write.
More...


istream& read (istream &is)
 In testing stage: This is to input cross platoform binary data from istream (for text stream input, use operator>>
See also:
write, reversebyteorder, operator>>, operator<<.
More...


ostream& write (ostream &os)
 In testing stage: This is to output cross platoform binary data to ostream (for text stream output, use operator<<
See also:
read, reversebyteorder, operator>>, operator<<.
More...


virtual void startinblock (unsigned i)
 method for input block preparator. The multi-block input, or table data input requires that extend dataio class and overwrite this so that this routine make block i-th preparation. (in this place, you need to set variables corresponding to i-th block.) See the samptable.cpp Note: The value of i increase in each call of startinblock() If pretend to auto validate the input, overwrite validate
See also:
istable, setted, refered, validate, startoutblock.
More...


virtual void validate (unsigned n)
 The data validator To validate the data, overwrite this Note that, in the multi-block input, or table data, the information as setted, refered, etc, is only for i-th block) - value of i increase in each call of validate - called only once for each value setting - the member that not tried to set value is not validated. is not validated. Will use refered() to check if spcial member is tried to validated - the main class that call operator>> call their validate
See also:
istable, setted, refered, startinbloc.
More...


virtual bool startoutblock (unsigned i)
 For multi-block output or table data output, need to overwrite this routine in way to to perform i-th data setting
See also:
istable, startinblock, validate.
More...


 dataio ()
 default constructor. More...

void clearinputbuffer ()
 clear the memory used by input/output transaction, After this, setted(), refered(), etc, will not work unless new input is performed. More...

void resetflags (bool maprecomendedflagsintomember=true)
 reset all status flags: istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator. Note that the decimal, commentopen, commentclose, and emptyisvalid, are recursivelly applied into the member (dataio class element added in current class).
See also:
add(), clear(), istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator, emptyisvalid, throwexception, errormessageon.
More...


void clear ()
 clear all variables added by add(). The status of istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator. are preserved.
See also:
add(), reset().
More...


void reset ()
 reset status: Clear all variables and reset all status flags.
See also:
add(), resetflags(), clear(), istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator.
More...


virtual ~dataio ()
 default destructor. More...


Public Attributes

unsigned maxcolumnonline
 If number of column exceds this number and linewrap is non empty, the operator>> perform line wrapping. Default is _DATAIODEFAULTMAXCOLUMNONLINE
See also:
_DATAIODEFAULTMAXCOLUMNONLINE, linewrap.
More...


bool istable
 table data flag (if true, data will be table). Default is _DATAIODEFAULTISTABLE Commonsly, the columnoriented is used together
See also:
_DATAIODEFAULTISTABLE, columnoriented.
More...


char sectionnameopen
 section name delimiter (used before section maem) for config file. '\0' is assumed inactive. Default is _DATAIODEFAULTSECTIONNAMEOPEN If both of sectionnameopen and sectionnameclose is disabled (iswhite), config file is assumed that was not section
See also:
_DATAIODEFAULTSECTIONNAMEOPEN, sectionnameclose, disablesection, enablestdsection.
More...


char sectionnameclose
 section name delimiter (used after section name) for config file. Default is _DATAIODEFAULTSECTIONNAMECLOSE If both of sectionnameopen and sectionnameclose is disabled (iswhite), data is assumed that was not section
See also:
_DATAIODEFAULTSECTIONNAMECLOSE, sectionnameopen, enablestdsection, disablesection.
More...


bool columnoriented
 Column oriented data flag. If true, the data is assumed as transpose of normal data. Default is _DATAIODEFAULTCOLUMNORIENTED. commonsly, used together istable
See also:
_DATAIODEFAULTCOLUMNORIENTED, istable.
More...


char columnseparator
 The column separator of data field. Default is _DATAIODEFAULTCOLUMNSEPARATOR
See also:
_DATAIODEFAULTCOLUMNSEPARATOR, lineseparator.
More...


char lineseparator
 Line separator of data. Default is _DATAIODEFAULTLINESEPARATOR
See also:
_DATAIODEFAULTLINESEPARATOR, _DATAIODEFAULTAUTOLINESEPARATOR , columnseparator.
More...


char attribseparator
 config attrib separator for data, if it is non zero, is assumed to use attribseparator to indicate atribution for veriable. Caution: The attribseparator will be used only for - istable and columnoriented is disabled - not subfields (non shifted data field only). The attribseparator and columnseparator will toghether in the data file! os os ognored is istable or columnoriented floag is true. Default is _DATAIODEFAULTATTRIBSEPARATOR
See also:
istable, columnoriented, _DATAIODEFAULTATTRIBSEPARATOR.
More...


bool extendedmode
 if this flag is true, work in extended format support mode that permit input/output the non standard data type for example, section enabled data will contain non composed data default value is _DATAIODEFAULTEXTENDEDMODE
See also:
_DATAIODEFAULTEXTENDEDMODE.
More...


bool clearemptytail
 if this flag is true, delete empty tail of each lines default value is _DATAIODEFAULTCLEAREMPTYTAIL
See also:
_DATAIODEFAULTCLEAREMPTYTAIL.
More...


bool parseallinputstring
 if this flag is true, all item is parsed (using parsestring) in the input stage to solve delimited string problem, independent of the candidate for name or not. default value is _DATAIODEFAULTPARSEALLITEMSTRING. This flag is speciall that applied into all of members, independent of the mapflagstomember, in way to evit the double parsing in the stringtoitem (the default one that use it is the string type)
See also:
_DATAIODEFAULTPARSEALLINPUTSTRING.
More...


char stringdelimiter
 the string delimiter. Default is _DATAIODEFAULTSTRINGDELIMITER
See also:
scapechar, _DATAIODEFAULTSTRINGDELIMITER.
More...


char scapechar
 the scape char (to specify special char) for delimited string Default is _DATAIODEFAULTSCAPECHAR
See also:
stringdelimiter, _DATAIODEFAULTSCAPECHAR.
More...


bool reversebyteorder
 validate unreferenced variable?? if false, ignore validate calling for unreferenced members. if true, call validate for all members default value is _DATAIODEFAULTVALIDATEALL
See also:
validate, istartinblock, _DATAIODEFAULTVALIDATEALL used by binary input/output. If true, reverse byte order for numeric i/o default value is _DATAIODEFAULTREVERSEBYTEORDER , read, write, _DATAIODEFAULTREVERSEBYTEORDER.
More...


friend _dataiorec<T>

Friends

istream& operator>> (istream &is, dataio &data)
 extractor: read data from istream (input from CSV text)
See also:
operator<<, setvalue, getvalue, read, write.
More...


ostream& operator<< (ostream &os, dataio &data)
 insertor for dataio: write data to ostream (output as CSV text)
See also:
operator>>, setvalue, getvalue, read, write.
More...



Detailed Description

dataio main class to perform data input/output features The primitive data that will read/write are: bool, char, wchar_t (wchar_t work? perphaps, no), string, int, long, unsigned, unsigned long, float, double, long double.

See dataformat for detail. The cross platform user require special caution on the system diference of line breaking of text file. See see dataformat for detail

See also:
data format draft 0.1 and note
Examples:

sampattrib.cpp, sampbinrec.cpp, samprec.cpp, sampreclist.cpp, sampsec.cpp, and samptable.cpp.

Definition at line 497 of file dataio.h.


Constructor & Destructor Documentation

dataio::dataio ( ) [inline]
 

default constructor.

Definition at line 1218 of file dataio.h.

dataio::~dataio ( ) [inline, virtual]
 

default destructor.

Definition at line 1253 of file dataio.h.


Member Function Documentation

template<class T>
void dataio::add ( vector< vector< T > > * item ) [inline]
 

2 dimensional add one vector of vector of class without names

Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().

Definition at line 939 of file dataio.h.

template<class T>
void dataio::add ( string const & name,
vector< vector< T > > * item ) [inline]
 

add one vector of vector of class with names

Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().

Definition at line 928 of file dataio.h.

template<class T>
void dataio::add ( vector< T > * item ) [inline]
 

add one vector of class without names

Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().

Definition at line 918 of file dataio.h.

template<class T>
void dataio::add ( string const & name,
vector< T > * item ) [inline]
 

add one vector of class with names

Parameters:
item   is pointer to vector of class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().

Definition at line 908 of file dataio.h.

template<class T>
void dataio::add ( T * item ) [inline]
 

add one item without names

Parameters:
item   is pointer to class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().

Definition at line 896 of file dataio.h.

template<class T>
void dataio::add ( string const & name,
T * item ) [inline]
 

add one variable with names

Parameters:
item   is pointer to class specialized by _dataiorec::stringtoitem() and _dataiorec::itemtostring().

Definition at line 881 of file dataio.h.

void dataio::add ( dataio * item ) [inline]
 

add one data record (or data block) without names

Parameters:
item   is pointer to dataio or derived to dataio (need casting to dataio pointer).

Definition at line 863 of file dataio.h.

void dataio::add ( string const & name,
dataio * item ) [inline]
 

add one data record (or data block) with names

Parameters:
item   is pointer to dataio or derived to dataio (the derived class need casting to dataio pointer).

Examples:
sampattrib.cpp, sampbinrec.cpp, samprec.cpp, sampreclist.cpp, sampsec.cpp, and samptable.cpp.

Definition at line 846 of file dataio.h.

bool dataio::addcomment ( string const & name,
string const & rem )
 

add an comment item to comment list of named item return false if not found

See also:
clearcomment, comment, additemcomment, clearitemcomment, itemcomment.

void dataio::addcomment ( string const & rem ) [inline]
 

add an comment item to comment list

See also:
clearcomment, comment, additemcomment, clearitemcomment, itemcomment.

Examples:
sampattrib.cpp, sampbinrec.cpp, samprec.cpp, sampreclist.cpp, sampsec.cpp, and samptable.cpp.

Definition at line 576 of file dataio.h.

bool dataio::additemcomment ( void * item,
string const & rem )
 

add an comment item to comment list of item

See also:
addcomment, clearcomment, comment, clearitemcomment, itemcomment.

Examples:
sampbinrec.cpp, samprec.cpp, and sampsec.cpp.

template<class T>
void dataio::addnamed ( string const & name,
vector< vector< T > > * item,
unsigned long & m = *(unsigned long *)0,
unsigned long & n = *(unsigned long *)0,
unsigned long & strsize = *(unsigned long *)0 ) [inline]
 

TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write row number in binary i/o. itherwise, assume that is fixed row number = m. if &n == 0, read/write vector size in binary i/o. otherwise, assume that is fixed size = n vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence

Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().

Definition at line 1049 of file dataio.h.

template<class T>
void dataio::addnamed ( string const & name,
vector< T > * item,
unsigned long & m = *(unsigned long *)0,
unsigned long & strsize = *(unsigned long *)0 ) [inline]
 

TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write vector size in binary i/o. itherwise, assume that is fixed size = m vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence

Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().

Definition at line 1003 of file dataio.h.

template<class T>
void dataio::addnamed ( string const & name,
T * item,
unsigned long & strsize = *(unsigned long *)0 ) [inline]
 

TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence

Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().

Definition at line 963 of file dataio.h.

template<class T>
void dataio::addunnamed ( vector< vector< T > > * item,
unsigned long & m = 0,
unsigned long & n = *(unsigned long *)0,
unsigned long strsize = *(unsigned long *)0 ) [inline]
 

TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write row number in binary i/o. itherwise, assume that is fixed row number = m. if &n == 0, read/write vector size in binary i/o. otherwise, assume that is fixed size = n vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence

Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().

Definition at line 1073 of file dataio.h.

template<class T>
void dataio::addunnamed ( vector< T > * item,
unsigned long & m = *(unsigned long *)0,
unsigned long & strsize = *(unsigned long *)0 ) [inline]
 

TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. if &m == 0, read/write vector size in binary i/o. itherwise, assume that is fixed size = m vector. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence

Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().

Definition at line 1026 of file dataio.h.

template<class T>
void dataio::addunnamed ( T * item,
unsigned long & strsize = *(unsigned long *)0 ) [inline]
 

TEST Purpose of addnamed and addunnamed are to perform binary i/o with fixed size vector or string manipulation. It is in testing stage. same as add for text mode. same as add for text mode. strsize is only for binary mode fixed size string input/output if &strsize == 0 use ASC Z string mode. otherwise, use fixed lenght=strsize of char sequence

Parameters:
item   is pointer to class specialized by _dataiorec::readitem() and _dataiorec::writeutem().

Definition at line 982 of file dataio.h.

void dataio::clear ( )
 

clear all variables added by add(). The status of istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator. are preserved.

See also:
add(), reset().

Examples:
sampreclist.cpp, and samptable.cpp.

void dataio::clearcomment ( string const & name,
bool includemember = false )
 

clear comment list of named item

See also:
addcomment, comment, additemcomment, clearitemcomment, itemcomment.

void dataio::clearcomment ( bool includemember = false )
 

clear comment list

See also:
addcomment, clearcomment, additemcomment, clearitemcomment, itemcomment.

Examples:
sampbinrec.cpp, and sampreclist.cpp.

void dataio::clearinputbuffer ( )
 

clear the memory used by input/output transaction, After this, setted(), refered(), etc, will not work unless new input is performed.

void dataio::clearitemcomment ( bool includemember = false )
 

clear comment list of all items

See also:
addcomment, clearcomment, comment, additemcomment, itemcomment.

void dataio::clearitemcomment ( void * item,
bool includemember = false )
 

clear comment list of item

See also:
addcomment, clearcomment, comment, additemcomment, itemcomment.

bool dataio::collectnames ( bool flag,
bool includemember = true )
 

set the flag for the name collector on value setting stage. if true, the all dataio type class that the value is setted, collect the refered names, inclusive the dataio class added to this collect their own refered names. note that the first level (the class that operator>> is called, always collect their names). CAUTION: name of this methods will change!

See also:
refered, _DATAIODEFAULTREFERSUBNAMES.

bool dataio::collectnames ( ) [inline]
 

Definition at line 816 of file dataio.h.

Referenced by add().

vector< string > & dataio::comment ( string const & name )
 

return reference for comment list of named item use carefully

See also:
addcomment, clearcomment, additemcomment, clearitemcomment, itemcomment.

vector< string > & dataio::comment ( ) [inline]
 

return reference for comment list use carefully

See also:
addcomment, clearcomment, additemcomment, clearitemcomment, itemcomment.

Definition at line 583 of file dataio.h.

string & dataio::commentclose ( string const & s ) [inline]
 

< return comment block endding marker Comment block endding marker. End the comment started by commentopen. Default is _DATAIODEFAULTCOMMENTCLOSE

See also:
_DATAIODEFAULTCOMMENTCLOSE, commentopen, commentline.

Definition at line 790 of file dataio.h.

string & dataio::commentclose ( ) [inline]
 

Comment block endding marker. End the comment started by commentopen. Default is _DATAIODEFAULTCOMMENTCLOSE

See also:
_DATAIODEFAULTCOMMENTCLOSE, commentopen, commentline.

Definition at line 785 of file dataio.h.

string & dataio::commentline ( string const & com ) [inline]
 

Definition at line 616 of file dataio.h.

string & dataio::commentline ( ) [inline]
 

One line comment start marker. Ignore at end of current line. Default is _DATAIODEFAULTCOMMENTLINE

See also:
_DATAIODEFAULTCOMMENTLINE, commentopen, commentclose.

Examples:
sampbinrec.cpp, and samprec.cpp.

Definition at line 615 of file dataio.h.

string & dataio::commentopen ( string const & s ) [inline]
 

See also:
_DATAIODEFAULTCOMMENTOPEN, commentclose, commentline.

Definition at line 779 of file dataio.h.

string & dataio::commentopen ( ) [inline]
 

Definition at line 773 of file dataio.h.

char dataio::decimal ( char dec,
bool includemember = true )
 

set decimal character used by floating number. Default is _DATAIODEFAULTDECIMAL

See also:
_DATAIODEFAULTDECIMAL.

char dataio::decimal ( ) [inline]
 

Returns:
decimal character used by floating number.

Examples:
sampreclist.cpp, and samptable.cpp.

Definition at line 739 of file dataio.h.

Referenced by add().

void dataio::disablecommentblock ( ) [inline]
 

disable comment block features (empty commentopen and commentclose).

Definition at line 795 of file dataio.h.

void dataio::disablesection ( ) [inline]
 

disable section (empty sectionnameopen and sectionnameclose) to activate the section, use enablestdsection, or set manually the sectionnameopen and sectionnameclose

See also:
sectionnameopen, sectionnameclose, enablestdsection.

Definition at line 656 of file dataio.h.

bool dataio::emptyisvalid ( bool flag,
bool includemember = true )
 

bool dataio::emptyisvalid ( ) [inline]
 

if this flag is true, consider empty value as valid value inside of several stringtoitem() conversion Default is _DATAIODEFAULTEMPTYISVALID

See also:
_DATAIODEFAULTEMPTYISVALID.

Definition at line 729 of file dataio.h.

Referenced by add().

void dataio::enablestdcommentblock ( ) [inline]
 

enable standard comment block mode for non-standard comment block mode, set manually the commentopen and commentclose.

Definition at line 802 of file dataio.h.

void dataio::enablestdsection ( ) [inline]
 

set as standard section mode (set the sectionnameopen and sectionnameclose) for non-standard section mode, set sectionnameopen and sectionnameclose manually

See also:
sectionnameopen, sectionnameclose, disablestdsection.

Definition at line 663 of file dataio.h.

vector< vector< string > > & dataio::getvalue ( bool includecomment = false )
 

get values as vector<vector<string> > The global comment is not included in the list!

See also:
setvalue, operator>>, operator<<, read, write.

bool dataio::ignorecase ( bool status,
bool includemember = true )
 

Set ignore case flag. Default value of ignore case frag is _DATAIODEFAULTIGNORECASE

See also:
_DATAIODEFAULTIGNORECASE.

bool dataio::ignorecase ( ) [inline]
 

Returns:
ignore case flag.

Examples:
sampbinrec.cpp, samprec.cpp, sampreclist.cpp, sampsec.cpp, and samptable.cpp.

Definition at line 733 of file dataio.h.

Referenced by add().

vector< string > & dataio::itemcomment ( void * item )
 

return reference for comment list of item use carefully

See also:
addcomment, clearcomment, comment, additemcomment, clearitemcomment.

bool dataio::itemrefered ( void * item ) [inline]
 

return true is item is tryed to set in the input stage, during operator>> data processing

See also:
refersubnames referedt.

Definition at line 836 of file dataio.h.

bool dataio::itemsetted ( void * item )
 

Returns:
true if the value of this is correctly setted.

string & dataio::linewrap ( string const & wrap ) [inline]
 

Definition at line 625 of file dataio.h.

string & dataio::linewrap ( ) [inline]
 

This marker is used in the end of line (possible followed by blank space or comment) The next line is appended in the end of line. Caution: it is in sperimental stage and name will change. Default is _DATAIODEFAULTLINEBREAK

See also:
_DATAIODEFAULTLINEBREAK.

Definition at line 624 of file dataio.h.

bool dataio::printerror ( bool dec,
bool includemember = true )
 

bool dataio::printerror ( ) [inline]
 

if this flag is true, coutput error message on error default value is _DATAIODEFAULTPRINTEROR

See also:
throwexception, _DATAIODEFAULTPRINTEROR.

Definition at line 721 of file dataio.h.

istream & dataio::read ( istream & is )
 

In testing stage: This is to input cross platoform binary data from istream (for text stream input, use operator>>

See also:
write, reversebyteorder, operator>>, operator<<.

Examples:
sampbinrec.cpp.

bool dataio::refered ( string const & name ) [inline]
 

return true is name appeared in input data during operator>> data processing

See also:
refersubnames itemrefered.

Examples:
sampbinrec.cpp, samprec.cpp, and sampreclist.cpp.

Definition at line 830 of file dataio.h.

vector< string > & dataio::referednames<string> ( ) [inline]
 

Examples:
sampbinrec.cpp, and samprec.cpp.

Definition at line 839 of file dataio.h.

void dataio::reset ( ) [inline]
 

reset status: Clear all variables and reset all status flags.

See also:
add(), resetflags(), clear(), istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator.

Definition at line 1246 of file dataio.h.

void dataio::resetflags ( bool maprecomendedflagsintomember = true )
 

reset all status flags: istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator. Note that the decimal, commentopen, commentclose, and emptyisvalid, are recursivelly applied into the member (dataio class element added in current class).

See also:
add(), clear(), istable, ignorecase(), commentline, commentopen, commentclose, columnoriented, decimal(), columnseparator, lineseparator, emptyisvalid, throwexception, errormessageon.

bool dataio::setted ( string const & name )
 

Returns:
true if the value of this, is correctly setted.

bool dataio::setted ( ) [inline]
 

Returns:
true if all of value is correctly setted.

Examples:
sampbinrec.cpp, samprec.cpp, sampreclist.cpp, and samptable.cpp.

Definition at line 807 of file dataio.h.

void dataio::setvalue ( vector< vector< string > > & item )
 

set values stored in vector<vector<string> >

See also:
getvalue,operator>>, operator<<, read, write.

void dataio::startinblock ( unsigned i ) [inline, virtual]
 

method for input block preparator. The multi-block input, or table data input requires that extend dataio class and overwrite this so that this routine make block i-th preparation. (in this place, you need to set variables corresponding to i-th block.) See the samptable.cpp Note: The value of i increase in each call of startinblock() If pretend to auto validate the input, overwrite validate

See also:
istable, setted, refered, validate, startoutblock.

Examples:
sampreclist.cpp, and samptable.cpp.

Definition at line 1190 of file dataio.h.

bool dataio::startoutblock ( unsigned i ) [inline, virtual]
 

For multi-block output or table data output, need to overwrite this routine in way to to perform i-th data setting

See also:
istable, startinblock, validate.

Examples:
sampreclist.cpp, and samptable.cpp.

Definition at line 1214 of file dataio.h.

bool dataio::throwexception ( bool dec,
bool includemember = true )
 

bool dataio::throwexception ( ) [inline]
 

if this flag is true, throw exception on error default value is _DATAIODEFAULTTHROWEXCEPTION

See also:
printerrormessage, _DATAIODEFAULTTHROWEXCEPTION.

Definition at line 715 of file dataio.h.

vector< string > & dataio::unreferednames ( )
 

< return (reference of) referenced name list.

void dataio::validate ( unsigned n ) [inline, virtual]
 

The data validator To validate the data, overwrite this Note that, in the multi-block input, or table data, the information as setted, refered, etc, is only for i-th block) - value of i increase in each call of validate - called only once for each value setting - the member that not tried to set value is not validated. is not validated. Will use refered() to check if spcial member is tried to validated - the main class that call operator>> call their validate

See also:
istable, setted, refered, startinbloc.

Examples:
sampreclist.cpp, and samptable.cpp.

Definition at line 1207 of file dataio.h.

bool dataio::validateall ( bool status,
bool includemember = true )
 

set flag to decide if unrefered variables will be validated. Default is _DATAIODEFAULTVALIDATEALL

See also:
validate, _DATAIODEFAULTVALIDATEALL.

bool dataio::validateall ( ) [inline]
 

Returns:
true is all variable is validated.

Definition at line 766 of file dataio.h.

ostream & dataio::write ( ostream & os )
 

In testing stage: This is to output cross platoform binary data to ostream (for text stream output, use operator<<

See also:
read, reversebyteorder, operator>>, operator<<.

Examples:
sampbinrec.cpp.


Friends And Related Function Documentation

ostream & operator<< ( ostream & os,
dataio & data ) [friend]
 

insertor for dataio: write data to ostream (output as CSV text)

See also:
operator>>, setvalue, getvalue, read, write.

istream & operator>> ( istream & is,
dataio & data ) [friend]
 

extractor: read data from istream (input from CSV text)

See also:
operator<<, setvalue, getvalue, read, write.


Member Data Documentation

friend dataio::_dataiorec<T>
 

Definition at line 1260 of file dataio.h.

char dataio::attribseparator
 

config attrib separator for data, if it is non zero, is assumed to use attribseparator to indicate atribution for veriable. Caution: The attribseparator will be used only for - istable and columnoriented is disabled - not subfields (non shifted data field only). The attribseparator and columnseparator will toghether in the data file! os os ognored is istable or columnoriented floag is true. Default is _DATAIODEFAULTATTRIBSEPARATOR

See also:
istable, columnoriented, _DATAIODEFAULTATTRIBSEPARATOR.

Definition at line 692 of file dataio.h.

bool dataio::clearemptytail
 

if this flag is true, delete empty tail of each lines default value is _DATAIODEFAULTCLEAREMPTYTAIL

See also:
_DATAIODEFAULTCLEAREMPTYTAIL.

Definition at line 702 of file dataio.h.

bool dataio::columnoriented
 

Column oriented data flag. If true, the data is assumed as transpose of normal data. Default is _DATAIODEFAULTCOLUMNORIENTED. commonsly, used together istable

See also:
_DATAIODEFAULTCOLUMNORIENTED, istable.

Definition at line 671 of file dataio.h.

char dataio::columnseparator
 

The column separator of data field. Default is _DATAIODEFAULTCOLUMNSEPARATOR

See also:
_DATAIODEFAULTCOLUMNSEPARATOR, lineseparator.

Definition at line 675 of file dataio.h.

bool dataio::extendedmode
 

if this flag is true, work in extended format support mode that permit input/output the non standard data type for example, section enabled data will contain non composed data default value is _DATAIODEFAULTEXTENDEDMODE

See also:
_DATAIODEFAULTEXTENDEDMODE.

Definition at line 698 of file dataio.h.

bool dataio::istable
 

table data flag (if true, data will be table). Default is _DATAIODEFAULTISTABLE Commonsly, the columnoriented is used together

See also:
_DATAIODEFAULTISTABLE, columnoriented.

Definition at line 634 of file dataio.h.

char dataio::lineseparator
 

Line separator of data. Default is _DATAIODEFAULTLINESEPARATOR

See also:
_DATAIODEFAULTLINESEPARATOR, _DATAIODEFAULTAUTOLINESEPARATOR , columnseparator.

Definition at line 679 of file dataio.h.

unsigned dataio::maxcolumnonline
 

If number of column exceds this number and linewrap is non empty, the operator>> perform line wrapping. Default is _DATAIODEFAULTMAXCOLUMNONLINE

See also:
_DATAIODEFAULTMAXCOLUMNONLINE, linewrap.

Definition at line 630 of file dataio.h.

bool dataio::parseallinputstring
 

if this flag is true, all item is parsed (using parsestring) in the input stage to solve delimited string problem, independent of the candidate for name or not. default value is _DATAIODEFAULTPARSEALLITEMSTRING. This flag is speciall that applied into all of members, independent of the mapflagstomember, in way to evit the double parsing in the stringtoitem (the default one that use it is the string type)

See also:
_DATAIODEFAULTPARSEALLINPUTSTRING.

Definition at line 710 of file dataio.h.

bool dataio::reversebyteorder
 

validate unreferenced variable?? if false, ignore validate calling for unreferenced members. if true, call validate for all members default value is _DATAIODEFAULTVALIDATEALL

See also:
validate, istartinblock, _DATAIODEFAULTVALIDATEALL used by binary input/output. If true, reverse byte order for numeric i/o default value is _DATAIODEFAULTREVERSEBYTEORDER , read, write, _DATAIODEFAULTREVERSEBYTEORDER.

Definition at line 764 of file dataio.h.

char dataio::scapechar
 

the scape char (to specify special char) for delimited string Default is _DATAIODEFAULTSCAPECHAR

See also:
stringdelimiter, _DATAIODEFAULTSCAPECHAR.

Definition at line 754 of file dataio.h.

char dataio::sectionnameclose
 

section name delimiter (used after section name) for config file. Default is _DATAIODEFAULTSECTIONNAMECLOSE If both of sectionnameopen and sectionnameclose is disabled (iswhite), data is assumed that was not section

See also:
_DATAIODEFAULTSECTIONNAMECLOSE, sectionnameopen, enablestdsection, disablesection.

Definition at line 651 of file dataio.h.

char dataio::sectionnameopen
 

section name delimiter (used before section maem) for config file. '\0' is assumed inactive. Default is _DATAIODEFAULTSECTIONNAMEOPEN If both of sectionnameopen and sectionnameclose is disabled (iswhite), config file is assumed that was not section

See also:
_DATAIODEFAULTSECTIONNAMEOPEN, sectionnameclose, disablesection, enablestdsection.

Definition at line 643 of file dataio.h.

char dataio::stringdelimiter
 

the string delimiter. Default is _DATAIODEFAULTSTRINGDELIMITER

See also:
scapechar, _DATAIODEFAULTSTRINGDELIMITER.

Definition at line 749 of file dataio.h.


The documentation for this class was generated from the following file:
Generated at Thu Sep 6 13:45:43 2001 for dataio by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001