Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jbakker>2021-10-26 14:05:59 +0300
committerJeroen Bakker <jeroen@blender.org>2021-10-26 14:09:10 +0300
commitddf97d6270d0a0da36257bb676d9d05513064de5 (patch)
treea7b50b034db2ee79f740e7c228757fb7918a8228 /source/blender/blenlib/CMakeLists.txt
parentd20fa6c4d48580bf5fc140cf83fd7d8829bd8e09 (diff)
BlenLib: Add JSON Serialization/Deserialization Abstraction Layer.
Adds an abstraction layer to switch between serialization formats. Currently only supports JSON. The abstraction layer supports `String`, `Int`, `Array`, `Null`, `Boolean`, `Float` and `Object`. This feature is only CPP complaint. To write from a stream, the structure can be built by creating a value (any subclass of `blender::io::serialize::Value` can do, and pass it to the `serialize` method of a `blender::io::serialize::Formatter`. The formatter is abstract and there is one implementation for JSON (`JsonFormatter`). To read from a stream use the `deserialize` method of the formatter. {D12693} uses this abstraction layer to read/write asset indexes. Reviewed By: Severin, sybren Maniphest Tasks: T91430 Differential Revision: https://developer.blender.org/D12544
Diffstat (limited to 'source/blender/blenlib/CMakeLists.txt')
-rw-r--r--source/blender/blenlib/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index c01052f0111..72087a12767 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -27,6 +27,7 @@ set(INC
../../../intern/guardedalloc
../../../intern/numaapi/include
../../../extern/wcwidth
+ ../../../extern/json/include
)
set(INC_SYS
@@ -126,6 +127,7 @@ set(SRC
intern/scanfill.c
intern/scanfill_utils.c
intern/session_uuid.c
+ intern/serialize.cc
intern/smallhash.c
intern/sort.c
intern/sort_utils.c
@@ -282,6 +284,7 @@ set(SRC
BLI_session_uuid.h
BLI_set.hh
BLI_set_slots.hh
+ BLI_serialize.hh
BLI_simd.h
BLI_smallhash.h
BLI_sort.h
@@ -448,6 +451,7 @@ if(WITH_GTESTS)
tests/BLI_span_test.cc
tests/BLI_stack_cxx_test.cc
tests/BLI_stack_test.cc
+ tests/BLI_serialize_test.cc
tests/BLI_string_ref_test.cc
tests/BLI_string_search_test.cc
tests/BLI_string_test.cc