1 /* 2 * Copyright (c) 2021 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 FOUNDATION_ACE_FRAMEWORKS_BRIDGE_COMMON_MANIFEST_MANIFEST_APPINFO_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BRIDGE_COMMON_MANIFEST_MANIFEST_APPINFO_H 18 19 #include <string> 20 21 #include "base/json/json_util.h" 22 #include "base/log/log.h" 23 #include "base/memory/referenced.h" 24 25 namespace OHOS::Ace::Framework { 26 27 class ManifestAppInfo : public Referenced { 28 public: 29 ManifestAppInfo() = default; 30 ~ManifestAppInfo() override = default; 31 32 // JS application description. 33 const std::string& GetAppID() const; 34 const std::string& GetAppName() const; 35 const std::string& GetIcon() const; 36 const std::string& GetVersionName() const; 37 uint32_t GetVersionCode() const; GetMinPlatformVersion()38 int32_t GetMinPlatformVersion() const 39 { 40 return minPlatformVersion_; 41 } 42 43 // Global config information. 44 const std::string& GetLogLevel() const; 45 46 void AppInfoParse(const std::unique_ptr<JsonValue>& root); 47 48 void ParseI18nJsonInfo(); 49 50 private: 51 std::string appName_; 52 std::string versionName_; 53 uint32_t versionCode_ = 0; 54 std::string logLevel_; 55 std::string icon_; 56 std::string appID_; 57 int32_t minPlatformVersion_ = 0; 58 59 ACE_DISALLOW_COPY_AND_MOVE(ManifestAppInfo); 60 }; 61 62 } // namespace OHOS::Ace::Framework 63 64 #endif // FOUNDATION_ACE_FRAMEWORKS_BRIDGE_COMMON_MANIFEST_MANIFEST_APPINFO_H 65