diff options
Diffstat (limited to 'common/tools.cpp')
-rw-r--r-- | common/tools.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/tools.cpp b/common/tools.cpp index 7ddfc4f..d64b86b 100644 --- a/common/tools.cpp +++ b/common/tools.cpp @@ -137,6 +137,21 @@ string GenerateUUIDRandomly(){ return uuid.str(); } +void StringExplode(string str, string separator, StringVector results) { + int found; + found = str.find_first_of(separator); + while(found != string::npos){ + if(found > 0){ + results.push_back(str.substr(0,found)); + } + str = str.substr(found+1); + found = str.find_first_of(separator); + } + if(str.length() > 0){ + results.push_back(str); + } +} + } // namespace tools namespace ixml { |