1365d9939Sopenharmony_ci/* 2365d9939Sopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3365d9939Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4365d9939Sopenharmony_ci * you may not use this file except in compliance with the License. 5365d9939Sopenharmony_ci * You may obtain a copy of the License at 6365d9939Sopenharmony_ci * 7365d9939Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8365d9939Sopenharmony_ci * 9365d9939Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10365d9939Sopenharmony_ci * miscservices under the License is miscservices on an "AS IS" BASIS, 11365d9939Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12365d9939Sopenharmony_ci * See the License for the specific language governing permissions and 13365d9939Sopenharmony_ci * limitations under the License. 14365d9939Sopenharmony_ci */ 15365d9939Sopenharmony_ci 16365d9939Sopenharmony_ci#ifndef SCREENLOCK_DFX_COMMAND_H 17365d9939Sopenharmony_ci#define SCREENLOCK_DFX_COMMAND_H 18365d9939Sopenharmony_ci 19365d9939Sopenharmony_ci#include <string> 20365d9939Sopenharmony_ci#include <vector> 21365d9939Sopenharmony_ci 22365d9939Sopenharmony_cinamespace OHOS { 23365d9939Sopenharmony_cinamespace ScreenLock { 24365d9939Sopenharmony_ciclass Command { 25365d9939Sopenharmony_cipublic: 26365d9939Sopenharmony_ci using Action = std::function<bool(const std::vector<std::string> &input, std::string &output)>; 27365d9939Sopenharmony_ci explicit Command() = default; 28365d9939Sopenharmony_ci Command(const std::vector<std::string> &argsFormat, const std::string &help, const Action &action); 29365d9939Sopenharmony_ci Command(const std::vector<std::string> &argsFormat, const std::string &help); 30365d9939Sopenharmony_ci virtual ~Command() = default; 31365d9939Sopenharmony_ci virtual std::string ShowHelp(); 32365d9939Sopenharmony_ci virtual bool DoAction(const std::vector<std::string> &vector, std::string &output); 33365d9939Sopenharmony_ci virtual std::string GetOption(); 34365d9939Sopenharmony_ci virtual std::string GetFormat(); 35365d9939Sopenharmony_ci 36365d9939Sopenharmony_ciprivate: 37365d9939Sopenharmony_ci std::vector<std::string> format; 38365d9939Sopenharmony_ci std::string help; 39365d9939Sopenharmony_ci Action action; 40365d9939Sopenharmony_ci}; 41365d9939Sopenharmony_ci} // namespace ScreenLock 42365d9939Sopenharmony_ci} // namespace OHOS 43365d9939Sopenharmony_ci 44365d9939Sopenharmony_ci#endif // SCREENLOCK_DFX_COMMAND_H