diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-09-12 16:27:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-12 16:27:42 -0400 |
| commit | f60135cec62c91a9d7923397fe8796d2b3eaa5cb (patch) | |
| tree | 777646cb3611bf5809dc18e120e506117e143e11 /source/core/slang-string-util.h | |
| parent | 9a9733091cc7c9628e445313785d561deb229072 (diff) | |
Feature/memory arena (#631)
* First pass at MemoryArena.
* First pass at RandomGenerator.
* Extract TestContext into external source file.
* Fix warning on printf.
* Use enum classes for Test enums.
OutputMode -> TestOutputMode.
* First pass at FreeList unit test.
* Auto registering tests.
Improvements to RandomGenerator.
* Remove the need for unitTest headers - cos can use registering.
* Added unitTest for MemoryArena.
* Do unit tests.
* Fix typo.
Diffstat (limited to 'source/core/slang-string-util.h')
| -rw-r--r-- | source/core/slang-string-util.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/core/slang-string-util.h b/source/core/slang-string-util.h index bae576370..fc3258490 100644 --- a/source/core/slang-string-util.h +++ b/source/core/slang-string-util.h @@ -4,14 +4,26 @@ #include "slang-string.h" #include "list.h" +#include <stdarg.h> + namespace Slang { struct StringUtil { + /// 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); + + /// Appends formatted string with args into buf + static void append(const char* format, va_list args, StringBuilder& buf); + + /// Appends the formatted string with specified trailing args + static void appendFormat(StringBuilder& buf, const char* format, ...); + + /// Create a string from the format string applying args (like sprintf) + static String makeStringWithFormat(const char* format, ...); }; } // namespace Slang - #endif // SLANG_STRING_UTIL_H |
