Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 5, 2008, 1:33:08 AM (16 years ago)
Author:
landauf
Message:

and here comes the extended SubString class (added parenthesis support), I had problems with svn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/util/SubString.h

    r836 r849  
    2323 *   Co-authors:
    2424 *      Benjamin Grauer
     25 *      Fabian 'x3n' Landau
    2526 *
    26 //
     27
    2728//  splitLine
    2829//  STL string tokenizer
     
    3132//  Version 1.0
    3233//  Copyright (c) 2005 Clemens Wacha. All rights reserved.
    33 //
     34
     35 * Extended by Fabian 'x3n' Landau with the SL_PARENTHESES mode.
    3436 */
    3537
     
    7678    SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
    7779    SL_COMMENT,           //!< In Comment mode.
     80    SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
     81    SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
    7882  } SPLIT_LINE_STATE;
    7983
     
    8488  SubString(const std::string& string,
    8589            const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
    86             char escapeChar ='\\', char safemode_char = '"', char comment_char = '\0');
     90            char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
    8791  SubString(unsigned int argc, const char** argv);
    8892  /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
     
    107111  unsigned int split(const std::string& string,
    108112                     const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
    109                      char escapeChar ='\\', char safemode_char = '"', char comment_char = '\0');
     113                     char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
    110114  std::string join(const std::string& delimiter = " ") const;
    111115  ////////////////////////////////////////
     
    139143                                    char escape_char = '\\',
    140144                                    char safemode_char = '"',
     145                                    char openparenthesis_char = '(',
     146                                    char closeparenthesis_char = ')',
    141147                                    char comment_char = '\0',
    142148                                    SPLIT_LINE_STATE start_state = SL_NORMAL);
Note: See TracChangeset for help on using the changeset viewer.