summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index 7b2de6bd9..d11c4b7f2 100644
--- a/slang.h
+++ b/slang.h
@@ -2098,6 +2098,21 @@ extern "C"
SlangReflectionType* const* specializationArgs,
ISlangBlob** outDiagnostics);
+ /// Get the number of hashed strings
+ SLANG_API SlangUInt spReflection_getHashedStringCount(
+ SlangReflection* reflection);
+
+ /// Get a hashed string. The number of chars is writtent in outCount. Note the count does *NOT* including terminating 0,
+ /// and the returned pointer will not generally have a terminating zero.
+ SLANG_API const char* spReflection_getHashedString(
+ SlangReflection* reflection,
+ SlangUInt index,
+ size_t* outCount);
+
+ /// Calculate a string hash.
+ // Count should *NOT* include terminating zero.
+ SLANG_API int spCalcStringHash(const char* chars, size_t count);
+
#ifdef __cplusplus
}
@@ -2735,6 +2750,13 @@ namespace slang
(SlangReflectionType* const*) specializationArgs,
outDiagnostics);
}
+
+ SlangUInt getHashedStringCount() const { return spReflection_getHashedStringCount((SlangReflection*)this); }
+
+ const char* getHashedString(SlangUInt index, size_t* outCount) const
+ {
+ return spReflection_getHashedString((SlangReflection*)this, index, outCount);
+ }
};
typedef ISlangBlob IBlob;