summaryrefslogtreecommitdiffstats
path: root/source/core/slang-string-util.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-03-07 16:31:56 -0500
committerGitHub <noreply@github.com>2019-03-07 16:31:56 -0500
commitf33aee2be9017934140da9fdfb0dcde15568b3a8 (patch)
tree15e0a6bdf137c103806269cdd2c490467560642c /source/core/slang-string-util.h
parent3f6609a61465a09ad83ecbab5f59ec9475e5cc81 (diff)
Fix problems with synthesized tests and inconsitent render-test command lines (#885)
* * Check for inconsistent command line options for renderer * Moved RenderApiUtil into core so can be used in slang-test * Make it use the ShaderdLibrary for API testsing * Added some simplifying functions to StringUtil for spliting/comparisons * Refactored the synthesis of rendering tests so that inconsistent combinations are not produced * Add missing slang-render-api-util.cpp & .h * Stop warning on linux about _canLoadSharedLibrary not being used.
Diffstat (limited to 'source/core/slang-string-util.h')
-rw-r--r--source/core/slang-string-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/core/slang-string-util.h b/source/core/slang-string-util.h
index 3547fd97c..3288899fc 100644
--- a/source/core/slang-string-util.h
+++ b/source/core/slang-string-util.h
@@ -41,6 +41,14 @@ 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);
+ /// 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);
+
+ /// Given the entry at the split index specified.
+ /// Will return slice with begin() == nullptr if not found or input has begin() == nullptr)
+ static UnownedStringSlice getAtInSplit(const UnownedStringSlice& in, char splitChar, int index);
+
/// Returns the size in bytes needed to hold the formatted string using the specified args, NOT including a terminating 0
/// NOTE! The caller *should* assume this will consume the va_list (use va_copy to make a copy to be consumed)
static size_t calcFormattedSize(const char* format, va_list args);