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 #ifndef API_CORE_OS_IPLATFORM_H 17 #define API_CORE_OS_IPLATFORM_H 18 19 #include <cstdint> 20 21 #include <base/containers/string.h> 22 #include <base/containers/string_view.h> 23 #include <base/containers/unique_ptr.h> 24 #include <base/containers/vector.h> 25 #include <core/namespace.h> 26 #include <core/os/platform_create_info.h> 27 28 CORE_BEGIN_NAMESPACE() 29 struct PlatformData; 30 class IPluginRegister; 31 class IFileManager; 32 33 class IPlatform { 34 public: 35 using Ptr = BASE_NS::unique_ptr<IPlatform>; 36 37 /** Get platform specific data 38 * @return Platform specific data struct 39 */ 40 virtual const PlatformData& GetPlatformData() const = 0; 41 virtual BASE_NS::string RegisterDefaultPaths(IFileManager& fileManager) = 0; 42 /** Register platform specific plugin locations 43 * @param registry Plugin registry instance to register paths to 44 */ 45 virtual void RegisterPluginLocations(IPluginRegister& registry) = 0; 46 47 protected: 48 // Needed for unique_ptr usage 49 friend BASE_NS::default_delete<IPlatform>; 50 IPlatform() = default; 51 virtual ~IPlatform() = default; 52 }; 53 54 /** @} */ 55 CORE_END_NAMESPACE() 56 57 #endif // API_CORE_OS_IPLATFORM_H 58