Changeset 7212 in orxonox.OLD for branches/std/src/lib/util/substring.cc
- Timestamp:
- Mar 10, 2006, 5:28:52 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/util/substring.cc
r7211 r7212 14 14 15 15 2005-06-10: some naming conventions 16 17 // 18 // splitLine 19 // STL string tokenizer 20 // 21 // Created by Clemens Wacha. 22 // Version 1.0 23 // Copyright (c) 2005 Clemens Wacha. All rights reserved. 24 // 25 16 26 */ 17 27 … … 35 45 string, split); 36 46 } 37 38 47 39 48 /** … … 48 57 string); 49 58 } 50 51 59 SubString::SubString(const std::string& string, const std::string& splitters, char escapeChar,char safemode_char, char comment_char) 52 60 { 53 61 SubString::splitLine(this->strings, this->offsets, 54 62 string, splitters, escapeChar, safemode_char); 63 } 64 65 66 unsigned int SubString::split(const std::string& string, char splitter) 67 { 68 this->offsets.clear(); 69 this->strings.clear(); 70 char split[2]; 71 split[0] = splitter; 72 split[1] = '\0'; 73 SubString::splitLine(this->strings, this->offsets, string, split); 74 return strings.size(); 75 } 76 77 78 /** 79 * Splits a String into a Substring removing all whiteSpaces 80 * @param string the String to Split 81 * @param whiteSpaces MUST BE __TRUE__ 82 * 83 */ 84 unsigned int SubString::split(const std::string& string, bool whiteSpaces) 85 { 86 this->offsets.clear(); 87 this->strings.clear(); 88 SubString::splitLine(this->strings, this->offsets, string); 89 return strings.size(); 90 } 91 92 unsigned int SubString::split(const std::string& string, const std::string& splitters, char escapeChar,char safemode_char, char comment_char) 93 { 94 this->offsets.clear(); 95 this->strings.clear(); 96 SubString::splitLine(this->strings, this->offsets, 97 string, splitters, escapeChar, safemode_char); 98 return strings.size(); 55 99 } 56 100
Note: See TracChangeset
for help on using the changeset viewer.