diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-12-07 12:26:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-07 12:26:48 -0500 |
| commit | 9e666a332aafeffdc15ceab6017fe377144a928b (patch) | |
| tree | 4d5a27b5286cb95757ad45f097f4acf74dfb2159 /source/compiler-core/slang-json-native.h | |
| parent | ef4ee0b2d42b1fe9ce36c67526cf853343d98ea0 (diff) | |
Support array args for JSON-RPC (#2046)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Add ability to send/receive JSON-RPC params optionally as an array.
* More array conversions to json-native.
* Simplified setting up of 'CallStyle' on JSONRPCConnection.
* Small simplification in JSONRPCConnection.
* Small improvements around JSON-RPC connection.
* Improve some comments.
Kick CI build.
Diffstat (limited to 'source/compiler-core/slang-json-native.h')
| -rw-r--r-- | source/compiler-core/slang-json-native.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/compiler-core/slang-json-native.h b/source/compiler-core/slang-json-native.h index f9ec93119..4235a99a8 100644 --- a/source/compiler-core/slang-json-native.h +++ b/source/compiler-core/slang-json-native.h @@ -15,6 +15,10 @@ struct JSONToNativeConverter template <typename T> SlangResult convert(const JSONValue& value, T* in) { return convert(value, GetRttiInfo<T>::get(), (void*)in); } + template <typename T> + SlangResult convertArrayToStruct(const JSONValue& value, T* in) { return convertArrayToStruct(value, GetRttiInfo<T>::get(), (void*)in); } + SlangResult convertArrayToStruct(const JSONValue& value, const RttiInfo* rttiInfo, void* out); + JSONToNativeConverter(JSONContainer* container, DiagnosticSink* sink): m_container(container), m_sink(sink) @@ -37,6 +41,11 @@ struct NativeToJSONConverter template <typename T> SlangResult convert(T* in, JSONValue& out) { return convert(GetRttiInfo<T>::get(), (const void*)in, out); } + SlangResult convertStructToArray(const RttiInfo* rttiInfo, const void* in, JSONValue& out); + template <typename T> + SlangResult convertStructToArray(T* in, JSONValue& out) { return convertStructToArray(GetRttiInfo<T>::get(), (const void*)in, out); } + + NativeToJSONConverter(JSONContainer* container, DiagnosticSink* sink) : m_container(container), m_sink(sink) |
