Itasca C++ Interface
Loading...
Searching...
No Matches
itextinput.h
1#ifndef _ITEXTINPUT_H
2#define _ITEXTINPUT_H
3
4namespace itasca {
10 struct InputLine {
11 inline InputLine(const IString &t,const IString &s,uint l,bool us,bool in=false)
12 : text_(t), source_(s), line_(l), undoStart_(us), interactive_(in) { }
13 IString text_; // Actual text line input.
14 IString source_; // Description of where the input came from, terminal, file, etc.
15 uint32 line_; // Line number of where the input came from, if applicable.
16 bool undoStart_; // TRUE if this line is a start of a block of 1 or more lines that
17 // can be undone.
18 bool interactive_; // TRUE if this line came from an interactive source.
19 bool safeInterruptAllowed_ = true; // TRUE if the input source supports repeatable interrupting.
20 bool undone_ = false; // TRUE if a command that has been undone with smart undo, or a smart
21 // undo command.
22 };
23
24 struct InputContext {
25 inline InputContext() : wait_(true), undoAllowed_(true), continuation_(false) { }
26 IString prompt_; // Prompt to use for interactive sources.
27 IString starting_; // Starting contents (if any) for prompted input.
28 bool wait_; // If TRUE will wait till input available, otherwise if none
29 // available will return with a null string immediately.
30 bool undoAllowed_; // If FALSE this input cannot be used as a starting mark for an UNDO
31 // operation, must skip over.
32 bool continuation_; // If TRUE this input is considered a continuation of a previous
33 // input, for the purposes of collecting input lines
34 // representing a single operation.
35 bool checkExpectedError_ = true; // Check each line of input for first '!' character, and tag input source if present.
36 bool checkExpectedWarning_ = true; // Check each line of input for first '*' character, and tag input source if present.
37 };
38
39 class ITextInput {
40 public:
46 virtual InputLine getInput(const InputContext &context)=0;
47 };
48} // /namespace itasca
49namespace utility {
53}
54#endif
55// EOF
56
Definition istring.h:14
Definition itextinput.h:39
virtual InputLine getInput(const InputContext &context)=0
namespace Itasca
Definition basememory.cpp:10
namespace itasca
Definition igenerictet.h:11
Definition itextinput.h:24
Provides a interface for getting text.
Definition itextinput.h:10