Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 1 and Version 2 of code/doc/SubString


Ignore:
Timestamp:
Sep 24, 2008, 7:13:15 PM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/SubString

    v1 v2  
    22[[TracNav(TracNav/TOC_Development)]]
    33
    4 SubString splits a string up into several tokens. You can define the separator and chars for opening and closing paranthesis (usually '(' and ')') and quotes (usually '"'). Tokens between paranthesis or quotes wont be separated. It also takes care of an escape symbol (mostly '\') to escape special symbols and a comment symbol (usually '\0' for no comment) to end the string. There are more options to strip those symbols or to keep them (added to a token).
     4!SubString splits a string up into several tokens. You can define the separator and chars for opening and closing paranthesis (usually '(' and ')') and quotes (usually '"'). Tokens between paranthesis or quotes wont be separated. It also takes care of an escape symbol (mostly '\') to escape special symbols and a comment symbol (usually '\0' for no comment) to end the string. There are more options to strip those symbols or to keep them (added to a token).
    55
    66== Create a SubString ==
    77
    8 Creating a new SubString with all possible options:
     8Creating a new !SubString with all possible options:
    99{{{
    1010SubString(const std::string& string,
     
    2222}}}
    2323
    24 Although SubString is very open for arbitrary control symbols, you will most often use one of the following configurations:
    25  * '''SubString(string, ' ', SubString::WhiteSpaces)''': Splits a string into words. Words between "" or () will be one token, but "" and () will be removed.[[br]]
     24Although !SubString is very open for arbitrary control symbols, you will most often use one of the following configurations:
     25 * '''!SubString(string, ' ', SubString::WhiteSpaces)''': Splits a string into words. Words between "" or () will be one token, but "" and () will be removed.[[br]]
    2626  * Example:
    2727   * String: Hello, this is "a test" (but don't tell anyone)
    2828   * Tokens: Hello, | this | is | a test | but don't tell anyone
    2929
    30  * '''SubString(string, ' ', "", true, '\\', false, '"', false, '(', ')', false)''': Splits a string into words. Words between "" or () will be one token. Escape chars, "", () and whitespaces wont be removed.
     30 * '''!SubString(string, ' ', "", true, '\\', false, '"', false, '(', ')', false)''': Splits a string into words. Words between "" or () will be one token. Escape chars, "", () and whitespaces wont be removed.
    3131  * Example:
    3232   * String: Hello, this is "a test" (but don't tell anyone)
    3333   * Tokens: Hello, | this | is | "a test" | (but don't tell anyone)
    3434
    35  * '''SubString(string, ',' " \t\n()", true, '\', true, '"', true, '\0', '\0')''': Splits tokens separated by a comma. Tokens between "" wont be separated but ( and ) have no effect.
     35 * '''!SubString(string, ',' " \t\n()", true, '\', true, '"', true, '\0', '\0')''': Splits tokens separated by a comma. Tokens between "" wont be separated but ( and ) have no effect.
    3636  * Example:
    3737   * String: (10, 20, 30)
     
    4141 * '''size()''': Returns the number of tokens.
    4242 * '''getString('''''index''''')''' or '''operator['''''index''''']''': Returns the token at position ''index''.
    43  * '''subSet('''''begin''''', '''''end''''')''': Returns a new SubString, containing tokens from begin to end-1.
     43 * '''subSet('''''begin''''', '''''end''''')''': Returns a new !SubString, containing tokens from begin to end-1.
    4444 * '''join('''''char''''')''': Joins the tokens together to one string. Separates the tokens by ''char''.