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

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
IG.Lib.Parser Class Reference

## 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). More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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). More...
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). More...
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. More...
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. More...
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. More...

## 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. More...

## 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

  str | String that is parsed.
  startpos | Position 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.

Referenced by IG.Num.Scalar.Parse(), IG.Num.Counter.Parse(), IG.Num.Scalar.TryParse(), and IG.Num.Counter.TryParse().

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

  number | Output parameter returning the number that was read.
  str | String from which the number is read.
  startpos | Starting position from which the number is searched for.

Returns

Referenced by IG.Num.Counter.Read().

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

  number | Output parameter returning the number that was read.
  str | String from which the number is read.
  startpos | Starting 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

  number | Output parameter returning the number that was read.
  str | String from which the number is read.
  startpos | Starting 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

  number | Output parameter returning the number that was read.
  str | String from which the number is read.
  startpos | Starting position from which number is searched for.
  skipspaces | If 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

  number | Output parameter returning the number that was read.
  str | String from which the number is read.
  startpos | Starting position from which the number is searched for.

Returns

Referenced by IG.Num.Scalar.Read().

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

  number | Output parameter returning the number that was read.
  str | String from which the number is read.
  startpos | Starting position from which number is searched for.
  skipspaces | If 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

  str | String that is parsed.
  startpos | Position where search begins (counted from 0).
  skipspaces | Indicates whether to skip the eventual leading whitespaces.
  failiffloatingpoint | If 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

  str | String that is parsed.
  startpos | Position where search begins (counted from 0).
  skipspaces | Indicates 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

  str | String that is parsed.
  startpos | Position where search begins.
  skipspaces | Indicates 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

  str | String that is parsed.
  startpos | Position where search begins (counted from 0).
  skipspaces | Indicates 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

  str | String that is parsed.
  startpos | Position 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

  tab | Output parameter where read-in list is written.
  str | String from which the list is read.
  startpos | Starting positio nwhere reading begins.
  open | Opening bracket of the list.
  close | Closing bracket of the list.
  separator | Separator that separates the numbers.
  skipspaces | If 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

  tab | Output parameter where read-in list is written.
  str | String from which the list is read.
  startpos | Starting positio nwhere reading begins.
  open | Opening bracket of the list and sub-lists.
  close | Closing bracket of the list and sub-lists.
  separator | Separator that separates the numbers and sub-lists.
  skipspaces | If 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

  str | String that is parsed.
  startpos | Position where search begins (counted from 0).
  open | The opening bracket.
  close | The closing bracket.
  targetlevel | Level 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:

- igbase/data/StringParser0.cs