Itasca C++ Interface
Loading...
Searching...
No Matches
common
utility
interface
itextinput.h
1
#ifndef _ITEXTINPUT_H
2
#define _ITEXTINPUT_H
3
4
#include "
base/src/basestring.h
"
5
6
namespace
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
51
namespace
utility
{
52
using
itasca::InputLine
;
53
using
itasca::InputContext
;
54
using
itasca::ITextInput
;
55
}
56
#endif
57
// EOF
58
basestring.h
includes std::string and additional functions not included in the standard.
itasca::ITextInput
Definition
itextinput.h:41
itasca::ITextInput::getInput
virtual InputLine getInput(const InputContext &context)=0
itasca
namespace Itasca
Definition
basememory.cpp:14
utility
namespace itasca
Definition
igenerictet.h:11
itasca::InputContext
Definition
itextinput.h:26
itasca::InputLine
Provides a interface for getting text.
Definition
itextinput.h:12
Generated by
1.10.0