OpenTTD
string_type.h
Go to the documentation of this file.
1 /* $Id: string_type.h 23940 2012-02-12 19:46:40Z smatz $ */
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 
18 #define NBSP "\xC2\xA0"
19 
21 #define LRM "\xE2\x80\x8E"
22 
32 };
33 
35 typedef uint32 WChar;
36 
37 /* The following are directional formatting codes used to get the LTR and RTL strings right:
38  * http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
39 static const WChar CHAR_TD_LRM = 0x200E;
40 static const WChar CHAR_TD_RLM = 0x200F;
41 static const WChar CHAR_TD_LRE = 0x202A;
42 static const WChar CHAR_TD_RLE = 0x202B;
43 static const WChar CHAR_TD_LRO = 0x202D;
44 static const WChar CHAR_TD_RLO = 0x202E;
45 static const WChar CHAR_TD_PDF = 0x202C;
46 
49  SVS_NONE = 0,
51  SVS_ALLOW_NEWLINE = 1 << 1,
53 };
55 
56 #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:39
static const WChar CHAR_TD_LRE
The following text is embedded left-to-right.
Definition: string_type.h:41
Only hexadecimal characters.
Definition: string_type.h:31
Allow nothing and replace nothing.
Definition: string_type.h:49
Type (helpers) for enums.
StringValidationSettings
Settings for the string validation.
Definition: string_type.h:48
Only numeric ones.
Definition: string_type.h:28
Allow newlines.
Definition: string_type.h:51
Only numbers and spaces.
Definition: string_type.h:29
static const WChar CHAR_TD_RLE
The following text is embedded right-to-left.
Definition: string_type.h:42
CharSetFilter
Valid filter types for IsValidChar.
Definition: string_type.h:26
static const WChar CHAR_TD_PDF
Restore the text-direction state to before the last LRE, RLE, LRO or RLO.
Definition: string_type.h:45
Both numeric and alphabetic and spaces and stuff.
Definition: string_type.h:27
Replace the unknown/bad bits with question marks.
Definition: string_type.h:50
static const WChar CHAR_TD_RLM
The next character acts like a right-to-left character.
Definition: string_type.h:40
Allow the special control codes.
Definition: string_type.h:52
Only alphabetic values.
Definition: string_type.h:30
uint32 WChar
Type for wide characters, i.e.
Definition: string_type.h:35
static const WChar CHAR_TD_LRO
Force the following characters to be treated as left-to-right characters.
Definition: string_type.h:43
static const WChar CHAR_TD_RLO
Force the following characters to be treated as right-to-left characters.
Definition: string_type.h:44