1 /** 2 * Copyright (c) 2021-2022 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 panda { 24 25 /** 26 * For application related feature. 27 */ 28 class RuntimeController { 29 public: 30 RuntimeController() = default; 31 32 ~RuntimeController() = default; 33 IsZidaneApp()34 bool IsZidaneApp() const 35 { 36 return is_zidane_app_; 37 } 38 SetZidaneApp(bool is_zidane_app)39 void SetZidaneApp(bool is_zidane_app) 40 { 41 is_zidane_app_ = is_zidane_app; 42 } 43 IsMultiFramework()44 bool IsMultiFramework() const 45 { 46 return is_multi_framework_; 47 } 48 SetMultiFramework(bool is_multi_framework)49 void SetMultiFramework(bool is_multi_framework) 50 { 51 is_multi_framework_ = is_multi_framework; 52 } 53 54 bool CanLoadPandaFileInternal(std::string_view real_path) const; 55 56 bool CanLoadPandaFile(const std::string &path) const; 57 58 NO_COPY_SEMANTIC(RuntimeController); 59 NO_MOVE_SEMANTIC(RuntimeController); 60 61 private: 62 bool is_zidane_app_ {false}; 63 bool is_multi_framework_ {false}; 64 }; 65 66 } // namespace panda 67 68 #endif 69