IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Lib::Parser Class Reference

List of all members.

Static Public Member Functions

static int SkipSeparator (string str, int startpos, char separator)
static int SkipSpaces (string str, int startpos)
 Returns index of the first non-whitespace character in str from the specified position pos (counted from 0).
static int ReadInteger (ref int number, string str, int startpos)
 Reads an integer from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read integer (or -1 if reading failed) and outputs the read number.
static int ReadInteger (ref int number, string str, int startpos, bool skipspaces)
 Reads an integer from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read integer (or -1 if reading failed) and outputs the read number.
static int ReadInteger (ref long number, string str, int startpos, bool skipspaces)
 Reads an integer from a string, starting at a specified position. Returns the position of the first character after the read number (or -1 if reading failed) and outputs the read number.
static int ReadNumber (ref double number, string str, int startpos)
 Reads a number from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read number (or -1 if reading failed) and outputs the read number.
static int ReadNumber (ref double number, string str, int startpos, bool skipspaces)
 Reads a number from a string, starting at a specified position. Returns the position of the first character after the read number (or -1 if reading failed) and outputs the read number.
static int SkipInteger (string str, int beginpos, bool skipspaces, bool failiffloatingpoint)
 Returns index of the first character in str after the representation of an integer number.
static int SkipInteger (string str, int beginpos, bool skipspaces)
 Returns index of the first character in str after the representation of an integer number. Leading whitespace characters are ignored, i.e. number is looked for after all space characters.
static int SkipInteger (string str, int beginpos)
 Returns index of the first character in str after the representation of an integer number. Leading whitespace characters are ignored, i.e. number is looked for after all space characters.
static int SkipNumber (string str, int beginpos, bool skipspaces)
 Returns index of the first character in str after the representation of a number (either floating point or integer).
static int SkipNumber (string str, int beginpos)
 Returns index of the first character in str after the representation of a number (either floating point or integer).
static int SkipToCharacter (string str, int beginpos, char target)
static int ReadDoubleList (ref List< double > tab, string str, int startpos, char open, char close, char separator, bool skipspaces)
 Reads a list of numbers of type double from result stirng startng at specified position, and returns position after the list. Numbers must be separated by a specified separator (with spaces allowed between them) and embedded within specified brackets.
static int ReadDoubleList (ref List< List< double >> tab, string str, int startpos, char open, char close, char separator, bool skipspaces)
 Reads a list of lists of numbers of type double from result stirng startng at specified position, and returns position after the list. Numbers and sub-lists must be separated by a specified separator (with spaces allowed between them) and embedded within specified brackets.
static string ListToString (List< double > l)
static string ListToString (List< List< double >> l)
static void Examples ()

Private Member Functions

int SkipToBracketLevel (string str, int beginpos, char open, char close, int targetlevel)
 Returns position of the first character that has the specified nesting messagelevel with respect to open and close brackets and the current messagelevel. Nesting messagelevel begins with 0 and is increased with every open bracked and decreased with any closed bracket.

Static Private Member Functions

static int ReadInteger (ref long number, string str, int startpos)
 Reads an integer from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read integer (or -1 if reading failed) and outputs the read number.

Static Private Attributes

static int RetFailed = -1

Member Function Documentation

static int IG::Lib::Parser::SkipSeparator ( string  str,
int  startpos,
char  separator 
) [inline, static]
static int IG::Lib::Parser::SkipSpaces ( string  str,
int  startpos 
) [inline, static]

Returns index of the first non-whitespace character in str from the specified position pos (counted from 0).

Parameters:
strString that is parsed.
startposPosition where search begins (counted from 0).
Returns:
Index of the character that stops the search. If string is null or empty or searchstarted after the last character, -1 is returned.
static int IG::Lib::Parser::ReadInteger ( ref int  number,
string  str,
int  startpos 
) [inline, static]

Reads an integer from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read integer (or -1 if reading failed) and outputs the read number.

Parameters:
numberOutput parameter returning the number that was read.
strString from which the number is read.
startposStarting position from which the number is searched for.
Returns:
static int IG::Lib::Parser::ReadInteger ( ref int  number,
string  str,
int  startpos,
bool  skipspaces 
) [inline, static]

Reads an integer from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read integer (or -1 if reading failed) and outputs the read number.

Parameters:
numberOutput parameter returning the number that was read.
strString from which the number is read.
startposStarting position from which the number is searched for.
Returns:
static int IG::Lib::Parser::ReadInteger ( ref long  number,
string  str,
int  startpos 
) [inline, static, private]

Reads an integer from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read integer (or -1 if reading failed) and outputs the read number.

Parameters:
numberOutput parameter returning the number that was read.
strString from which the number is read.
startposStarting position from which the number is searched for.
Returns:
static int IG::Lib::Parser::ReadInteger ( ref long  number,
string  str,
int  startpos,
bool  skipspaces 
) [inline, static]

Reads an integer from a string, starting at a specified position. Returns the position of the first character after the read number (or -1 if reading failed) and outputs the read number.

Parameters:
numberOutput parameter returning the number that was read.
strString from which the number is read.
startposStarting position from which number is searched for.
skipspacesIf true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position.
Returns:
static int IG::Lib::Parser::ReadNumber ( ref double  number,
string  str,
int  startpos 
) [inline, static]

Reads a number from a string, starting at a specified position and skipping eventual leading spaces. Returns the position of the first character after the read number (or -1 if reading failed) and outputs the read number.

Parameters:
numberOutput parameter returning the number that was read.
strString from which the number is read.
startposStarting position from which the number is searched for.
Returns:
static int IG::Lib::Parser::ReadNumber ( ref double  number,
string  str,
int  startpos,
bool  skipspaces 
) [inline, static]

Reads a number from a string, starting at a specified position. Returns the position of the first character after the read number (or -1 if reading failed) and outputs the read number.

Parameters:
numberOutput parameter returning the number that was read.
strString from which the number is read.
startposStarting position from which number is searched for.
skipspacesIf true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position.
Returns:
static int IG::Lib::Parser::SkipInteger ( string  str,
int  beginpos,
bool  skipspaces,
bool  failiffloatingpoint 
) [inline, static]

Returns index of the first character in str after the representation of an integer number.

Parameters:
strString that is parsed.
startposPosition where search begins (counted from 0).
skipspacesIndicates whether to skip the eventual leading whitespaces.
failiffloatingpointIf true then method fails if there is a floating point number representation. If false then the position of the decimal point is returned.
Returns:
Index of the first character in string after the integer number representation (count form 0). -1 is returned if string is empty, if initial position is out of range or if there is no integer number representation at the beginning of the string. if failiffloatingpoint is true then -1 is returned also if there is a floating point number representation.
static int IG::Lib::Parser::SkipInteger ( string  str,
int  beginpos,
bool  skipspaces 
) [inline, static]

Returns index of the first character in str after the representation of an integer number. Leading whitespace characters are ignored, i.e. number is looked for after all space characters.

Parameters:
strString that is parsed.
startposPosition where search begins (counted from 0).
skipspacesIndicates whether to skip leading spaces.
Returns:
Index of the first character in string after the integer number representation (count form 0). -1 is returned if string is empty, if initial position is out of range or if there is no number representation at the beginning of the string, or if there is a floating point number representation.
static int IG::Lib::Parser::SkipInteger ( string  str,
int  beginpos 
) [inline, static]

Returns index of the first character in str after the representation of an integer number. Leading whitespace characters are ignored, i.e. number is looked for after all space characters.

Parameters:
strString that is parsed.
startposPosition where search begins.
skipspacesIndicates whether to skip leading spaces.
Returns:
Index of the first character in string after the integer number representation (count form 0). -1 is returned if string is empty, if initial position is out of range or if there is no number representation at the beginning of the string, or if there is a floating point number representation.
static int IG::Lib::Parser::SkipNumber ( string  str,
int  beginpos,
bool  skipspaces 
) [inline, static]

Returns index of the first character in str after the representation of a number (either floating point or integer).

Parameters:
strString that is parsed.
startposPosition where search begins (counted from 0).
skipspacesIndicates whether to skip the eventual leading whitespaces.
Returns:
Index of the first character in string after the number representation (count form 0). -1 is returned if string is empty, if initial position is out of range or if there is no number representation at the beginning of the string.
static int IG::Lib::Parser::SkipNumber ( string  str,
int  beginpos 
) [inline, static]

Returns index of the first character in str after the representation of a number (either floating point or integer).

Parameters:
strString that is parsed.
startposPosition where search begins (counted from 0).
Returns:
Index of the first character in string after the number representation (count form 0). -1 is returned if string is empty, if initial position is out of range or if there is no number representation at the beginning of the string (after leading spaces).
static int IG::Lib::Parser::SkipToCharacter ( string  str,
int  beginpos,
char  target 
) [inline, static]
static int IG::Lib::Parser::ReadDoubleList ( ref List< double >  tab,
string  str,
int  startpos,
char  open,
char  close,
char  separator,
bool  skipspaces 
) [inline, static]

Reads a list of numbers of type double from result stirng startng at specified position, and returns position after the list. Numbers must be separated by a specified separator (with spaces allowed between them) and embedded within specified brackets.

Parameters:
tabOutput parameter where read-in list is written.
strString from which the list is read.
startposStarting positio nwhere reading begins.
openOpening bracket of the list.
closeClosing bracket of the list.
separatorSeparator that separates the numbers.
skipspacesIf true then leading spaces are skipped first, otherwise starting position must be exactly at the opening bracket of the list.
Returns:
Returns position of the first character after the list.
static int IG::Lib::Parser::ReadDoubleList ( ref List< List< double >>  tab,
string  str,
int  startpos,
char  open,
char  close,
char  separator,
bool  skipspaces 
) [inline, static]

Reads a list of lists of numbers of type double from result stirng startng at specified position, and returns position after the list. Numbers and sub-lists must be separated by a specified separator (with spaces allowed between them) and embedded within specified brackets.

Parameters:
tabOutput parameter where read-in list is written.
strString from which the list is read.
startposStarting positio nwhere reading begins.
openOpening bracket of the list and sub-lists.
closeClosing bracket of the list and sub-lists.
separatorSeparator that separates the numbers and sub-lists.
skipspacesIf true then leading spaces are skipped first, otherwise starting position must be exactly at the opening bracket of the list.
Returns:
Returns position of the first character after the list.
int IG::Lib::Parser::SkipToBracketLevel ( string  str,
int  beginpos,
char  open,
char  close,
int  targetlevel 
) [inline, private]

Returns position of the first character that has the specified nesting messagelevel with respect to open and close brackets and the current messagelevel. Nesting messagelevel begins with 0 and is increased with every open bracked and decreased with any closed bracket.

Parameters:
strString that is parsed.
startposPosition where search begins (counted from 0).
openThe opening bracket.
closeThe closing bracket.
targetlevelLevel that must be reached. Can be either a positive or negative integer. If messagelevel is 0 then initial position is returned.
Returns:
Positon of the first character from startpos (inclusively) with a given nesting messagelevel. Returns -1 if such character can not be found, if string is null or empty or if initial position is out of range.
static string IG::Lib::Parser::ListToString ( List< double >  l) [inline, static]
static string IG::Lib::Parser::ListToString ( List< List< double >>  l) [inline, static]
static void IG::Lib::Parser::Examples ( ) [inline, static]

Member Data Documentation

int IG::Lib::Parser::RetFailed = -1 [static, private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events