MyGUI
3.2.0
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
MyGUIEngine
include
MyGUI_TextIterator.h
Go to the documentation of this file.
1
6
/*
7
This file is part of MyGUI.
8
9
MyGUI is free software: you can redistribute it and/or modify
10
it under the terms of the GNU Lesser General Public License as published by
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
13
14
MyGUI is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public License
20
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21
*/
22
#ifndef __MYGUI_TEXT_ITERATOR_H__
23
#define __MYGUI_TEXT_ITERATOR_H__
24
25
#include "
MyGUI_Prerequest.h
"
26
#include "
MyGUI_Colour.h
"
27
#include "
MyGUI_TextChangeHistory.h
"
28
#include "
MyGUI_IFont.h
"
29
30
namespace
MyGUI
31
{
32
33
class
MYGUI_EXPORT
TextIterator
34
{
35
private
:
36
TextIterator
();
37
38
public
:
39
TextIterator
(
const
UString
& _text,
VectorChangeInfo
* _history =
nullptr
);
40
41
bool
moveNext();
42
43
// возвращает цвет
44
bool
getTagColour(
UString
& _colour)
const
;
45
46
// удаляет цвет
47
void
clearTagColour();
48
49
bool
setTagColour(
const
Colour
& _colour);
50
51
bool
setTagColour(
UString
_colour);
52
53
// сохраняет текущий итератор
54
bool
saveStartPoint();
55
56
// возвращает строку от сохраненного итератора до текущего
57
UString
getFromStart();
58
59
// удаляет от запомненной точки до текущей
60
bool
eraseFromStart();
61
62
// возвращает текущую псевдо позицию
63
size_t
getPosition()
const
;
64
65
const
UString
& getText()
const
;
66
67
void
insertText(
const
UString
& _insert,
bool
_multiLine);
68
69
void
clearNewLine(
UString
& _text);
70
71
//очищает весь текст
72
void
clearText();
73
74
// возвращает размер строки
75
size_t
getSize()
const
;
76
77
void
setText(
const
UString
& _text,
bool
_multiLine);
78
79
void
cutMaxLength(
size_t
_max);
80
81
void
cutMaxLengthFromBeginning(
size_t
_max);
82
83
// возвращает текст без тегов
84
static
UString
getOnlyText(
const
UString
& _text);
85
86
static
UString
getTextNewLine();
87
88
static
UString
getTextCharInfo(
Char
_char);
89
90
// просто конвертируем цвет в строку
91
static
UString
convertTagColour(
const
Colour
& _colour);
92
93
static
UString
toTagsString(
const
UString
& _text);
94
95
private
:
96
// возвращает цвет
97
bool
getTagColour(
UString
& _colour,
UString::iterator
& _iter)
const
;
98
99
void
insert(
UString::iterator
& _start,
UString
& _insert);
100
101
UString::iterator
erase(
UString::iterator
_start,
UString::iterator
_end);
102
103
void
clear();
104
105
private
:
106
UString
mText;
107
UString::iterator
mCurrent, mEnd, mSave;
108
109
// позиция и размер
110
size_t
mPosition;
111
mutable
size_t
mSize;
112
bool
mFirst;
113
114
VectorChangeInfo
* mHistory;
115
};
116
117
}
// namespace MyGUI
118
119
#endif // __MYGUI_TEXT_ITERATOR_H__
MyGUI_Prerequest.h
MyGUI::VectorChangeInfo
std::vector< TextCommandInfo > VectorChangeInfo
Definition:
MyGUI_TextChangeHistory.h:75
MyGUI_IFont.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition:
MyGUI_Platform.h:120
MyGUI::Char
unsigned int Char
Definition:
MyGUI_Types.h:66
MyGUI::UString::_fwd_iterator
forward iterator for UString
Definition:
MyGUI_UString.h:244
MyGUI_Colour.h
MyGUI_TextChangeHistory.h
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition:
MyGUI_UString.h:169
MyGUI::Colour
Definition:
MyGUI_Colour.h:31
MyGUI::TextIterator
Definition:
MyGUI_TextIterator.h:33
Generated on Fri Jan 3 2014 01:14:26 for MyGUI by
1.8.5