BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
SimpleConsole.h
1 #pragma once
2 
3 #include <iosfwd>
4 
5 #include <Poco/SharedPtr.h>
6 
7 #include "io/Console.h"
8 #include "io/Printable.h"
9 
10 namespace BeeeOn {
11 
17 class SimpleConsole : public Printable {
18 public:
19  SimpleConsole();
20  SimpleConsole(Poco::SharedPtr<Console> console);
21 
26  std::string readLine();
27 
32  std::string readBytes(const unsigned int length);
33 
38  void print(const std::string &text, bool newline = true) override;
39 
44  bool eof();
45 
49  void close();
50 
51  void setConsole(Poco::SharedPtr<Console> console);
52 
53 protected:
54  ConsoleSession &session();
55 
56 private:
57  Poco::SharedPtr<Console> m_console;
58  Poco::SharedPtr<ConsoleSession> m_session;
59 };
60 
61 }
Definition: Printable.h:8
std::string readBytes(const unsigned int length)
Definition: SimpleConsole.cpp:25
std::string readLine()
Definition: SimpleConsole.cpp:20
void close()
Definition: SimpleConsole.cpp:40
Definition: SimpleConsole.h:17
bool eof()
Definition: SimpleConsole.cpp:35
Definition: Console.h:70
void print(const std::string &text, bool newline=true) override
Definition: SimpleConsole.cpp:30