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 #ifndef OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CLOUD_CLOUD_CONFIG_MANAGER_H 16 #define OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CLOUD_CLOUD_CONFIG_MANAGER_H 17 #include <string> 18 #include <vector> 19 #include <map> 20 #include <shared_mutex> 21 #include "visibility.h" 22 namespace OHOS { 23 namespace DistributedData { 24 class CloudConfigManager { 25 public: 26 struct Info { 27 std::string localBundle; 28 std::string cloudBundle; 29 }; 30 API_EXPORT static CloudConfigManager &GetInstance(); 31 API_EXPORT void Initialize(const std::vector<Info> &mapper); 32 API_EXPORT std::string ToLocal(const std::string &bundleName); 33 API_EXPORT std::string ToCloud(const std::string &bundleName); 34 35 private: 36 std::map<std::string, std::string> toLocalMapper_; 37 std::map<std::string, std::string> toCloudMapper_; 38 }; 39 40 } // namespace DistributedData 41 } // namespace OHOS 42 #endif //OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_CLOUD_CLOUD_CONFIG_MANAGER_H 43