OpenTTD
string_type.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef STRING_TYPE_H
13 #define STRING_TYPE_H
14 
15 #include "core/enum_type.hpp"
16 #include <vector>
17 #include <string>
18 
20 #define NBSP "\xC2\xA0"
21 
23 #define LRM "\xE2\x80\x8E"
24 
34 };
35 
37 typedef uint32 WChar;
38 
39 /* The following are directional formatting codes used to get the LTR and RTL strings right:
40  * http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
41 static const WChar CHAR_TD_LRM = 0x200E;
42 static const WChar CHAR_TD_RLM = 0x200F;
43 static const WChar CHAR_TD_LRE = 0x202A;
44 static const WChar CHAR_TD_RLE = 0x202B;
45 static const WChar CHAR_TD_LRO = 0x202D;
46 static const WChar CHAR_TD_RLO = 0x202E;
47 static const WChar CHAR_TD_PDF = 0x202C;
48 
51  SVS_NONE = 0,
53  SVS_ALLOW_NEWLINE = 1 << 1,
55 };
57 
58 
59 
60 typedef std::vector<std::string> StringList;
61 
62 #endif /* STRING_TYPE_H */
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
static const WChar CHAR_TD_LRM
The next character acts like a left-to-right character.
Definition: string_type.h:41
static const WChar CHAR_TD_LRE
The following text is embedded left-to-right.
Definition: string_type.h:43
Only hexadecimal characters.
Definition: string_type.h:33
Allow nothing and replace nothing.
Definition: string_type.h:51
Type (helpers) for enums.
StringValidationSettings
Settings for the string validation.
Definition: string_type.h:50
Only numeric ones.
Definition: string_type.h:30
Allow newlines.
Definition: string_type.h:53
Only numbers and spaces.
Definition: string_type.h:31
static const WChar CHAR_TD_RLE
The following text is embedded right-to-left.
Definition: string_type.h:44
CharSetFilter
Valid filter types for IsValidChar.
Definition: string_type.h:28
static const WChar CHAR_TD_PDF
Restore the text-direction state to before the last LRE, RLE, LRO or RLO.
Definition: string_type.h:47
Both numeric and alphabetic and spaces and stuff.
Definition: string_type.h:29
Replace the unknown/bad bits with question marks.
Definition: string_type.h:52
std::vector< std::string > StringList
Type for a list of strings.
Definition: string_type.h:60
static const WChar CHAR_TD_RLM
The next character acts like a right-to-left character.
Definition: string_type.h:42
Allow the special control codes.
Definition: string_type.h:54
Only alphabetic values.
Definition: string_type.h:32
uint32 WChar
Type for wide characters, i.e.
Definition: string_type.h:37
static const WChar CHAR_TD_LRO
Force the following characters to be treated as left-to-right characters.
Definition: string_type.h:45
static const WChar CHAR_TD_RLO
Force the following characters to be treated as right-to-left characters.
Definition: string_type.h:46