Changeset 9313 in orxonox.OLD
- Timestamp:
- Jul 18, 2006, 1:43:21 AM (18 years ago)
- Location:
- branches/proxy/src/lib/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/util/substring.cc
r9312 r9313 27 27 28 28 #include "substring.h" 29 #include <cassert>30 31 29 32 30 /** -
branches/proxy/src/lib/util/substring.h
r8408 r9313 2 2 * @file substring.h 3 3 * @brief a small class to get the parts of a string separated by commas 4 * 5 * This class is also identified as a Tokenizer. It splits up one long 6 * String into multiple small ones by a designated Delimiter. 7 * 8 * Substring is Advanced, and it is possible, to split a string by ',' 9 * but also removing leading and trailing spaces around the comma. 10 * 11 * @example 12 * Split the String std::string st = "1345, The new empire , is , orxonox" 13 * is splitted with: 14 * SubString(st, ',', " \n\t") 15 * into 16 * "1345", "The new empire", "is", "orxonox" 17 * As you can see, the useless spaces around ',' were removed. 4 18 */ 5 19 6 #ifndef _ SUBSTRING_H7 #define _ SUBSTRING_H20 #ifndef __SUBSTRING_H__ 21 #define __SUBSTRING_H__ 8 22 9 23 #include <vector> … … 73 87 /** @param i the i'th String @returns the i'th string from the subset of Strings */ 74 88 inline const std::string& getString(unsigned int i) const { return (*this)[i]; }; 89 /** @returns the front of the StringList. */ 90 inline const std::string& front() const { return this->strings.front(); }; 91 /** @returns the back of the StringList. */ 92 inline const std::string& back() const { return this->strings.back(); }; 75 93 76 94 // the almighty algorithm. … … 97 115 }; 98 116 99 #endif /* _ SUBSTRING_H*/117 #endif /* __SUBSTRING_H__ */
Note: See TracChangeset
for help on using the changeset viewer.