From 7a3c87b58de2683c077bd5341052c2e3cebeb048 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 1 Jun 2021 16:58:07 -0400 Subject: JSONValue / Container (#1864) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP JSONWriter/JSONParser. * Checking different Layout styles for JSON. * Add slang-json-parser.h/.cpp * WIP JSONValue. * Added JSONValue::destroy/Recursive. * Improvement to JSONValue. * Improve text double conversion precision. Testing. * Simplify double parsing (just use atof). JSON comparison More testing of conversions and start of JSONValue. * Add for isnan, isinf etc. * Small improvement with object comparison. * Fix typo in getArgsByName. * Removed use of isnan and isinf as includes don't work on linux. * Improve JSON unit test. * Added asInteger/asFloat/asBool to JSONValue. * Change comment to trigger CI build. --- source/core/slang-string-util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/core/slang-string-util.h') diff --git a/source/core/slang-string-util.h b/source/core/slang-string-util.h index 2b30120b7..6a0794082 100644 --- a/source/core/slang-string-util.h +++ b/source/core/slang-string-util.h @@ -100,6 +100,12 @@ struct StringUtil /// Convert in to int. Returns SLANG_FAIL on error static SlangResult parseInt(const UnownedStringSlice& in, Int& outValue); + + /// Convert ioText into double. Returns SLANG_OK on success. + static SlangResult parseDouble(const UnownedStringSlice& text, double& out); + + /// Convert into int64_t. Returns SLANG_OK on success. + static SlangResult parseInt64(const UnownedStringSlice& text, int64_t& out); }; /* A helper class that allows parsing of lines from text with iteration. Uses StringUtil::extractLine for the actual underlying implementation. */ -- cgit v1.2.3