1 /** 2 * Copyright (c) 2021-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 RUNTIME_RUNTIME_CONTROLLER_H_ 17 #define RUNTIME_RUNTIME_CONTROLLER_H_ 18 19 #include <string_view> 20 21 #include "libpandabase/macros.h" 22 23 namespace ark { 24 25 /// For application related feature. 26 class RuntimeController { 27 public: 28 RuntimeController() = default; 29 30 ~RuntimeController() = default; 31 IsZidaneApp()32 bool IsZidaneApp() const 33 { 34 return isZidaneApp_; 35 } 36 SetZidaneApp(bool isZidaneApp)37 void SetZidaneApp(bool isZidaneApp) 38 { 39 isZidaneApp_ = isZidaneApp; 40 } 41 IsMultiFramework()42 bool IsMultiFramework() const 43 { 44 return isMultiFramework_; 45 } 46 SetMultiFramework(bool isMultiFramework)47 void SetMultiFramework(bool isMultiFramework) 48 { 49 isMultiFramework_ = isMultiFramework; 50 } 51 52 PANDA_PUBLIC_API bool CanLoadPandaFileInternal(std::string_view realPath) const; 53 54 bool CanLoadPandaFile(const std::string &path) const; 55 56 NO_COPY_SEMANTIC(RuntimeController); 57 NO_MOVE_SEMANTIC(RuntimeController); 58 59 private: 60 bool isZidaneApp_ {false}; 61 bool isMultiFramework_ {false}; 62 }; 63 64 } // namespace ark 65 66 #endif 67