Lagrange
Loading...
Searching...
No Matches
CistaValue.h
1/*
2 * Copyright 2026 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <cista/containers/string.h>
15#include <cista/containers/vector.h>
16
17#include <cstdint>
18
19namespace lagrange::serialization::internal {
20
21namespace data = cista::offset;
22
24enum class CistaValueType : uint8_t {
25 Bool = 0,
26 Int = 1,
27 Double = 2,
28 String = 3,
29 Buffer = 4,
30 Array = 5,
31 Object = 6
32};
33
37{
38 CistaValueType type = CistaValueType::Bool;
39
40 bool bool_val = false;
41 int32_t int_val = 0;
42 double double_val = 0.0;
43 data::string string_val;
44 data::vector<uint8_t> buffer_val;
45 data::vector<CistaValue> array_val;
46
47 // Object stored as parallel key/value vectors (cista has no map).
48 data::vector<data::string> object_keys;
49 data::vector<CistaValue> object_values;
50};
51
55{
56 data::vector<data::string> keys;
57 data::vector<CistaValue> values;
58};
59
60} // namespace lagrange::serialization::internal
Cista-compatible representation of scene::Extensions.
Definition CistaValue.h:55
Cista-compatible representation of scene::Value.
Definition CistaValue.h:37