Home
last modified time | relevance | path

Searched refs:JsonValue (Results 1 – 25 of 595) sorted by relevance

12345678910>>...24

/ohos5.0/commonlibrary/rust/ylong_json/src/
H A Dvalue.rs65 pub enum JsonValue { enum
115 impl JsonValue { implementation
863 (JsonValue::Null, JsonValue::Null) => true, in eq()
864 (JsonValue::Boolean(a), JsonValue::Boolean(b)) => a == b, in eq()
865 (JsonValue::Number(a), JsonValue::Number(b)) => a == b, in eq()
866 (JsonValue::String(a), JsonValue::String(b)) => a == b, in eq()
867 (JsonValue::Array(a), JsonValue::Array(b)) => a == b, in eq()
868 (JsonValue::Object(a), JsonValue::Object(b)) => a == b, in eq()
1636 assert_eq!(JsonValue::new_null(), JsonValue::new_null()); in ut_json_value_eq()
1654 assert_ne!(JsonValue::new_null(), JsonValue::new_boolean(true)); in ut_json_value_eq()
[all …]
/ohos5.0/commonlibrary/rust/ylong_json/src/value/
H A Dindex.rs17 static NULL: JsonValue = JsonValue::Null;
22 fn index_into<'a>(&self, value: &'a JsonValue) -> &'a JsonValue; in index_into() argument
25 fn index_into_mut<'a>(&self, value: &'a mut JsonValue) -> &'a mut JsonValue; in index_into_mut() argument
28 fn index_remove(&self, value: &mut JsonValue) -> Option<JsonValue>; in index_remove() argument
62 fn index_into<'a>(&self, value: &'a JsonValue) -> &'a JsonValue { in index_into() argument
136 fn index_remove(&self, value: &mut JsonValue) -> Option<JsonValue> { in index_remove() argument
173 fn index_into<'a>(&self, value: &'a JsonValue) -> &'a JsonValue { in index_into() argument
258 fn index_remove(&self, value: &mut JsonValue) -> Option<JsonValue> { in index_remove() argument
268 fn index_into<'a>(&self, value: &'a JsonValue) -> &'a JsonValue { in index_into() argument
278 fn index_remove(&self, value: &mut JsonValue) -> Option<JsonValue> { in index_remove() argument
[all …]
/ohos5.0/foundation/arkui/ace_engine/frameworks/base/json/
H A Djson_util.cpp22 JsonValue::JsonValue(JsonObject* object) : object_(object) {} in JsonValue() function in OHOS::Ace::JsonValue
26 JsonValue::~JsonValue() in ~JsonValue()
121 std::unique_ptr<JsonValue> JsonValue::GetNext() const in GetNext()
129 std::unique_ptr<JsonValue> JsonValue::GetChild() const in GetChild()
141 std::unique_ptr<JsonValue> JsonValue::GetValue(const std::string& key) const in GetValue()
146 std::unique_ptr<JsonValue> JsonValue::GetObject(const std::string& key) const in GetObject()
159 std::unique_ptr<JsonValue> JsonValue::GetArrayItem(int32_t index) const in GetArrayItem()
200 bool JsonValue::Put(const char* key, const std::unique_ptr<JsonValue>& value) in Put()
233 bool JsonValue::Put(const std::unique_ptr<JsonValue>& value) in Put()
372 bool JsonValue::PutRef(const char* key, std::unique_ptr<JsonValue>&& value) in PutRef()
[all …]
H A Djson_util.h32 class ACE_FORCE_EXPORT JsonValue : public SerializeableObject {
34 JsonValue() = default;
35 explicit JsonValue(JsonObject* object);
36 JsonValue(JsonObject* object, bool isRoot);
37 ~JsonValue() override;
63 std::unique_ptr<JsonValue> GetNext() const;
64 std::unique_ptr<JsonValue> GetChild() const;
69 std::unique_ptr<JsonValue> GetArrayItem(int32_t index) const;
80 bool Put(const std::unique_ptr<JsonValue>& value);
102 bool PutRef(std::unique_ptr<JsonValue>&& value);
[all …]
/ohos5.0/foundation/arkui/ace_engine/frameworks/bridge/card_frontend/
H A Djs_card_parser.h34 std::unique_ptr<JsonValue>&& rootBody) in JsCardParser()
82 …std::string& value, const std::unique_ptr<JsonValue>& dataJson, const std::unique_ptr<JsonValue>& …
151 …const std::unique_ptr<JsonValue>& styleJson, const std::unique_ptr<JsonValue>& propsJson = nullptr,
156 const std::unique_ptr<JsonValue>& dataJson, const std::unique_ptr<JsonValue>& propsJson);
165 const std::unique_ptr<JsonValue>& styleJson, const std::unique_ptr<JsonValue>& propsJson);
166 …void ParseEvents(const std::unique_ptr<JsonValue>& rootJson, const std::unique_ptr<JsonValue>& eve…
186 …void GetShownAttr(const std::unique_ptr<JsonValue>& rootJson, const std::unique_ptr<JsonValue>& da…
194 …void GetBoolValue(const std::unique_ptr<JsonValue>& rootJson, const std::unique_ptr<JsonValue>& da…
209 std::unique_ptr<JsonValue> rootBody_;
211 std::unique_ptr<JsonValue> rootJson_;
[all …]
/ohos5.0/commonlibrary/rust/ylong_json/docs/
H A Duser_guide_zh.md9 (1)可以使用 `JsonValue` 所具有的四种方法从不同的来源生成 `JsonValue` 实例:
14 use ylong_json::JsonValue;
20 let json_value = JsonValue::from_str(str);
38 当 `JsonValue` 实例创建成功后,就可以尝试读取和修改对应的内容了。
72 `JsonValue` 实例生成成功后,可以通过各种下标来查找对应的键值对(获取到对应 `JsonValue` 的普通引用)。
77 use ylong_json::JsonValue;
103 // 对一个 Object 和 Array 类型以外的 JsonValue 类型使用下标访问也会返回 &JsonValue::Null。
110 use ylong_json::JsonValue;
126 // 库中给许多基本类型实现了从自身到 JsonValue 的转换,所以可以通过 into() 方法转换为 JsonValue
192 (1)当拥有一个 `JsonValue` 实例时,可以将该 `JsonValue` 实例转化成文本并输出到指定位置:字符串、文件、网络等。
[all …]
H A Duser_guide.md10 (1) You can create a `JsonValue` instance by:
15 use ylong_json::JsonValue;
22 let json_value = JsonValue::from_str(str);
29 let json_value = JsonValue::from_text(text);
33 // try to generate a `JsonValue` instance.
36 let json_value = JsonValue::from_file(path);
89 use ylong_json::JsonValue;
113 // `&JsonValue::Null` will be returned.
129 use ylong_json::JsonValue;
225 use ylong_json::JsonValue;
[all …]
/ohos5.0/commonlibrary/rust/ylong_json/src/value/object/
H A Dlinked_list.rs41 inner: LinkedList<(String, JsonValue)>,
117 pub fn insert(&mut self, key: String, value: JsonValue) { in insert() argument
134 pub fn remove(&mut self, key: &str) -> Option<JsonValue> { in remove() argument
147 pub fn iter(&self) -> Iter<'_, (String, JsonValue)> { in iter() argument
160 pub fn iter_mut(&mut self) -> IterMut<'_, (String, JsonValue)> { in iter_mut() argument
177 pub fn get(&self, key: &str) -> Option<&JsonValue> { in get() argument
194 pub fn get_mut(&mut self, key: &str) -> Option<&mut JsonValue> { in get_mut() argument
259 self.insert(String::from(key), JsonValue::Null); in get_key_mut_maybe_insert()
263 &mut (*(ptr as *mut Node<(String, JsonValue)>)) in get_key_mut_maybe_insert()
318 use crate::{JsonValue, Object};
[all …]
H A Dvec.rs14 use crate::JsonValue;
45 inner: Vec<(String, JsonValue)>,
119 pub fn insert(&mut self, key: String, value: JsonValue) { in insert() argument
136 pub fn remove(&mut self, key: &str) -> Option<JsonValue> { in remove() argument
150 pub fn iter(&self) -> Iter<'_, (String, JsonValue)> { in iter() argument
163 pub fn iter_mut(&mut self) -> IterMut<'_, (String, JsonValue)> { in iter_mut() argument
180 pub fn get(&self, key: &str) -> Option<&JsonValue> { in get() argument
197 pub fn get_mut(&mut self, key: &str) -> Option<&mut JsonValue> { in get_mut() argument
205 pub(crate) fn last_mut(&mut self) -> Option<&mut JsonValue> { in last_mut() argument
266 use crate::{JsonValue, Object};
[all …]
H A Dbtree.rs14 use crate::JsonValue;
38 inner: BTreeMap<String, JsonValue>,
114 pub fn insert(&mut self, key: String, value: JsonValue) { in insert() argument
130 pub fn remove(&mut self, key: &str) -> Option<JsonValue> { in remove() argument
143 pub fn iter(&self) -> Iter<'_, String, JsonValue> { in iter() argument
156 pub fn iter_mut(&mut self) -> IterMut<'_, String, JsonValue> { in iter_mut() argument
172 pub fn get(&self, key: &str) -> Option<&JsonValue> { in get() argument
188 pub fn get_mut(&mut self, key: &str) -> Option<&mut JsonValue> { in get_mut() argument
214 use crate::{JsonValue, Object};
231 Some((&String::from("key1"), &mut JsonValue::new_string("value1"))) in ut_object_iter_mut()
/ohos5.0/commonlibrary/rust/ylong_json/src/value/array/
H A Dlinked_list.rs35 inner: LinkedList<JsonValue>,
97 pub fn push(&mut self, value: JsonValue) { in push() argument
113 pub fn pop(&mut self) -> Option<JsonValue> { in pop() argument
126 pub fn iter(&self) -> Iter<'_, JsonValue> { in iter() argument
139 pub fn iter_mut(&mut self) -> IterMut<'_, JsonValue> { in iter_mut() argument
154 pub fn get(&self, index: usize) -> Option<&JsonValue> { in get() argument
185 pub fn last(&self) -> Option<&JsonValue> { in last() argument
200 pub fn last_mut(&mut self) -> Option<&mut JsonValue> { in last_mut() argument
220 pub fn remove(&mut self, index: usize) -> Option<JsonValue> { in remove() argument
272 pub fn last_node(&self) -> Option<&Node<JsonValue>> { in last_node() argument
[all …]
H A Dvec.rs14 use crate::JsonValue;
36 inner: Vec<JsonValue>,
96 pub fn push(&mut self, value: JsonValue) { in push() argument
112 pub fn pop(&mut self) -> Option<JsonValue> { in pop() argument
125 pub fn iter(&self) -> Iter<'_, JsonValue> { in iter() argument
138 pub fn iter_mut(&mut self) -> IterMut<'_, JsonValue> { in iter_mut() argument
153 pub fn get(&self, index: usize) -> Option<&JsonValue> { in get() argument
183 pub fn last(&self) -> Option<&JsonValue> { in last() argument
198 pub fn last_mut(&mut self) -> Option<&mut JsonValue> { in last_mut() argument
218 pub fn remove(&mut self, index: usize) -> Option<JsonValue> { in remove() argument
[all …]
/ohos5.0/foundation/arkui/ace_engine/test/unittest/base/
H A Djson_util_test.cpp350 JsonValue jsonValue;
394 JsonValue jsonValue;
416 JsonValue jsonValue;
460 JsonValue jsonValue;
493 JsonValue jsonValue;
514 JsonValue jsonValue;
733 JsonValue jsonValue;
838 JsonValue jsonValue;
859 JsonValue jsonValue;
880 JsonValue jsonValue;
[all …]
/ohos5.0/foundation/arkui/ace_engine/frameworks/core/components_v2/inspector/
H A Dinspector_node.h100 virtual std::unique_ptr<JsonValue> GetSize() const = 0;
112 virtual std::unique_ptr<JsonValue> GetPosition() const = 0;
113 virtual std::unique_ptr<JsonValue> GetMarkAnchor() const = 0;
114 virtual std::unique_ptr<JsonValue> GetOffset() const = 0;
163 virtual std::unique_ptr<JsonValue> GetRotate() const = 0;
164 virtual std::unique_ptr<JsonValue> GetScale() const = 0;
165 virtual std::unique_ptr<JsonValue> GetTransform() const = 0;
171 virtual std::unique_ptr<JsonValue> GetShadow() const = 0;
183 virtual std::unique_ptr<JsonValue> GetMask() const = 0;
192 virtual std::unique_ptr<JsonValue> GetUseAlign() const = 0;
[all …]
H A Dcalendar_composed_element.h33 std::unique_ptr<JsonValue> ToJsonObject() const override;
40 std::unique_ptr<JsonValue> GetCurrentDayStyle() const;
41 std::unique_ptr<JsonValue> GetNonCurrentDayStyle() const;
42 std::unique_ptr<JsonValue> GetTodayStyle() const;
43 std::unique_ptr<JsonValue> GetWeekStyle() const;
44 std::unique_ptr<JsonValue> GetWorkStateStyle() const;
53 std::unique_ptr<JsonValue> ConvertThemeToDayStyle(const CalendarThemeStructure& theme) const;
54 …std::unique_ptr<JsonValue> ConvertThemeToNonCurrentDayStyle(const CalendarThemeStructure& theme) c…
55 std::unique_ptr<JsonValue> ConvertThemeToTodayStyle(const CalendarThemeStructure& theme) const;
56 std::unique_ptr<JsonValue> ConvertThemeToWeekStyle(const CalendarThemeStructure& theme) const;
[all …]
H A Dinspector_composed_element.h113 std::unique_ptr<JsonValue> GetSize() const override;
125 std::unique_ptr<JsonValue> GetPosition() const override;
127 std::unique_ptr<JsonValue> GetOffset() const override;
176 std::unique_ptr<JsonValue> GetRotate() const override;
177 std::unique_ptr<JsonValue> GetScale() const override;
178 std::unique_ptr<JsonValue> GetTransform() const override;
179 std::unique_ptr<JsonValue> GetTranslate() const override;
184 std::unique_ptr<JsonValue> GetShadow() const override;
197 std::unique_ptr<JsonValue> GetMask() const override;
206 std::unique_ptr<JsonValue> GetUseAlign() const override;
[all …]
H A Dshape_composed_element.h32 std::unique_ptr<JsonValue> ToJsonObject() const override;
48 std::unique_ptr<JsonValue> GetRadiusArray() const;
49 std::unique_ptr<JsonValue> GetRadiusHeightArray() const;
50 std::unique_ptr<JsonValue> GetRadiusWidthArray() const;
51 std::unique_ptr<JsonValue> GetStrokeDashArray() const;
52 std::unique_ptr<JsonValue> GetStartPointArray() const;
53 std::unique_ptr<JsonValue> GetEndPointArray() const;
54 std::unique_ptr<JsonValue> GetPointsArray() const;
/ohos5.0/commonlibrary/rust/ylong_json/
H A DREADME_zh.md18 `ylong_json` 主要分为三个子模块:`JsonValue` 子模块、`serde` 子模块、C-ffi 子模块。
20 `JsonValue` 子模块提供了一种基础数据结构 `JsonValue`。
21 `JsonValue` 支持以缩进型格式或紧凑型格式将自身序列化成 `JSON` 文本。任意语法正确的 `JSON` 文本也能被反序列化成一个对应的 `JsonValue` 数据结构。
22 `JsonValue` 支持增删改查,可以使用指定接口变更 `JsonValue` 中的数据内容。
23 `JsonValue` 支持 `JSON` 语法中全部的数据类型:`null`, `boolean`, `number`, `string`, `array`, `object`,且按照 `ECMA…
24 针对于 `array` 和 `object` 语法结构,`JsonValue` 提供了多种底层数据结构以针对不同使用场景,例如对于 `array` 结构,支持底层使用 `Vec` 或 `Linked…
28 `serde` 相较于 `JsonValue` 的优势是使用便捷,用户无需将 `JSON` 文本先转换为 `JsonValue` 再从其中取出指定数据生成 `Rust` 结构体,只需给结构体设定 `…
30 C-ffi 模块提供了基于 `JsonValue` 模块的 C 接口层,方便用户使用 C 接口调用 `ylong_json` 库的功能。
44 │ ├─ encoder.rs # 为 JsonValue 类型序列化实现
48 │ ├─ states.rs # 为 JsonValue 类型反序列化实现
[all …]
/ohos5.0/foundation/arkui/ace_engine/test/mock/core/render/
H A Dmock_render_property.cpp19 void BorderProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
20 void RenderPositionProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
21 void GraphicsProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
22 void BackgroundProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
23 void ForegroundProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
24 void ClipProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
25 void GradientProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
26 void TransformProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
27 void PointLightProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {} in ToJsonValue()
/ohos5.0/commonlibrary/rust/ylong_json/tests/
H A Dylong_json_sdv_test.rs14 use ylong_json::{Array, JsonValue, Object};
178 assert_eq!($json[0]["null1"], JsonValue::new_null());
275 let json = JsonValue::from_text(JSON_PARSE_TEST).unwrap(); in sdv_json_parse()
281 let mut json = JsonValue::from_text(json_text).unwrap(); in sdv_json_modify()
285 json["null"] = JsonValue::new_null(); in sdv_json_modify()
302 json["array"][2] = JsonValue::new_null(); in sdv_json_modify()
306 assert_eq!(json["array"][2], JsonValue::new_null()); in sdv_json_modify()
314 json["object"]["null"] = JsonValue::new_null(); in sdv_json_modify()
338 let temp = JsonValue::from_text(&vec).unwrap(); in sdv_json_output()
355 let temp = JsonValue::from_text(&vec).unwrap(); in sdv_json_output()
[all …]
/ohos5.0/base/security/code_signature/test/unittest/
H A Drust_key_enable_test.rs19 use ylong_json::JsonValue;
143 let profile_json =JsonValue::from_text(profile_str).unwrap(); in test_parse_enterprise_profile()
182 let profile_json =JsonValue::from_text(profile_str).unwrap(); in test_parse_enterprise_normal_profile()
221 let profile_json =JsonValue::from_text(profile_str).unwrap(); in test_parse_enterprise_mdm_profile()
265 let mut profile_json =JsonValue::from_text(profile_str).unwrap(); in test_parse_debug_profile()
266 profile_json["debug-info"]["device-ids"][0] = JsonValue::String(udid); in test_parse_debug_profile()
310 let mut profile_json =JsonValue::from_text(profile_str).unwrap(); in test_parse_iternaltesting_profile()
311 profile_json["debug-info"]["device-ids"][0] = JsonValue::String(udid); in test_parse_iternaltesting_profile()
421 let mut no_type_profile_json =JsonValue::from_text(no_type_profile).unwrap(); in test_parse_invalid_profile()
422 no_type_profile_json["debug-info"]["device-ids"][0] = JsonValue::String(udid.clone()); in test_parse_invalid_profile()
[all …]
/ohos5.0/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/
H A Dhisysevent_record.cpp178 [this] (JsonValue val) { in GetParamValue()
181 [&value] (JsonValue src) { in GetParamValue()
189 [this] (JsonValue val) { in GetParamValue()
192 [&value] (JsonValue src) { in GetParamValue()
200 [this] (JsonValue val) { in GetParamValue()
203 [&value] (JsonValue src) { in GetParamValue()
211 [this] (JsonValue val) { in GetParamValue()
222 [this] (JsonValue val) { in GetParamValue()
238 [this] (JsonValue val) { in GetParamValue()
254 [this] (JsonValue val) { in GetParamValue()
[all …]
/ohos5.0/commonlibrary/rust/ylong_json/benches/
H A Ddeserialize_json_cmp.rs28 use ylong_json::JsonValue;
34 let _value = JsonValue::from_str(NULL_EXAMPLE).unwrap(); in null_deserialize_perf_ylong_json()
43 let _value = JsonValue::from_str(BOOLEAN_EXAMPLE).unwrap(); in boolean_deserialize_perf_ylong_json()
52 let _value = JsonValue::from_str(NUMBER_EXAMPLE).unwrap(); in number_deserialize_perf_ylong_json()
61 let _value = JsonValue::from_str(STRING_EXAMPLE).unwrap(); in string_deserialize_perf_ylong_json()
70 let _value = JsonValue::from_str(ARRAY_EXAMPLE).unwrap(); in array_deserialize_perf_ylong_json()
79 let _value = JsonValue::from_str(OBJECT_EXAMPLE).unwrap(); in object_deserialize_perf_ylong_json()
88 let _value = JsonValue::from_str(RFC7159_EXAMPLE1).unwrap(); in exp1_deserialize_perf_ylong_json()
97 let _value = JsonValue::from_str(RFC7159_EXAMPLE2).unwrap(); in exp2_deserialize_perf_ylong_json()
106 let _value = JsonValue::from_str(JSON_PARSE_TEST).unwrap(); in exp3_deserialize_perf_ylong_json()
[all …]
H A Dserialize_json_cmp.rs28 use ylong_json::JsonValue;
32 let value = JsonValue::from_str(NULL_EXAMPLE).unwrap(); in null_serialize_perf_ylong_json()
42 let value = JsonValue::from_str(BOOLEAN_EXAMPLE).unwrap(); in boolean_serialize_perf_ylong_json()
52 let value = JsonValue::from_str(NUMBER_EXAMPLE).unwrap(); in number_serialize_perf_ylong_json()
62 let value = JsonValue::from_str(STRING_EXAMPLE).unwrap(); in string_serialize_perf_ylong_json()
72 let value = JsonValue::from_str(ARRAY_EXAMPLE).unwrap(); in array_serialize_perf_ylong_json()
82 let value = JsonValue::from_str(OBJECT_EXAMPLE).unwrap(); in object_serialize_perf_ylong_json()
92 let value = JsonValue::from_str(RFC7159_EXAMPLE1).unwrap(); in exp1_serialize_perf_ylong_json()
102 let value = JsonValue::from_str(RFC7159_EXAMPLE2).unwrap(); in exp2_serialize_perf_ylong_json()
112 let value = JsonValue::from_str(JSON_PARSE_TEST).unwrap(); in exp3_serialize_perf_ylong_json()
[all …]
/ohos5.0/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/include/
H A Dhisysevent_record.h76 using JsonValue = std::shared_ptr<HiSysEventValue>;
77 using TypeFilter = std::function<bool(JsonValue)>;
78 using ValueAssigner = std::function<void(JsonValue)>;
79 bool IsInt64ValueType(const JsonValue val) const;
80 bool IsUInt64ValueType(const JsonValue val) const;
81 bool IsDoubleValueType(const JsonValue val) const;
82 bool IsStringValueType(const JsonValue val) const;
83 bool IsArray(const JsonValue val, const TypeFilter filterFunc) const;
89 JsonValue jsonVal_;

12345678910>>...24