1 /*
2  * Copyright (c) 2024 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 "metadata/auto_launch_meta_data.h"
17 
18 #include "utils/constant.h"
19 namespace OHOS::DistributedData {
20 
AutoLaunchMetaData()21 AutoLaunchMetaData::AutoLaunchMetaData()
22 {
23 }
24 
Marshal(json & node) const25 bool AutoLaunchMetaData::Marshal(json& node) const
26 {
27     SetValue(node[GET_NAME(datas)], datas);
28     SetValue(node[GET_NAME(launchForCleanData)], launchForCleanData);
29     return true;
30 }
31 
Unmarshal(const json & node)32 bool AutoLaunchMetaData::Unmarshal(const json& node)
33 {
34     GetValue(node, GET_NAME(datas), datas);
35     GetValue(node, GET_NAME(launchForCleanData), launchForCleanData);
36     return true;
37 }
38 
GetPrefix(const std::initializer_list<std::string> & fields)39 std::string AutoLaunchMetaData::GetPrefix(const std::initializer_list<std::string>& fields)
40 {
41     return Constant::Join(PREFIX, Constant::KEY_SEPARATOR, fields);
42 }
43 }