summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-19 14:31:18 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-19 14:31:18 +0200
commit4398156b2e56ccfcb41f750906501ecf446be045 (patch)
treedc1c070c6c7490619d8b05e30ace2c959f085bb2 /src/StringUtils.cpp
parentDerp (diff)
parentQtBiomeVisualiser: More gcc fixes. (diff)
downloadcuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar
cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.gz
cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.bz2
cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.lz
cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.xz
cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.zst
cuberite-4398156b2e56ccfcb41f750906501ecf446be045.zip
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r--src/StringUtils.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp
index 5f88cbf64..73147eebc 100644
--- a/src/StringUtils.cpp
+++ b/src/StringUtils.cpp
@@ -869,3 +869,31 @@ void SetBEInt(char * a_Mem, Int32 a_Value)
+
+bool SplitZeroTerminatedStrings(const AString & a_Strings, AStringVector & a_Output)
+{
+ a_Output.clear();
+ size_t size = a_Strings.size();
+ size_t start = 0;
+ bool res = false;
+ for (size_t i = 0; i < size; i++)
+ {
+ if (a_Strings[i] == 0)
+ {
+ a_Output.push_back(a_Strings.substr(start, i - start));
+ start = i + 1;
+ res = true;
+ }
+ }
+ if (start < size)
+ {
+ a_Output.push_back(a_Strings.substr(start, size - start));
+ res = true;
+ }
+
+ return res;
+}
+
+
+
+