9 #ifndef __HOM_ShellIO_h__
10 #define __HOM_ShellIO_h__
34 InterpreterObject readline(
int size=-1)
40 self->readlineWithKeyboardInterrupt(
size);
41 if (UTtupleGet<1>(result))
47 return HOMconvertValueForInterpreter(UTtupleGet<0>(result),
51 void addCloseCallback(InterpreterObject callback)
52 {
self->addOpaqueCloseCallback(callback); }
54 void removeCloseCallback(InterpreterObject callback)
55 {
self->removeOpaqueCloseCallback(callback); }
59 std::vector<InterpreterObject> closeCallbacks()
61 std::vector<void *> opaque_callbacks(self->opaqueCloseCallbacks());
63 std::vector<InterpreterObject> callbacks;
64 for (
int i=0; i < opaque_callbacks.size(); ++i)
65 callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
69 std::vector<InterpreterObject> CloseCallbacks()
71 std::vector<void *> opaque_callbacks(self->opaqueCloseCallbacks());
73 std::vector<InterpreterObject> callbacks;
74 for (
int i=0; i < opaque_callbacks.size(); ++i)
75 callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
80 void addExitCallback(InterpreterObject callback)
81 {
self->addOpaqueCloseCallback(callback); }
82 void removeExitCallback(InterpreterObject callback)
83 {
self->removeOpaqueCloseCallback(callback); }
84 std::vector<InterpreterObject> exitCallbacks()
86 std::vector<void *> opaque_callbacks(self->opaqueCloseCallbacks());
88 std::vector<InterpreterObject> callbacks;
89 for (
int i=0; i < opaque_callbacks.size(); ++i)
90 callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
101 readlineWithKeyboardInterrupt(
int size) = 0;
104 virtual void addOpaqueCloseCallback(
void *callback) = 0;
106 virtual void removeOpaqueCloseCallback(
void *callback) = 0;
108 virtual std::vector<void *> opaqueCloseCallbacks() = 0;
110 virtual void executeCloseCallbacks() = 0;
119 virtual bool hasWrittenData() = 0;
125 virtual std::stringstream &getDataStream() = 0;
133 virtual void addDataForReading(
const char *
data) = 0;
138 virtual void addEOFForReading() = 0;
143 virtual void interruptShellThread() = 0;
149 virtual bool isWaitingForCommand() = 0;
150 virtual void setIsWaitingForCommand(
bool on) = 0;
155 virtual void ensureIsReady() = 0;
157 virtual bool isatty() = 0;
158 virtual void flush() = 0;
163 virtual void quitShell() = 0;
#define HOM_DESTRUCT_OBJECT(pointer)
GLsizei const GLchar *const * string
std::tuple< Types...> UT_Tuple
**But if you need a result
void ignore(T const &) VULKAN_HPP_NOEXCEPT
#define HOM_CONSTRUCT_OBJECT(pointer)
HOM_ShellIO(const HOM_ShellIO &)
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
void write(T &out, bool v)