Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 3 and Version 4 of code/doc/String


Ignore:
Timestamp:
Sep 24, 2008, 6:08:32 PM (12 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/String

    v3 v4  
    1717 * '''getNextQuote('''''string''''', '''''start''''')''': Returns the position of the next quote in the string, starting with start.
    1818  * Examples:
    19    * getNextQuote("123\"567\"9", 0) = 4
    20    * getNextQuote("123\"567\"9", 4) = 4
    21    * getNextQuote("123\"567\"9", 6) = 8
    22    * getNextQuote("123\"567\"9", 9) = std::npos
     19   * getNextQuote("012\"456\"89", 0) = 3
     20   * getNextQuote("012\"456\"89", 3) = 3
     21   * getNextQuote("012\"456\"89", 5) = 7
     22   * getNextQuote("012\"456\"89", 8) = std::string::npos
    2323 * '''isBetweenQuotes('''''string''''', '''''position''''')''': Returns true if ''position'' is between two quotes.
    2424  * Examples:
    25    * isBetweenQuotes("123\"567\"9", 1) = false
    26    * isBetweenQuotes("123\"567\"9", 4) = false
    27    * isBetweenQuotes("123\"567\"9", 5) = true
    28    * isBetweenQuotes("123\"567\"9", 8'''''''''') = false
    29    * isBetweenQuotes("123\"567\"9", 9) = false
     25   * isBetweenQuotes("012\"456\"89", 0) = false
     26   * isBetweenQuotes("012\"456\"89", 3) = false
     27   * isBetweenQuotes("012\"456\"89", 4) = true
     28   * isBetweenQuotes("012\"456\"89", 7) = false
     29   * isBetweenQuotes("012\"456\"89", 8'''''''''') = false
    3030
    3131 * '''hasStringBetweenQuotes('''''string''''')''': Returns true if the string contains something like '..."between quotes"...'.
     
    5050   * stripEnclosingBraces("{ test }") = " test "
    5151
    52  * '''isEmpty('''''string''''')''':
    53  * '''isComment('''''string''''')''':
    54  * '''isNumeric('''''string''''')''':
     52 * '''isEmpty('''''string''''')''': Determines if a string is empty (contains only whitespaces (' ', \t, \n).
     53 * '''isComment('''''string''''')''':  Determines if a string is a comment (starts with a comment-symbol). A comment is defined by a leading '#', '%', ';' or '//'.
     54  * Examples:
     55   * isComment("# test") = true
     56   * isComment("a # test") = false
     57   * isComment(" # test") = true
     58 * '''isNumeric('''''string''''')''': Determines if a string contains only numbers and maximal one '.'.
    5559
    56  * '''addSlashes('''''string''''')''':
    57  * '''removeSlashes('''''string''''')''':
     60 * '''addSlashes('''''string''''')''': Adds backslashes to the given string which makes special chars visible. Existing slashes will be doubled.
     61  * Examples: "\\" -> "\\\\", "\n" -> "\\n"
     62 * '''removeSlashes('''''string''''')''': Removes backslashes from the given string. Double backslashes are interpreted as one backslash.
     63  * Examples: "\\\\" -> "\\", "\\n" -> "\n"
    5864
    59  * '''lowercase('''''string* pointer''''')''':
    60  * '''getLowercase('''''string''''')''':
     65 * '''lowercase('''''string* pointer''''')''': Replaces each char between A and Z with its lowercase equivalent. Uses '''tolower''' (C function).
     66 * '''getLowercase('''''string''''')''': Returns a copy of the given string without uppercase chars.
    6167
    62  * '''uppercase('''''string* pointer''''')''':
    63  * '''getUppercase('''''string''''')''':
     68 * '''uppercase('''''string* pointer''''')''': Replaces each char between a and z with its uppercase equivalent. Uses '''toupper''' (C function).
     69 * '''getUppercase('''''string''''')''': Returns a copy of the given string without lowercase chars.
    6470
    65  * '''nocaseCmp('''''string1''''', '''''string2''''')''':
    66  * '''nocaseCmp('''''string1''''', '''''string2''''', '''''length''''')''':
     71 * '''nocaseCmp('''''string1''''', '''''string2''''')''': Compares two strings ignoring different casing.
     72 * '''nocaseCmp('''''string1''''', '''''string2''''', '''''length''''')''': Compares the first 'len' chars of two strings ignoring different casing.
    6773
    68  * '''hasComment('''''string''''')''':
    69  * '''getComment('''''string''''')''':
    70  * '''getCommentPosition('''''string''''')''':
    71  * '''getNextCommentPosition('''''string''''', '''''start''''')''':
     74 * '''hasComment('''''string''''')''': Returns true if the string contains a comment, introduced by #, %, ; or //.
     75  * Examples:
     76   * hasComment("test") = false
     77   * hasComment("# test") = true
     78   * hasComment(" # test") = true
     79   * hasComment("a # test") = true
     80 * '''getComment('''''string''''')''': If the string contains a comment, the comment gets returned (including the comment
     81  *  Example: getComment("abc # test") = "# test"
     82symbol), an empty string otherwise.
     83 * '''getCommentPosition('''''string''''')''': If the string contains a comment, the position of the comment-symbol gets returned, std::string::npos otherwise.
     84  *  Examples:
     85   * getCommentPosition("# test") = 0
     86   * getCommentPosition("abc # test") = 4
     87   * getCommentPosition("abc  test") = std::string::npos
     88 * '''getNextCommentPosition('''''string''''', '''''start''''')''': Returns the position of the next comment-symbol, starting with start.
     89  * Examples:
     90   * getCommentPosition("abc # test", 0) = 4
     91   * getCommentPosition("abc # test", 4) = 4
     92   * getCommentPosition("abc # test", 5) = std::string::npos
     93