summaryrefslogtreecommitdiff
path: root/tools.cpp
diff options
context:
space:
mode:
authorSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-01-05 19:55:13 +0000
committerSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-01-05 19:55:13 +0000
commit8d278564f8350647964b5b9ccf3a6183ac7e2f0e (patch)
treea36930a3eae6e5ef2487aa24314966608eb05d3c /tools.cpp
parentcd737785cace62f79fbd5f596ccb0d70de3e6252 (diff)
downloadvdr-plugin-live-8d278564f8350647964b5b9ccf3a6183ac7e2f0e.tar.gz
vdr-plugin-live-8d278564f8350647964b5b9ccf3a6183ac7e2f0e.tar.bz2
- added function StringSplit
Diffstat (limited to 'tools.cpp')
-rw-r--r--tools.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools.cpp b/tools.cpp
index e1d9a03..d30183f 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -37,4 +37,17 @@ string StringReplace( string const& text, string const& substring, string const&
return result;
}
+vector< string > StringSplit( string const& text, char delimiter )
+{
+ vector< string > result;
+ string::size_type last = 0, pos;
+ while ( ( pos = text.find( delimiter, last ) ) != string::npos ) {
+ result.push_back( text.substr( last, pos - last ) );
+ last = pos + 1;
+ }
+ if ( last < text.length() )
+ result.push_back( text.substr( last ) );
+ return result;
+}
+
}