TNB Library
TnbBoolean.h
[詳解]
1#pragma once
11#include "TnbDef.h"
12
13
14
15//TNB Library
16namespace TNB
17{
18
19
20
21//T-TestCaseコードカバレッジDisable
22#pragma comment(user,"T-Coverage Disable")
23
24
25
38{
39 bool m_boValue;
40
41public:
42
44 CBoolean(void) : m_boValue(false) {}
45
50 CBoolean(bool boIn) : m_boValue(boIn) {}
51
60 int operator-(const CBoolean& b) const
61 {
62 return m_boValue - b.m_boValue;
63 }
64
71 bool operator==(const CBoolean& b) const
72 {
73 return m_boValue == b.m_boValue;
74 }
75
82 bool operator!=(const CBoolean& b) const
83 {
84 return m_boValue != b.m_boValue;
85 }
86
92 bool operator=(bool boIn)
93 {
94 return m_boValue = boIn;
95 }
96
101 bool operator !(void) const
102 {
103 return ! m_boValue;
104 }
105
110 operator bool&(void)
111 {
112 return m_boValue;
113 }
114
119 operator const bool&(void) const
120 {
121 return m_boValue;
122 }
123
129 bool IsTrue(void) const
130 {
131 return m_boValue;
132 }
133
139 bool IsFalse(void) const
140 {
141 return ! m_boValue;
142 }
143
150 LPCTSTR ToString(void) const
151 {
152 return m_boValue ? _T("true") : _T("false");
153 }
154
155 #ifdef _WINDEF_
156
161 CBoolean(BOOL boIn) : m_boValue(!!boIn) {}
162
168 bool operator=(BOOL boIn)
169 {
170 return m_boValue = !! boIn;
171 }
172
177 operator BOOL(void) const
178 {
179 return m_boValue;
180 }
181
182 #endif//_WINDEF_
183
184private:
185 friend class CBooleanTest;
186};
187
188
189
202
203
204
205//T-TestCaseコードカバレッジEnable
206#pragma comment(user,"T-Coverage Enable")
207
208
209
210}; // TNB
TNBライブラリの定義ヘッダ
Boolean型クラス
Definition: TnbBoolean.h:38
bool IsTrue(void) const
[取得] 状態取得
Definition: TnbBoolean.h:129
int operator-(const CBoolean &b) const
[確認] 比較.
Definition: TnbBoolean.h:60
CBoolean(void)
コンストラクタ
Definition: TnbBoolean.h:44
CBoolean(bool boIn)
コンストラクタ
Definition: TnbBoolean.h:50
bool operator!(void) const
[取得] 状態反転取得
Definition: TnbBoolean.h:101
bool operator!=(const CBoolean &b) const
[確認] 比較.
Definition: TnbBoolean.h:82
LPCTSTR ToString(void) const
[取得] 文字列取得.
Definition: TnbBoolean.h:150
bool operator=(bool boIn)
[設定] 代入
Definition: TnbBoolean.h:92
bool IsFalse(void) const
[取得] 状態取得
Definition: TnbBoolean.h:139
bool operator==(const CBoolean &b) const
[確認] 比較.
Definition: TnbBoolean.h:71
TNB::CBoolean Bool
Boolean型クラス
Definition: TnbBoolean.h:201
TNB Library
Definition: TnbDoxyTitle.txt:2