Itasca C++ Interface
Loading...
Searching...
No Matches
common
utility
interface
itextinput.h
1
#ifndef _ITEXTINPUT_H
2
#define _ITEXTINPUT_H
3
4
namespace
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
49
namespace
utility
{
50
using
itasca::InputLine
;
51
using
itasca::InputContext
;
52
using
itasca::ITextInput
;
53
}
54
#endif
55
// EOF
56
IString
Definition
istring.h:14
itasca::ITextInput
Definition
itextinput.h:39
itasca::ITextInput::getInput
virtual InputLine getInput(const InputContext &context)=0
itasca
namespace Itasca
Definition
basememory.cpp:10
utility
namespace itasca
Definition
igenerictet.h:11
itasca::InputContext
Definition
itextinput.h:24
itasca::InputLine
Provides a interface for getting text.
Definition
itextinput.h:10
Generated by
1.10.0