1 /* 2 * Copyright (c) 2020 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_APPEXECFWK_TOOLS_BM_INCLUDE_COMMAND_PARSER_H 17 #define FOUNDATION_APPEXECFWK_TOOLS_BM_INCLUDE_COMMAND_PARSER_H 18 19 #include "bundle_info_utils.h" 20 21 #include <stdint.h> 22 #include <string> 23 24 namespace OHOS { 25 class CommandParser { 26 public: 27 CommandParser() = default; 28 ~CommandParser() = default; 29 30 void HandleCommands(int32_t argc, char *argv[]) const; 31 private: 32 void RunAsInstallCommand(int32_t argc, char *argv[]) const; 33 void RunAsUninstallCommand(int32_t argc, char *argv[]) const; 34 void RunAsDumpCommand(int32_t argc, char *argv[]) const; 35 void RunAsGetUdidCommand(int32_t argc, char *argv[]) const; 36 void GetInstallBundleInfo(const std::string &bundleName) const; 37 void GetInstallBundleInfos(int32_t argc) const; 38 void GetBundleInfosByMetaDataKey(const std::string &metaDataKey) const; 39 void InfoPrint(const std::string &str) const; 40 #ifdef OHOS_DEBUG 41 void RunAsEnableCommand(int32_t argc, char *argv[]) const; 42 void SetDebugMode(const std::string &enable, int32_t mode) const; 43 #endif 44 }; 45 } // namespace OHOS 46 #endif // FOUNDATION_APPEXECFWK_TOOLS_BM_INCLUDE_COMMAND_PARSER_H 47