1 /* 2 * Copyright (c) 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 ACCESSTOKENMANAGER_COMMAND_H 17 #define ACCESSTOKENMANAGER_COMMAND_H 18 19 #include "shell_command.h" 20 21 namespace OHOS { 22 namespace Security { 23 namespace AccessToken { 24 const std::string TOOLS_NAME = "atm"; 25 const std::string HELP_MSG = "usage: atm <command>\n" 26 "These are common atm commands list:\n" 27 " help list available commands\n" 28 " dump list token info\n"; 29 30 class AtmCommand : public OHOS::AAFwk::ShellCommand { 31 public: 32 AtmCommand(int argc, char *argv[]); ~AtmCommand()33 ~AtmCommand() override 34 {} 35 36 private: 37 ErrCode CreateCommandMap() override; 38 ErrCode CreateMessageMap() override; 39 ErrCode init() override; 40 41 ErrCode RunAsHelpCommand(); 42 ErrCode RunAsDumpCommand(); 43 }; 44 } // namespace AccessToken 45 } // namespace Security 46 } // namespace OHOS 47 48 #endif // ACCESSTOKENMANAGER_COMMAND_H 49