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