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

stringutil.h File Reference

#include <string>
#include <iostream>
#include <vector>

Go to the source code of this file.

Defines

#define _STRINGUTILDEFAULTPRINTERROR   true
 default values for stringutilprinterror
See also:
stringutilprinterror.
More...


#define _STRINGUTILDEFAULTTHROWEXCEPTION   false
 defaultvalues for stringutilthrowexception
See also:
stringutilthrowexception.
More...


#define _STRINGUTILSTRDELIMITER   '\"'
 default string delimiter char specification. More...

#define _STRINGUTILSCAPECHAR   '\\'
 default scape char specification. More...

#define _STRINGUTILCOMMENTCHAR   '#'
 default comment char specification. More...

#define _STRINGUTILCOLUMNSEPARATOR   '\t'
 default column separator. More...

#define _STRINGUTILCNTRLMARK   '^'
 specificator for cntrl char. More...

#define _STRINGUTILHEXAMARK   'X'
 specificator for hexadecimal. More...

#define _STRINGUTILCHARTABLE
 the spceial characters specification table. More...


Functions

bool stringutilprinterror ()
 print error message default value is _STRINGUTILDEFAULTPRINTERROR;
See also:
stringutilthrowexception, _STRINGUTILDEFAULTPRINTERROR.
More...


bool stringutilprinterror (bool status)
bool stringutilthrowexception ()
 throw exception default value is _STRINGUTILDEFAULTTHROWEXCEPTION
See also:
stringutilprinterror, _STRINGUTILDEFAULTPRINTERROR.
More...


bool stringutilthrowexception (bool status)
bool isextended (char c)
bool iswhite (char c)
 white char detection, used by string util and dataio. More...

char tocntrl (char c)
unsigned stringcasefind (string const &s1, string const &s2, unsigned pos=0)
 case insensive version of string::find(). More...

unsigned stringcasefind_last_of (string const &s1, string const &s2, unsigned pos=0)
 case insensive version of string::find_last_of() does not used by dataio. More...

string& parsestring (string &s, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR)
 clear extra spaces and parse delimited string of s the sequence of iswhite() is replaced by single space, except inside of delimited string (inside delimiters, the sequence of two delimiters is assumed one delimiters). More...

vector<string>& parsestring (vector< string > &strlist, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR)
 for each element of list, clear extra spaces and parse delimited string. More...

string& reverseparsestring (string &s, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR)
 translate s to delimited string (is delimiter is found, substitute by double of one). More...

vector<string>& reverseparsestring (vector< string > &strlist, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR)
 for each element of list, convert to delimited string. More...

unsigned findstringdelimiterclose (string const &s, unsigned pos=0, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR)
 return the position of string delimiter to close, started in the position pos. case delimiter='\0', force that delimiter is s[pos] otherwise: if s[pos] is not delimiter, assume that first delimiter is to open, and start closer findding. return ~0U if not found. return s.size() if delimiter do not occur in the s (starting the pos) CAUTION: This routine will change in future in way to support C/C++ like cher specification. More...

bool stringdelimiterbalanced (string const &s, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR, unsigned pos1=0, unsigned pos2=(~0U))
 return true, if string delimiter is closed correctly between [pos1, pos2). More...

bool needdelimiter (string const &s, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR)
 return true, if string delimiters is required if contain two adjacent iswhite() or string delimiters. More...

istream& gettextline (istream &f, string &line, char comment=_STRINGUTILCOMMENTCHAR, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR, char newlinedelimiter='\0')
 getline() that can read text file of ansi, DOS, windows (newline == '\r
'), UNIX (newline=='n') and VAX/VMS (newline=='r') withouth specification. if (newline == '\0'), auto detect new line format. otherwise, work as getline() Unless (newline == EOF), assume end of file if EOF character is found or fisical eof occur It is necessary, because some text editor write EOF character at end of file If (newline == EOF), read EOF char into memory, if found.
More...


istream& getline (istream &f, vector< string > &dataline, char separator=_STRINGUTILCOLUMNSEPARATOR, char comment=_STRINGUTILCOMMENTCHAR, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR, char newline='\0')
 vectorized getline get vector <string> (one line separated as colmns) from istream does not used by dataio newline=='\0' is autodetect mode. More...

istream& getlines (istream &f, vector< vector< string > > &datalist, char separator=_STRINGUTILCOLUMNSEPARATOR, char comment=_STRINGUTILCOMMENTCHAR, char strdelimiter=_STRINGUTILSTRDELIMITER, char scapechar=_STRINGUTILSCAPECHAR, char newline='\0')
 vectorized getlines newline=='\0' is auto detect mode. More...

ostream& putline (ostream &f, vector< string > &dataline, char separator=_STRINGUTILCOLUMNSEPARATOR, char newline='\0')
 put the vector<string> to ostream dataio use it, only if _DATAIODEBUG_ is defined newline=='\0' is system newline. More...

ostream& putlines (ostream &f, vector< vector< string > > &datalist, char separator=_STRINGUTILCOLUMNSEPARATOR, char newline='\0')
 vectorized putlines newline=='\0' is system new lines. More...

vector<vector <string> >& transpose (vector< vector< string > > &data)
 transpose the vector<vector <string> > data array (replace row and column). More...


Generated at Thu Sep 6 13:45:41 2001 for dataio by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001