1 /* 2 * Copyright (c) 2024-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 OHOS_RESTOOL_DUMP_PARSER_H 17 #define OHOS_RESTOOL_DUMP_PARSER_H 18 19 #include <memory> 20 #include <string> 21 #include "cmd_parser.h" 22 23 namespace OHOS { 24 namespace Global { 25 namespace Restool { 26 class DumpParserBase : public virtual CmdParserBase { 27 public: 28 virtual ~DumpParserBase() = default; 29 uint32_t ParseOption(int argc, char *argv[], int currentIndex) override; 30 void ShowUseage() override; 31 const std::string &GetInputPath() const; 32 33 protected: 34 std::string inputPath_; 35 }; 36 37 class DumpParser : public virtual DumpParserBase { 38 public: 39 DumpParser(); 40 uint32_t ExecCommand() override; 41 }; 42 43 class DumpConfigParser : public virtual DumpParserBase { 44 public: 45 DumpConfigParser(); 46 virtual ~DumpConfigParser() = default; 47 uint32_t ExecCommand() override; 48 }; 49 } // namespace Restool 50 } // namespace Global 51 } // namespace OHOS 52 #endif 53