• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "config.h"
17 namespace OHOS::MiscServices {
Marshal(Serializable::json & node) const18 bool Config::Component::Marshal(Serializable::json &node) const
19 {
20     SetValue(node[GET_NAME(description)], description);
21     SetValue(node[GET_NAME(lib)], lib);
22     SetValue(node[GET_NAME(constructor)], constructor);
23     SetValue(node[GET_NAME(destructor)], destructor);
24     SetValue(node[GET_NAME(params)], params);
25     return true;
26 }
27 
Unmarshal(const Serializable::json & node)28 bool Config::Component::Unmarshal(const Serializable::json &node)
29 {
30     GetValue(node, GET_NAME(description), description);
31     GetValue(node, GET_NAME(lib), lib);
32     GetValue(node, GET_NAME(constructor), constructor);
33     GetValue(node, GET_NAME(destructor), destructor);
34     GetValue(node, GET_NAME(params), params);
35     return true;
36 }
37 
Marshal(Serializable::json & node) const38 bool Config::Marshal(Serializable::json &node) const
39 {
40     SetValue(node[GET_NAME(processLabel)], processLabel);
41     SetValue(node[GET_NAME(version)], version);
42     SetValue(node[GET_NAME(features)], features);
43     SetValue(node[GET_NAME(plugins)], plugins);
44     SetValue(node[GET_NAME(components)], components);
45     return true;
46 }
47 
Unmarshal(const Serializable::json & node)48 bool Config::Unmarshal(const Serializable::json &node)
49 {
50     GetValue(node, GET_NAME(processLabel), processLabel);
51     GetValue(node, GET_NAME(version), version);
52     GetValue(node, GET_NAME(features), features);
53     GetValue(node, GET_NAME(plugins), plugins);
54     GetValue(node, GET_NAME(components), components);
55     return true;
56 }
57 } // namespace OHOS::MiscServices