1 /* 2 * Copyright (c) 2024-2025 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 HIVIEW_BASE_EVENT_EXPORT_CONFIG_MGR_H 17 #define HIVIEW_BASE_EVENT_EXPORT_CONFIG_MGR_H 18 19 #include <map> 20 #include <memory> 21 #include <string> 22 23 #include "export_config_parser.h" 24 25 namespace OHOS { 26 namespace HiviewDFX { 27 class ExportConfigManager { 28 public: 29 static ExportConfigManager& GetInstance(); 30 31 void GetModuleNames(std::vector<std::string>& moduelNames) const; 32 void GetAllExportConfigs(std::vector<std::shared_ptr<ExportConfig>>& configs) const; 33 std::shared_ptr<ExportConfig> GetExportConfig(const std::string& moduleName) const; 34 35 private: 36 ExportConfigManager(); 37 ~ExportConfigManager() = default; 38 void Init(); 39 void ParseConfigFiles(const std::vector<std::string>& configFiles); 40 void ParseConfigFile(const std::string& configFile); 41 42 private: 43 std::map<std::string, std::shared_ptr<ExportConfig>> exportConfigs_; 44 }; 45 } // HiviewDFX 46 } // OHOS 47 48 #endif // HIVIEW_BASE_EVENT_EXPORT_CONFIG_MGR_H 49