CommandExecutor.h
Go to the documentation of this file.
1 /*
2  * CommandExecutor.h
3  *
4  * Created on: 2 jul. 2015
5  * Author: Herman
6  */
7 
8 #pragma once
9 
10 #include "CommandHandler.h"
11 #include "CommandOutput.h"
12 #include <Data/Buffer/LineBuffer.h>
13 #include <memory>
14 
15 #ifndef DISABLE_NETWORK
16 #include <Network/TcpClient.h>
17 #endif
18 
19 #define MAX_COMMANDSIZE 64
20 
22 {
23 public:
24  CommandExecutor(const CommandExecutor&) = delete;
25  CommandExecutor& operator=(const CommandExecutor&) = delete;
26 
27 #ifndef DISABLE_NETWORK
28  CommandExecutor(TcpClient* cmdClient);
30 #endif
31  CommandExecutor(Stream* reqStream);
32 
33  int executorReceive(char* recvData, int recvSize);
34  int executorReceive(char recvChar);
35  int executorReceive(const String& recvString);
36  void setCommandEOL(char reqEOL);
37 
38 private:
40  void processCommandLine(const String& cmdString);
42  std::unique_ptr<CommandOutput> commandOutput;
43 };
Definition: WebsocketConnection.h:68
int executorReceive(char *recvData, int recvSize)
CommandExecutor & operator=(const CommandExecutor &)=delete
The String class.
Definition: WString.h:136
Definition: TcpClient.h:46
Definition: CommandExecutor.h:21
void setCommandEOL(char reqEOL)
Base Stream class.
Definition: Wiring/Stream.h:32