summaryrefslogtreecommitdiffstats
path: root/source/core/slang-string-util.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-04-16 18:25:53 -0400
committerGitHub <noreply@github.com>2020-04-16 15:25:53 -0700
commit12b30afb24ac03d69f091f18c25ed2bbefae1acd (patch)
treefd5dc0c512c707c46bd3640f604f308a461a6bda /source/core/slang-string-util.h
parentb5a531738baa1e856b15bb3dffdbea9a1ee5cc82 (diff)
Workaround for matching of dxc diagnostics (#1324)
* Specialized handling for comparison of dxc output that ignores line/column numbers. * Simplify areAllEqualWithSplit.
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 ad25dc9a1..9f1508cb1 100644
--- a/source/core/slang-string-util.h
+++ b/source/core/slang-string-util.h
@@ -13,6 +13,14 @@ namespace Slang {
struct StringUtil
{
+ typedef bool (*EqualFn)(const UnownedStringSlice& a, const UnownedStringSlice& b);
+
+ /// True if the splits of a and b (via splitChar) are all equal as compared with the equalFn function
+ static bool areAllEqualWithSplit(const UnownedStringSlice& a, const UnownedStringSlice& b, char splitChar, EqualFn equalFn);
+
+ /// True if all slices in match are all equal as compared with the equalFn function
+ static bool areAllEqual(const List<UnownedStringSlice>& a, const List<UnownedStringSlice>& b, EqualFn equalFn);
+
/// Split in, by specified splitChar into slices out
/// 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);