OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

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
26 enum CharSetFilter {
27 CS_ALPHANUMERAL,
28 CS_NUMERAL,
29 CS_NUMERAL_SPACE,
30 CS_ALPHA,
31 CS_HEXADECIMAL,
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
48 enum StringValidationSettings {
49 SVS_NONE = 0,
50 SVS_REPLACE_WITH_QUESTION_MARK = 1 << 0,
51 SVS_ALLOW_NEWLINE = 1 << 1,
52 SVS_ALLOW_CONTROL_CODE = 1 << 2,
53 };
54 DECLARE_ENUM_AS_BIT_SET(StringValidationSettings)
55
56 #endif /* STRING_TYPE_H */