summaryrefslogtreecommitdiff
path: root/src/string_type.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-18 18:37:54 +0000
committerrubidium <rubidium@openttd.org>2011-12-18 18:37:54 +0000
commitfefe22b4aa5194af499763d3cc4d4dc19116fa92 (patch)
tree5b2671aa4bc5b68584d962d11a8ceab705ad6321 /src/string_type.h
parent6ae8cac4320e098c1fa628a3afd5c090aacc80a2 (diff)
downloadopenttd-fefe22b4aa5194af499763d3cc4d4dc19116fa92.tar.xz
(svn r23590) -Codechange: make the string validation settings better expandable
Diffstat (limited to 'src/string_type.h')
-rw-r--r--src/string_type.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/string_type.h b/src/string_type.h
index b2bd6824d..174606635 100644
--- a/src/string_type.h
+++ b/src/string_type.h
@@ -12,6 +12,8 @@
#ifndef STRING_TYPE_H
#define STRING_TYPE_H
+#include "core/enum_type.hpp"
+
/** A non-breaking space. */
#define NBSP "\xC2\xA0"
@@ -42,4 +44,12 @@ static const WChar CHAR_TD_LRO = 0x202D; ///< Force the following characters to
static const WChar CHAR_TD_RLO = 0x202E; ///< Force the following characters to be treated as right-to-left characters.
static const WChar CHAR_TD_PDF = 0x202C; ///< Restore the text-direction state to before the last LRE, RLE, LRO or RLO.
+/** Settings for the string validation. */
+enum StringValidationSettings {
+ SVS_NONE = 0, ///< Allow nothing and replace nothing.
+ SVS_REPLACE_WITH_QUESTION_MARK = 1 << 0, ///< Replace the unknown/bad bits with question marks.
+ SVS_ALLOW_NEWLINE = 1 << 1, ///< Allow newlines.
+};
+DECLARE_ENUM_AS_BIT_SET(StringValidationSettings);
+
#endif /* STRING_TYPE_H */