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