mFrame
載入中...
搜尋中...
無符合項目
PrintStream.h
1
7#ifndef MFRAME_3550888B_3B39_494F_9E8A_F0CFBD844E1A
8#define MFRAME_3550888B_3B39_494F_9E8A_F0CFBD844E1A
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "./../io/RingBuffer.h"
16#include "./../lang/Character.h"
17#include "./../lang/Iterable.h"
18#include "./../lang/Memory.h"
19#include "./../lang/Strings.h"
20
21//----------------------------------------------------------------------------------------
22
23/* ***************************************************************************************
24 * Namespace
25 */
26namespace ufm::io {
27 class PrintStream;
28} // namespace ufm::io
29
30/* ***************************************************************************************
31 * Class/Interface/Struct/Enum
32 */
33
44 /* *************************************************************************************
45 * Variable
46 */
47 private:
48 ufm::lang::Appendable& vAppendable;
49
50 public:
52
53 /* *************************************************************************************
54 * Method
55 */
56
57 /* *************************************************************************************
58 * Construct Method
59 */
60 public:
66
70 ~PrintStream(void) override;
71
72 /* *************************************************************************************
73 * Operator Method
74 */
75 public:
81 inline PrintStream& operator<<(bool b) {
82 return this->print(b, false);
83 }
84
90 inline PrintStream& operator<<(char c) {
91 return this->print(c, false);
92 }
93
99 inline PrintStream& operator<<(int i) {
100 return this->print(i, false, false);
101 }
102
108 inline PrintStream& operator<<(float f) {
109 return this->print(f, false);
110 }
111
117 inline PrintStream& operator<<(double d) {
118 return this->print(d, false);
119 }
120
126 inline PrintStream& operator<<(const char* str) {
127 return this->print(str, false);
128 }
129
136 return this->print(str, false);
137 }
138
145 return this->print(r, false);
146 }
147
154 return this->print(iterable, false);
155 }
156
163 inline operator ufm::lang::Appendable&() {
164 return this->vAppendable;
165 }
166
167 /* *************************************************************************************
168 * Override -
169 */
170
171 /* *************************************************************************************
172 * Public Method
173 */
174 public:
180 return this->vAppendable;
181 }
182
189 inline PrintStream& println(bool b) {
190 return this->print(b, true);
191 }
192
199 inline PrintStream& println(char c) {
200 return this->print(c, true);
201 }
202
209 inline PrintStream& println(double d) {
210 return this->print(d, true);
211 }
212
219 inline PrintStream& println(float f) {
220 return this->print(f, true);
221 }
222
229 inline PrintStream& println(int i) {
230 return this->print(i, true, false);
231 }
232
239 inline PrintStream& println(uint32 i) {
240 return this->print(static_cast<int>(i), true, true);
241 }
242
249 inline PrintStream& println(const ufm::lang::Strings& string) {
250 return this->print(string, true);
251 }
252
259 inline PrintStream& println(const char* string) {
260 return this->print(string, true);
261 }
262
270 return this->print(readBuffer, true);
271 }
272
280 return this->print(iterable, true);
281 }
282
289 PrintStream& print(bool b, bool newLine = false);
290
297 PrintStream& print(char c, bool newLine = false);
298
305 PrintStream& print(double d, bool newLine = false);
306
313 PrintStream& print(float f, bool newLine = false);
314
322 PrintStream& print(int i, bool newLine = false, bool unsign = false);
323
330 inline PrintStream& print(uint32 i) {
331 return this->print(static_cast<int>(i), false, true);
332 }
333
340 PrintStream& print(const ufm::lang::Strings& string, bool newLine = false);
341
348 PrintStream& print(const char* string, bool newLine = false);
349
356 PrintStream& print(ufm::lang::Readable& readBuffer, bool newLine = false);
357
364 PrintStream& print(ufm::lang::Iterable<const char>& iterable, bool newLine = false);
365
371
378 PrintStream& format(const char* format, ...);
379
386 PrintStream& formatVa(const char* format, va_list args);
387 /* *************************************************************************************
388 * Protected Method
389 */
390
391 /* *************************************************************************************
392 * Private Method
393 */
394
395 /* *************************************************************************************
396 * Static Variable
397 */
398
399 /* *************************************************************************************
400 * Static Method
401 */
402};
403
404/* ***************************************************************************************
405 * End of file
406 */
407
408#endif /* MFRAME_3550888B_3B39_494F_9E8A_F0CFBD844E1A */
格式化輸出串流
Definition PrintStream.h:43
PrintStream & print(double d, bool newLine=false)
印出雙精度浮點數,可選擇是否換行。
PrintStream & operator<<(const char *str)
operator<< 重載:C 字串
Definition PrintStream.h:126
PrintStream & println(ufm::lang::Iterable< const char > &iterable)
印出可迭代物件的內容並換行。
Definition PrintStream.h:279
PrintStream & print(const char *string, bool newLine=false)
印出 C 字串,可選擇是否換行。
PrintStream & print(int i, bool newLine=false, bool unsign=false)
印出整數,可選擇是否換行與是否為無符號。
PrintStream & println(const ufm::lang::Strings &string)
印出字串並換行。
Definition PrintStream.h:249
PrintStream & println(int i)
印出整數並換行。
Definition PrintStream.h:229
PrintStream & println(uint32 i)
印出無符號整數並換行。
Definition PrintStream.h:239
PrintStream & print(float f, bool newLine=false)
印出浮點數,可選擇是否換行。
PrintStream & operator<<(char c)
operator<< 重載:字元
Definition PrintStream.h:90
PrintStream & format(const char *format,...)
印出格式化資料。
PrintStream & print(const ufm::lang::Strings &string, bool newLine=false)
印出字串,可選擇是否換行。
ufm::lang::Character::LineEnding vLineEnding
行結束符號
Definition PrintStream.h:51
PrintStream & println(float f)
印出浮點數並換行。
Definition PrintStream.h:219
PrintStream & println(const char *string)
印出 C 字串並換行。
Definition PrintStream.h:259
PrintStream & operator<<(int i)
operator<< 重載:整數
Definition PrintStream.h:99
PrintStream & print(uint32 i)
印出無符號整數。
Definition PrintStream.h:330
PrintStream & println(char c)
印出字元並換行。
Definition PrintStream.h:199
PrintStream & println(double d)
印出雙精度浮點數並換行。
Definition PrintStream.h:209
PrintStream & println(ufm::lang::Readable &readBuffer)
印出可讀物件並換行。
Definition PrintStream.h:269
ufm::lang::Appendable & appendable(void)
取得內部 Appendable 物件參考
Definition PrintStream.h:179
PrintStream & operator<<(ufm::lang::Readable &r)
operator<< 重載:Readable 物件
Definition PrintStream.h:144
PrintStream & operator<<(double d)
operator<< 重載:雙精度浮點數
Definition PrintStream.h:117
PrintStream & operator<<(ufm::lang::Iterable< const char > &iterable)
operator<< 重載:可迭代物件
Definition PrintStream.h:153
~PrintStream(void) override
解構 PrintStream 物件,釋放資源。
PrintStream & operator<<(bool b)
operator<< 重載:布林值
Definition PrintStream.h:81
PrintStream & print(ufm::lang::Readable &readBuffer, bool newLine=false)
印出可讀物件,可選擇是否換行。
PrintStream & operator<<(float f)
operator<< 重載:浮點數
Definition PrintStream.h:108
PrintStream & println(void)
印出換行字元。
PrintStream & operator<<(ufm::lang::Strings &str)
operator<< 重載:Strings 物件
Definition PrintStream.h:135
PrintStream & print(ufm::lang::Iterable< const char > &iterable, bool newLine=false)
印出可迭代物件的內容,可選擇是否換行。
PrintStream & formatVa(const char *format, va_list args)
印出格式化資料,使用可變參數列表。
PrintStream(ufm::lang::Appendable &appendable)
建構 PrintStream 物件
PrintStream & println(bool b)
印出布林值並換行。
Definition PrintStream.h:189
PrintStream & print(bool b, bool newLine=false)
印出布林值,可選擇是否換行。
PrintStream & print(char c, bool newLine=false)
印出字元,可選擇是否換行。
LineEnding
行結尾類型的列舉類型。
Definition Character.h:445
物件基底類別
Definition Object.h:63
字串類別,提供字串操作和記憶體管理功能
Definition Strings.h:33
Definition Buffer.h:24
資料附加介面 (Appendable)
Definition Appendable.h:43
[Interface] 定義可迭代集合介面
Definition Iterable.h:49
[Interface] 定義資料讀取介面
Definition Readable.h:46