1 /* 2 * Copyright (c) 2022 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 #ifndef SECURITY_GUARD_MODEL_CFG_MARSHALLING_H 17 #define SECURITY_GUARD_MODEL_CFG_MARSHALLING_H 18 19 #include <string> 20 #include <vector> 21 22 #include "nlohmann/json.hpp" 23 24 #include "config_define.h" 25 26 namespace OHOS::Security::SecurityGuard { 27 void from_json(const nlohmann::json &jsonObj, AppDetectionCfg &config); 28 void from_json(const nlohmann::json &jsonObj, Field &field); 29 void from_json(const nlohmann::json &jsonObj, Rule &rule); 30 void from_json(const nlohmann::json &jsonObj, BuildInDetectionCfg &config); 31 void to_json(nlohmann::json &jsonObj, const ModelCfg &modelCfg); 32 void from_json(const nlohmann::json &jsonObj, ModelCfg &modelCfg); 33 void to_json(nlohmann::json &jsonObj, const EventCfg &eventCfg); 34 void from_json(const nlohmann::json &jsonObj, EventCfg &eventCfg); 35 void to_json(nlohmann::json &jsonObj, const DataMgrCfgSt &dataMgrCfg); 36 void from_json(const nlohmann::json &jsonObj, DataMgrCfgSt &dataMgrCfg); 37 void to_json(nlohmann::json &jsonObj, const SecEvent &eventDataSt); 38 void to_json(nlohmann::json &jsonObj, const EventContentSt &eventContentSt); 39 void from_json(const nlohmann::json &jsonObj, EventContentSt &eventContentSt); 40 } // namespace OHOS::Security::SecurityGuard 41 42 #endif // SECURITY_GUARD_MODEL_CFG_MARSHALLING_H 43