diff --git a/cli/BUILD.gn b/cli/BUILD.gn new file mode 100644 index 0000000..6697971 --- /dev/null +++ b/cli/BUILD.gn @@ -0,0 +1,90 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("../gn/config.gni") +config("cli_config") { + defines = [ + "NOGDI", + ] + cflags = [ "-std=c++17" ] +} +ohos_static_library("cli_lite") { + configs = [ ":cli_config" ] + sources = [ + "CommandLine.cpp", + "CommandLineFactory.cpp", + "CommandLineInterface.cpp", + ] + + deps = [ + "../jsapp:jsapp_lite", + "../mock:mock_lite", + "../util:util_lite", + "//foundation/arkui/ace_engine_lite/frameworks/targets/simulator:ace_lite", + "//third_party/libwebsockets:websockets_static", + ] + + include_dirs = [ + ".", + "../util/", + "../jsapp/", + "../jsapp/lite/", + "//third_party/jsoncpp/include/json/", + "//foundation/graphic/ui/frameworks/", + "//foundation/graphic/ui/frameworks/dock/", + "//foundation/graphic/utils/interfaces/innerkits/", + "//foundation/graphic/utils/interfaces/kits/", + "//foundation/graphic/ui/interfaces/kits/", + "//foundation/graphic/ui/interfaces/innerkits/dock/", + "//foundation/graphic/ui/interfaces/innerkits/", + ] + + include_dirs += [ + "../mock/", + "../mock/lite/", + ] + + cflags = [ "-Wno-deprecated-declarations" ] +} + +ohos_static_library("cli_rich") { + configs = [ ":cli_config" ] + sources = [ + "CommandLine.cpp", + "CommandLineFactory.cpp", + "CommandLineInterface.cpp", + ] + + deps = [ + "../jsapp:jsapp_rich", + "../mock:mock_rich", + "../util:util_rich", + "//third_party/libwebsockets:websockets_static", + ] + + include_dirs = [ + ".", + "../util/", + "../jsapp/", + "../jsapp/rich/", + "//third_party/jsoncpp/include/json/", + ] + + include_dirs += [ + "../mock/", + "../mock/rich/", + ] + + include_dirs += os_include_dirs +} diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt new file mode 100644 index 0000000..b6fc81b --- /dev/null +++ b/cli/CMakeLists.txt @@ -0,0 +1,5 @@ +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} cli) + +add_library(cli STATIC ${cli}) +target_include_directories(cli PUBLIC ${CMAKE_CURRENT_LIST_DIR}) +target_link_libraries(cli util jsapp mock) diff --git a/cli/CommandLine.h b/cli/CommandLine.h new file mode 100644 index 0000000..13aa67d --- /dev/null +++ b/cli/CommandLine.h @@ -0,0 +1,455 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMANDLINE_H +#define COMMANDLINE_H + +#include + +#include "LocalSocket.h" + +class CommandLine { +public: + enum CommandType { SET = 0, GET, ACTION, INVALID }; + + CommandLine(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + virtual ~CommandLine(); + void CheckAndRun(); + void SetCommandResult(const std::string& type, const Json::Value& resultContent); + void SetResultToManager(const std::string& type, const Json::Value& resultContent, const std::string& messageType); + void RunAndSendResultToManager(); + void SendResultToManager(); + void SendResult(); + virtual void RunSet() {} + bool IsArgValid() const; + uint8_t ToUint8(std::string str) const; + void SetCommandName(std::string command); + +protected: + Json::Value args; + const LocalSocket& cliSocket; + Json::Value commandResult; + Json::Value commandResultToManager; + CommandType type; + std::string commandName; + const std::vector liteSupportedLanguages = {"zh-CN", "en-US"}; + const std::vector richSupportedLanguages = { + "zh_CN", "zh_HK", "zh_TW", "en_US", "en_GB", "ar_AE", "bg_BG", "bo_CN", "cs_CZ", "da_DK", + "de_DE", "el_GR", "en_PH", "es_ES", "es_LA", "fi_FI", "fr_FR", "he_IL", "hi_IN", "hu_HU", + "id_ID", "it_IT", "ja_JP", "kk_KZ", "ms_MY", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", + "ro_RO", "ru_RU", "sr_RS", "sv_SE", "th_TH", "tr_TR", "ug_CN", "uk_UA", "vi_VN" + }; + const std::vector LoadDocDevs = {"phone", "tablet", "wearable", "car", "tv"}; + const int maxWidth = 3000; + const int minWidth = 50; + const int maxDpi = 640; + const int minDpi = 120; + const int maxKeyVal = 2119; + const int minKeyVal = 2000; + const int maxActionVal = 2; + const int minActionVal = 0; + const int maxLoadDocWidth = 3000; + const int minLoadDocWidth = 20; + + virtual bool IsSetArgValid() const + { + return true; + } + virtual bool IsGetArgValid() const + { + return true; + } + virtual bool IsActionArgValid() const + { + return true; + } + virtual void RunGet() {} + virtual void RunAction() {} + + bool IsBoolType(std::string arg) const; + bool IsIntType(std::string arg) const; + bool IsOneDigitFloatType(std::string arg) const; + +private: + void Run(); +}; + +class TouchPressCommand : public CommandLine { +public: + TouchPressCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~TouchPressCommand() override {} + +protected: + void RunAction() override; + bool IsActionArgValid() const override; +}; + +class TouchMoveCommand : public CommandLine { +public: + TouchMoveCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~TouchMoveCommand() override {} + +protected: + void RunAction() override; + bool IsActionArgValid() const override; +}; + +class TouchReleaseCommand : public CommandLine { +public: + TouchReleaseCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~TouchReleaseCommand() override {} + +protected: + void RunAction() override; +}; + +class MouseWheelCommand : public CommandLine { +public: + MouseWheelCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~MouseWheelCommand() override {} + +protected: + void RunAction() override; + bool IsActionArgValid() const override; +}; + +class BackClickedCommand : public CommandLine { +public: + BackClickedCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~BackClickedCommand() override {} + +protected: + void RunAction() override; +}; + +class RestartCommand : public CommandLine { +public: + RestartCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~RestartCommand() override {} + +protected: + void RunAction() override; +}; + +class PowerCommand : public CommandLine { +public: + PowerCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~PowerCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class VolumeCommand : public CommandLine { +public: + VolumeCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~VolumeCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class BarometerCommand : public CommandLine { +public: + BarometerCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~BarometerCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class ResolutionSwitchCommand : public CommandLine { +public: + ResolutionSwitchCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~ResolutionSwitchCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; + bool IsIntValValid(const Json::Value& args) const; +}; + +class OrientationCommand : public CommandLine { +public: + OrientationCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~OrientationCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; +}; + +class ColorModeCommand : public CommandLine { +public: + ColorModeCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~ColorModeCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; +}; + +class LanguageCommand : public CommandLine { +public: + LanguageCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~LanguageCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class FontSelectCommand : public CommandLine { +public: + FontSelectCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~FontSelectCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; +}; + +class MemoryRefreshCommand : public CommandLine { +public: + MemoryRefreshCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~MemoryRefreshCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; +}; + +class LoadDocumentCommand : public CommandLine { +public: + LoadDocumentCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~LoadDocumentCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; + bool IsIntValValid(const Json::Value& previewParam) const; + bool IsStrValVailid(const Json::Value& previewParam) const; +}; + +class ReloadRuntimePageCommand : public CommandLine { +public: + ReloadRuntimePageCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~ReloadRuntimePageCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; +}; + +class CurrentRouterCommand : public CommandLine { +public: + CurrentRouterCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~CurrentRouterCommand() override {} + +protected: + void RunGet() override; +}; + +class SupportedLanguagesCommand : public CommandLine { +public: + SupportedLanguagesCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~SupportedLanguagesCommand() override {} + +protected: + void RunGet() override; +}; + +class LocationCommand : public CommandLine { +public: + LocationCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~LocationCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class DistributedCommunicationsCommand : public CommandLine { +public: + DistributedCommunicationsCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~DistributedCommunicationsCommand() override {} + +protected: + void RunAction() override; + bool IsActionArgValid() const override; + std::vector StringToCharVector(std::string str) const; +}; + +class KeepScreenOnStateCommand : public CommandLine { +public: + KeepScreenOnStateCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~KeepScreenOnStateCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class WearingStateCommand : public CommandLine { +public: + WearingStateCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~WearingStateCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class BrightnessModeCommand : public CommandLine { +public: + BrightnessModeCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~BrightnessModeCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class ChargeModeCommand : public CommandLine { +public: + ChargeModeCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~ChargeModeCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class BrightnessCommand : public CommandLine { +public: + BrightnessCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~BrightnessCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class HeartRateCommand : public CommandLine { +public: + HeartRateCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~HeartRateCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class StepCountCommand : public CommandLine { +public: + StepCountCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~StepCountCommand() override {} + void RunSet() override; + +protected: + void RunGet() override; + bool IsSetArgValid() const override; +}; + +class ExitCommand : public CommandLine { +public: + ExitCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~ExitCommand() override {} + +protected: + void RunAction() override; +}; + +class InspectorJSONTree : public CommandLine { +public: + InspectorJSONTree(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~InspectorJSONTree() override {} + +protected: + void RunAction() override; +}; + +class InspectorDefault : public CommandLine { +public: + InspectorDefault(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~InspectorDefault() override {} + +protected: + void RunAction() override; +}; + +class DeviceTypeCommand : public CommandLine { +public: + DeviceTypeCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~DeviceTypeCommand() override {} + +protected: + void RunSet() override; +}; + +class ResolutionCommand : public CommandLine { +public: + ResolutionCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~ResolutionCommand() override {} + +protected: + void RunSet() override; +}; + +class FastPreviewMsgCommand : public CommandLine { +public: + FastPreviewMsgCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~FastPreviewMsgCommand() override {} + +protected: + void RunGet() override; +}; + +class DropFrameCommand : public CommandLine { +public: + DropFrameCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~DropFrameCommand() override {} + void RunSet() override; + +protected: + bool IsSetArgValid() const override; +}; + +class KeyPressCommand : public CommandLine { +public: + KeyPressCommand(CommandType commandType, const Json::Value& arg, const LocalSocket& socket); + ~KeyPressCommand() override {} + +protected: + void RunAction() override; + bool IsActionArgValid() const override; + bool IsImeArgsValid() const; + bool IsKeyArgsValid() const; +}; +#endif // COMMANDLINE_H diff --git a/cli/CommandLineFactory.cpp b/cli/CommandLineFactory.cpp new file mode 100644 index 0000000..f105304 --- /dev/null +++ b/cli/CommandLineFactory.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CommandLineFactory.h" + +#include "CommandLineInterface.h" +#include "CommandParser.h" +#include "JsApp.h" +#include "PreviewerEngineLog.h" +#include "TraceTool.h" + +CommandLineFactory::CommandTypeMap CommandLineFactory::typeMap = CommandLineFactory::CommandTypeMap(); +CommandLineFactory::CommandLineFactory() {} + +using namespace std; + +void CommandLineFactory::InitCommandMap() +{ + CommandParser& cmdParser = CommandParser::GetInstance(); + string deviceType = cmdParser.GetDeviceType(); + bool isLiteDevice = JsApp::IsLiteDevice(deviceType); + if (!isLiteDevice) { + typeMap["BackClicked"] = &CommandLineFactory::CreateObject; + typeMap["inspector"] = &CommandLineFactory::CreateObject; + typeMap["inspectorDefault"] = &CommandLineFactory::CreateObject; + typeMap["ColorMode"] = &CommandLineFactory::CreateObject; + typeMap["Orientation"] = &CommandLineFactory::CreateObject; + typeMap["ResolutionSwitch"] = &CommandLineFactory::CreateObject; + typeMap["CurrentRouter"] = &CommandLineFactory::CreateObject; + typeMap["ReloadRuntimePage"] = &CommandLineFactory::CreateObject; + typeMap["FontSelect"] = &CommandLineFactory::CreateObject; + typeMap["MemoryRefresh"] = &CommandLineFactory::CreateObject; + typeMap["LoadDocument"] = &CommandLineFactory::CreateObject; + typeMap["FastPreviewMsg"] = &CommandLineFactory::CreateObject; + typeMap["DropFrame"] = &CommandLineFactory::CreateObject; + typeMap["KeyPress"] = &CommandLineFactory::CreateObject; + } else { + typeMap["Power"] = &CommandLineFactory::CreateObject; + typeMap["Volume"] = &CommandLineFactory::CreateObject; + typeMap["Barometer"] = &CommandLineFactory::CreateObject; + typeMap["Location"] = &CommandLineFactory::CreateObject; + typeMap["KeepScreenOnState"] = &CommandLineFactory::CreateObject; + typeMap["WearingState"] = &CommandLineFactory::CreateObject; + typeMap["BrightnessMode"] = &CommandLineFactory::CreateObject; + typeMap["ChargeMode"] = &CommandLineFactory::CreateObject; + typeMap["Brightness"] = &CommandLineFactory::CreateObject; + typeMap["HeartRate"] = &CommandLineFactory::CreateObject; + typeMap["StepCount"] = &CommandLineFactory::CreateObject; + typeMap["DistributedCommunications"] = &CommandLineFactory::CreateObject; + typeMap["CrownRotate"] = &CommandLineFactory::CreateObject; + } + typeMap["MousePress"] = &CommandLineFactory::CreateObject; + typeMap["MouseRelease"] = &CommandLineFactory::CreateObject; + typeMap["MouseMove"] = &CommandLineFactory::CreateObject; + typeMap["Language"] = &CommandLineFactory::CreateObject; + typeMap["SupportedLanguages"] = &CommandLineFactory::CreateObject; + typeMap["exit"] = &CommandLineFactory::CreateObject; + typeMap["Resolution"] = &CommandLineFactory::CreateObject; + typeMap["DeviceType"] = &CommandLineFactory::CreateObject; +} + +unique_ptr CommandLineFactory::CreateCommandLine(string command, + CommandLine::CommandType type, + Json::Value val, + const LocalSocket& socket) +{ + if (typeMap.find(command) == typeMap.end()) { + Json::Value commandResult; + commandResult["version"] = CommandLineInterface::COMMAND_VERSION; + commandResult["command"] = command; + commandResult["result"] = "Unsupported command"; + socket << commandResult.toStyledString(); + ELOG("Unsupported command"); + TraceTool::GetInstance().HandleTrace("Mismatched SDK version"); + return nullptr; + } + if (typeMap[command] == nullptr) { + ELOG("CommandLineFactory::CreateCommandLine:typeMap is null"); + } + ILOG("Create Command: %s", command.c_str()); + unique_ptr cmdLine = typeMap[command](type, val, socket); + if (cmdLine == nullptr) { + ELOG("CommandLineFactory::CreateCommandLine:cmdLine is null"); + } + cmdLine->SetCommandName(command); + return cmdLine; +} + +template +unique_ptr + CommandLineFactory::CreateObject(CommandLine::CommandType type, const Json::Value& args, const LocalSocket& socket) +{ + return make_unique(type, args, socket); +} diff --git a/cli/CommandLineFactory.h b/cli/CommandLineFactory.h new file mode 100644 index 0000000..96c9e7f --- /dev/null +++ b/cli/CommandLineFactory.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMANDLINEFACTORY_H +#define COMMANDLINEFACTORY_H + +#include + +#include "CommandLine.h" + +class CommandLineFactory { +public: + CommandLineFactory(); + ~CommandLineFactory() {} + static void InitCommandMap(); + static std::unique_ptr CreateCommandLine(std::string command, + CommandLine::CommandType type, + Json::Value args, + const LocalSocket& socket); + +private: + template + static std::unique_ptr + CreateObject(CommandLine::CommandType, const Json::Value&, const LocalSocket& socket); + using CommandTypeMap = std::map< + std::string, + std::unique_ptr (*)(CommandLine::CommandType, const Json::Value&, const LocalSocket& socket)>; + static CommandTypeMap typeMap; +}; + +#endif // COMMANDLINEFACTORY_H diff --git a/cli/CommandLineInterface.h b/cli/CommandLineInterface.h new file mode 100644 index 0000000..e892edc --- /dev/null +++ b/cli/CommandLineInterface.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMANDLINEINTERFACE_H +#define COMMANDLINEINTERFACE_H + +#include + +#include "CommandLine.h" +#include "LocalSocket.h" +#include "json.h" + +class CommandLineInterface { +public: + CommandLineInterface(const CommandLineInterface&) = delete; + CommandLineInterface& operator=(const CommandLineInterface&) = delete; + void InitPipe(const std::string name); + static CommandLineInterface& GetInstance(); + static void SendJsonData(const Json::Value&); + void SendJSHeapMemory(size_t total, size_t alloc, size_t peak) const; + void SendWebsocketStartupSignal() const; + void ProcessCommand() const; + void ProcessCommandMessage(std::string message) const; + void ApplyConfig(const Json::Value& val) const; + void ApplyConfigMembers(const Json::Value& commands, const Json::Value::Members& members) const; + void ApplyConfigCommands(const std::string& key, const std::unique_ptr& command) const; + void Init(std::string pipeBaseName); + void ReadAndApplyConfig(std::string path) const; + void CreatCommandToSendData(const std::string, const Json::Value, const std::string) const; + + const static std::string COMMAND_VERSION; + +private: + explicit CommandLineInterface(); + virtual ~CommandLineInterface(); + bool ProcessCommandValidate(bool parsingSuccessful, const Json::Value& jsonData, const std::string& errors) const; + CommandLine::CommandType GetCommandType(std::string) const; + std::unique_ptr socket; + const static uint32_t MAX_COMMAND_LENGTH = 128; + static bool isFirstWsSend; + static bool isPipeConnected; +}; + +#endif // COMMANDLINEINTERFACE_H