summaryrefslogtreecommitdiff
path: root/source/core/slang-string-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-string-util.h')
-rw-r--r--source/core/slang-string-util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/core/slang-string-util.h b/source/core/slang-string-util.h
index 74ec75dc6..77b7ca2a3 100644
--- a/source/core/slang-string-util.h
+++ b/source/core/slang-string-util.h
@@ -41,6 +41,13 @@ struct StringUtil
/// Slices contents will directly address into in, so contents will only stay valid as long as in does.
static void split(const UnownedStringSlice& in, char splitChar, List<UnownedStringSlice>& slicesOut);
+ /// Append the joining of in items, separated by 'separator' onto out
+ static void join(const List<String>& in, char separator, StringBuilder& out);
+ static void join(const List<String>& in, const UnownedStringSlice& separator, StringBuilder& out);
+
+ static void join(const UnownedStringSlice* values, Index valueCount, char separator, StringBuilder& out);
+ static void join(const UnownedStringSlice* values, Index valueCount, const UnownedStringSlice& separator, StringBuilder& out);
+
/// Equivalent to doing a split and then finding the index of 'find' on the array
/// Returns -1 if not found
static int indexOfInSplit(const UnownedStringSlice& in, char splitChar, const UnownedStringSlice& find);
@@ -94,6 +101,9 @@ struct StringUtil
/// Equal if the lines are equal (in effect a way to ignore differences in line breaks)
static bool areLinesEqual(const UnownedStringSlice& a, const UnownedStringSlice& b);
+
+ /// Convert in to int. Returns SLANG_FAIL on error
+ static SlangResult parseInt(const UnownedStringSlice& in, Int& outValue);
};
/* A helper class that allows parsing of lines from text with iteration. Uses StringUtil::extractLine for the actual underlying implementation. */