mFrame
載入中...
搜尋中...
無符合項目
Booleans.h
1
7#ifndef MFRAME_90D9B92C_CB56_4072_B34E_C233A3D5684D
8#define MFRAME_90D9B92C_CB56_4072_B34E_C233A3D5684D
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "./../lang/NonInstantiable.h"
16
17//----------------------------------------------------------------------------------------
18
19/* ***************************************************************************************
20 * Namespace
21 */
22namespace ufm::numb {
23 class Booleans;
24} // namespace ufm::numb
25
26/* ***************************************************************************************
27 * Class/Interface/Struct/Enum
28 */
42 /* *************************************************************************************
43 * Variable
44 */
45
46 /* *************************************************************************************
47 * Abstract Method
48 */
49
50 /* *************************************************************************************
51 * Construct Method
52 */
53 protected:
58 virtual ~Booleans(void) override = default;
59
60 /* *************************************************************************************
61 * Operator Method
62 */
63
64 /* *************************************************************************************
65 * Override Method
66 */
67
68 /* *************************************************************************************
69 * Public Method
70 */
71
72 /* *************************************************************************************
73 * Protected Method
74 */
75
76 /* *************************************************************************************
77 * Private Method
78 */
79
80 /* *************************************************************************************
81 * Static Variable
82 */
83 public:
84 static constexpr const char* const TEXT_TRUE = "true";
85 static constexpr const char* const TEXT_FALSE = "false";
86 static constexpr const int TEXT_TRUE_LENGTH =
87 sizeof("true") - 1;
88 static constexpr const int TEXT_FALSE_LENGTH =
89 sizeof("false") - 1;
90
91 /* *************************************************************************************
92 * Static Method
93 */
94 public:
105 static bool isTrue(const char* str, int count);
106
117 static bool isFalse(const char* str, int count);
118
129 static bool isBoolean(const char* str, int count);
130
142 static bool parseBoolean(bool& result, const char* str, int count);
143};
144
145/* ***************************************************************************************
146 * End of file
147 */
148
149#endif /* MFRAME_90D9B92C_CB56_4072_B34E_C233A3D5684D */
Definition NonInstantiable.h:29
布林值靜態工具類
Definition Booleans.h:41
static bool isBoolean(const char *str, int count)
判斷字串是否為布林值字串
static bool isFalse(const char *str, int count)
判斷字串是否代表假值 (false)
static bool isTrue(const char *str, int count)
判斷字串是否代表真值 (true)
static constexpr const char *const TEXT_TRUE
真值的字符串表示
Definition Booleans.h:84
static constexpr const int TEXT_FALSE_LENGTH
"false"字符串的長度
Definition Booleans.h:88
static constexpr const char *const TEXT_FALSE
假值的字符串表示
Definition Booleans.h:85
static constexpr const int TEXT_TRUE_LENGTH
"true"字符串的長度
Definition Booleans.h:86
virtual ~Booleans(void) override=default
Destroy the Booleans object.
static bool parseBoolean(bool &result, const char *str, int count)
解析字串為布林值
Definition Boolean.h:23