Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2008, 3:42:49 AM (16 years ago)
Author:
landauf
Message:

merged core2 back to trunk
there might be some errors, wasn't able to test it yet due to some strange g++ and linker behaviour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/util/SubString.h

    r871 r1052  
    8888  SubString(const std::string& string,
    8989            const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
    90             char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
     90            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
     91            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
    9192  SubString(unsigned int argc, const char** argv);
    9293  /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
     
    111112  unsigned int split(const std::string& string,
    112113                     const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
    113                      char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
     114                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
     115                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
    114116  std::string join(const std::string& delimiter = " ") const;
    115117  ////////////////////////////////////////
     
    120122
    121123  // retrieve Information from within
    122   /** @returns true if the SubString is empty */
     124  /** @brief Returns true if the SubString is empty */
    123125  inline bool empty() const { return this->strings.empty(); };
    124   /** @returns the count of Strings stored in this substring */
     126  /** @brief Returns the count of Strings stored in this substring */
    125127  inline unsigned int size() const { return this->strings.size(); };
    126   /** @param i the i'th String @returns the i'th string from the subset of Strings */
     128  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
    127129  inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
    128   /** @param i the i'th String @returns the i'th string from the subset of Strings */
     130  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
    129131  inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
    130   /** @returns the front of the StringList. */
     132  /** @brief Returns true if the token is in safemode. @param i the i'th token */
     133  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
     134  /** @brief Returns the front of the StringList. */
    131135  inline const std::string& front() const { return this->strings.front(); };
    132   /** @returns the back of the StringList. */
     136  /** @brief Returns the back of the StringList. */
    133137  inline const std::string& back() const { return this->strings.back(); };
    134138  /** @brief removes the back of the strings list. */
    135   inline void pop_back() { this->strings.pop_back(); };
     139  inline void pop_back() { this->strings.pop_back(); this->bInSafemode.pop_back(); };
    136140
    137141  // the almighty algorithm.
    138142  static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
     143                                    std::vector<bool>& bInSafemode,
    139144                                    const std::string& line,
    140145                                    const std::string& delimiters = SubString::WhiteSpaces,
     
    142147                                    bool emptyEntries = false,
    143148                                    char escape_char = '\\',
     149                                    bool removeExcapeChar = true,
    144150                                    char safemode_char = '"',
     151                                    bool removeSafemodeChar = true,
    145152                                    char openparenthesis_char = '(',
    146153                                    char closeparenthesis_char = ')',
     154                                    bool removeParenthesisChars = true,
    147155                                    char comment_char = '\0',
    148156                                    SPLIT_LINE_STATE start_state = SL_NORMAL);
     
    157165private:
    158166  std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
     167  std::vector<bool>         bInSafemode;
    159168};
    160169
Note: See TracChangeset for help on using the changeset viewer.