5 #include <Poco/SharedPtr.h>
7 #include "io/Printable.h"
18 typedef Poco::SharedPtr<ConsoleSessionImpl> Ptr;
25 virtual std::string
readUntil(
const char c) = 0;
30 virtual std::string
readBytes(
const unsigned int length) = 0;
35 virtual void print(
const std::string &text,
bool newline =
true) = 0;
46 std::string
iosReadUntil(std::istream &in,
const char c);
51 std::string
iosReadBytes(std::istream &in,
const unsigned int length);
56 void iosPrint(std::ostream &out,
const std::string &text,
bool newline);
84 std::string
readBytes(
const unsigned int length);
90 void print(
const std::string &text,
bool newline =
true)
override;
98 ConsoleSessionImpl::Ptr m_impl;
101 std::string m_prompt;
112 typedef Poco::SharedPtr<Console> Ptr;
117 void setEol(
const char c);
120 void setSkipEol(
const char c);
121 char skipEol()
const;
123 void setPrompt(
const std::string &prompt);
124 std::string prompt()
const;
126 virtual void close();
129 virtual ConsoleSessionImpl::Ptr openSession() = 0;
133 std::string
readUntil(
const char c)
override;
134 std::string
readBytes(
const unsigned int length)
override;
135 void print(
const std::string &text,
bool newline =
true)
override;
139 ConsoleSessionImpl::Ptr closedSession();
144 std::string m_prompt;
virtual std::string readBytes(const unsigned int length)=0
void print(const std::string &text, bool newline=true) override
Definition: Console.cpp:89
void print(const std::string &text, bool newline=true) override
Definition: Console.cpp:159
std::string readLine()
Definition: Console.cpp:59
bool eof()
Definition: Console.cpp:94
virtual bool eof()
Definition: Console.cpp:15
Definition: Printable.h:8
std::string iosReadBytes(std::istream &in, const unsigned int length)
Definition: Console.cpp:27
void iosPrint(std::ostream &out, const std::string &text, bool newline)
Definition: Console.cpp:42
std::string readBytes(const unsigned int length)
Definition: Console.cpp:84
std::string readUntil(const char c) override
Definition: Console.cpp:149
std::string iosReadUntil(std::istream &in, const char c)
Definition: Console.cpp:20
Definition: Console.h:131
std::string readBytes(const unsigned int length) override
Definition: Console.cpp:154
bool eof() override
Definition: Console.cpp:163
virtual void print(const std::string &text, bool newline=true)=0
Definition: Console.h:109
virtual std::string readUntil(const char c)=0