Changeset 7320 in orxonox.OLD for trunk/src/lib/util/substring.h
- Timestamp:
- Apr 17, 2006, 1:12:25 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/substring.h
r7319 r7320 48 48 unsigned int split(const std::string& string, bool whiteSpaces); 49 49 unsigned int split(const std::string& string, const std::string& splitters, char escapeChar ='\\', char safemode_char = '"', char comment_char = '\0'); 50 std::string join(const std::string& delimiter ) const;50 std::string join(const std::string& delimiter = " ") const; 51 51 //////////////////////////////////////// 52 52 … … 57 57 // retrieve Information from within 58 58 inline unsigned int size() const { return this->strings.size(); }; 59 const std::string& getString(unsigned int i) const { return (i < this->strings.size()) ? this->strings[i] : emptyString; } 60 ; // safety-precaution 59 const std::string& getString(unsigned int i) const { return (i < this->strings.size()) ? this->strings[i] : emptyString; }; 61 60 const std::string& operator[](unsigned int i) const { return this->getString(i); }; 62 unsigned int getOffset(unsigned int i) const;63 61 64 62 // the almighty algorithm. 65 static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,std::vector<unsigned int>& offsets, 66 const std::string& line, const std::string& delimiters = " \t\r\n", 67 char escape_char = '\\', char safemode_char = '"', char comment_char = '\0', 63 static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret, 64 const std::string& line, 65 const std::string& delimiters = " \t\r\n", 66 char escape_char = '\\', 67 char safemode_char = '"', 68 char comment_char = '\0', 68 69 SPLIT_LINE_STATE start_state = SL_NORMAL); 69 70 // debugging. … … 72 73 private: 73 74 std::vector<std::string> strings; //!< strings produced from a single string splitted in multiple strings 74 std::vector<unsigned int> offsets; //!< offsets of the beginning of the input-string to the beginning of each substring.75 75 76 76 static const std::string emptyString;
Note: See TracChangeset
for help on using the changeset viewer.