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 "./../lang/Appendable.h"
16#include "./../lang/Character.h"
17#include "./../lang/Interface.h"
18#include "./../lang/Iterable.h"
19#include "./../lang/Memory.h"
20#include "./../lang/Strings.h"
21
22//----------------------------------------------------------------------------------------
23
24/* ***************************************************************************************
25 * Namespace
26 */
27namespace ufm::io {
28 class PrintStream;
29} // namespace ufm::io
30
31/* ***************************************************************************************
32 * Class/Interface/Struct/Enum
33 */
34
45 /* *************************************************************************************
46 * Variable
47 */
48 private:
49 ufm::lang::Appendable& vAppendable;
50
51 public:
53
54 /* *************************************************************************************
55 * Method
56 */
57
58 /* *************************************************************************************
59 * Construct Method
60 */
61 public:
67
71 ~PrintStream(void) override;
72
73 /* *************************************************************************************
74 * Operator Method
75 */
76 public:
83 inline operator ufm::lang::Appendable&() {
84 return this->vAppendable;
85 }
86
92 inline PrintStream& operator<<(bool b) {
93 return this->print(b, false);
94 }
95
101 inline PrintStream& operator<<(char c) {
102 return this->print(c, false);
103 }
104
110 inline PrintStream& operator<<(int i) {
111 return this->print(i, false);
112 }
113
119 inline PrintStream& operator<<(uint32 i) {
120 return this->print(i, false);
121 }
122
128 inline PrintStream& operator<<(float f) {
129 return this->print(f, false);
130 }
131
137 inline PrintStream& operator<<(double d) {
138 return this->print(d, false);
139 }
140
146 inline PrintStream& operator<<(const char* str) {
147 return this->print(str, -1, false);
148 }
149
156 return this->print(str, false);
157 }
158
165 return this->print(r, false);
166 }
167
174 return this->print(iterable, false);
175 }
176
177 /* *************************************************************************************
178 * Override -
179 */
180
181 /* *************************************************************************************
182 * Public Method
183 */
184 public:
191 PrintStream& print(bool b, bool newLine = false);
192
199 PrintStream& print(char c, bool newLine = false);
200
207 PrintStream& print(double d, bool newLine = false);
208
215 PrintStream& print(float f, bool newLine = false);
216
225 PrintStream& print(int i, bool newLine = false);
226
234 PrintStream& print(uint32 i, bool newLine = false);
235
242 PrintStream& print(const ufm::lang::Strings& string, bool newLine = false);
243
251 PrintStream& print(const char* string, int length = -1, bool newLine = false);
252
259 PrintStream& print(ufm::lang::Readable& readBuffer, bool newLine = false);
260
267 PrintStream& print(ufm::lang::Iterable<const char>& iterable, bool newLine = false);
268
274
281 PrintStream& formatVa(const char* format, va_list args);
282
289 PrintStream& format(const char* format, ...);
290
296 return this->vAppendable;
297 }
298
305 inline PrintStream& println(bool b) {
306 return this->print(b, true);
307 }
308
315 inline PrintStream& println(char c) {
316 return this->print(c, true);
317 }
318
325 inline PrintStream& println(double d) {
326 return this->print(d, true);
327 }
328
335 inline PrintStream& println(float f) {
336 return this->print(f, true);
337 }
338
345 inline PrintStream& println(int i) {
346 return this->print(i, true);
347 }
348
355 inline PrintStream& println(uint32 i) {
356 return this->print(static_cast<int>(i), true);
357 }
358
365 inline PrintStream& println(const ufm::lang::Strings& string) {
366 return this->print(string, true);
367 }
368
376 inline PrintStream& println(const char* string, int length = -1) {
377 return this->print(string, length, true);
378 }
379
387 return this->print(readBuffer, true);
388 }
389
397 return this->print(iterable, true);
398 }
399
400 /* *************************************************************************************
401 * Protected Method
402 */
403
404 /* *************************************************************************************
405 * Private Method
406 */
407
408 /* *************************************************************************************
409 * Static Variable
410 */
411
412 /* *************************************************************************************
413 * Static Method
414 */
415};
416
417/* ***************************************************************************************
418 * End of file
419 */
420
421#endif /* MFRAME_3550888B_3B39_494F_9E8A_F0CFBD844E1A */
格式化輸出串流
Definition PrintStream.h:44
PrintStream & print(double d, bool newLine=false)
印出雙精度浮點數,可選擇是否換行。
PrintStream & operator<<(const char *str)
operator<< 重載:C 字串
Definition PrintStream.h:146
PrintStream & println(const char *string, int length=-1)
印出 C 字串並換行。
Definition PrintStream.h:376
PrintStream & println(ufm::lang::Iterable< const char > &iterable)
印出可迭代物件的內容並換行。
Definition PrintStream.h:396
PrintStream & print(uint32 i, bool newLine=false)
印出無符號整數,可選擇是否換行。
PrintStream & println(const ufm::lang::Strings &string)
印出字串並換行。
Definition PrintStream.h:365
PrintStream & println(int i)
印出整數並換行。
Definition PrintStream.h:345
PrintStream & println(uint32 i)
印出無符號整數並換行。
Definition PrintStream.h:355
PrintStream & print(float f, bool newLine=false)
印出浮點數,可選擇是否換行。
PrintStream & operator<<(char c)
operator<< 重載:字元
Definition PrintStream.h:101
PrintStream & format(const char *format,...)
印出格式化資料。
PrintStream & print(int i, bool newLine=false)
印出整數,可選擇是否換行。
PrintStream & operator<<(uint32 i)
operator<< 重載:無符號整數
Definition PrintStream.h:119
PrintStream & print(const ufm::lang::Strings &string, bool newLine=false)
印出字串,可選擇是否換行。
ufm::lang::Character::LineEnding vLineEnding
行結束符號
Definition PrintStream.h:52
PrintStream & println(float f)
印出浮點數並換行。
Definition PrintStream.h:335
PrintStream & operator<<(int i)
operator<< 重載:整數
Definition PrintStream.h:110
PrintStream & println(char c)
印出字元並換行。
Definition PrintStream.h:315
PrintStream & println(double d)
印出雙精度浮點數並換行。
Definition PrintStream.h:325
PrintStream & println(ufm::lang::Readable &readBuffer)
印出可讀物件並換行。
Definition PrintStream.h:386
ufm::lang::Appendable & appendable(void)
取得內部 Appendable 物件參考
Definition PrintStream.h:295
PrintStream & operator<<(ufm::lang::Readable &r)
operator<< 重載:Readable 物件
Definition PrintStream.h:164
PrintStream & operator<<(double d)
operator<< 重載:雙精度浮點數
Definition PrintStream.h:137
PrintStream & operator<<(ufm::lang::Iterable< const char > &iterable)
operator<< 重載:可迭代物件
Definition PrintStream.h:173
~PrintStream(void) override
解構 PrintStream 物件,釋放資源。
PrintStream & operator<<(bool b)
operator<< 重載:布林值
Definition PrintStream.h:92
PrintStream & print(ufm::lang::Readable &readBuffer, bool newLine=false)
印出可讀物件,可選擇是否換行。
PrintStream & operator<<(float f)
operator<< 重載:浮點數
Definition PrintStream.h:128
PrintStream & println(void)
印出換行字元。
PrintStream & operator<<(ufm::lang::Strings &str)
operator<< 重載:Strings 物件
Definition PrintStream.h:155
PrintStream & print(ufm::lang::Iterable< const char > &iterable, bool newLine=false)
印出可迭代物件的內容,可選擇是否換行。
PrintStream & formatVa(const char *format, va_list args)
印出格式化資料,使用可變參數列表。
PrintStream & print(const char *string, int length=-1, bool newLine=false)
印出 C 字串,可選擇是否換行。
PrintStream(ufm::lang::Appendable &appendable)
建構 PrintStream 物件
PrintStream & println(bool b)
印出布林值並換行。
Definition PrintStream.h:305
PrintStream & print(bool b, bool newLine=false)
印出布林值,可選擇是否換行。
PrintStream & print(char c, bool newLine=false)
印出字元,可選擇是否換行。
LineEnding
行結尾類型的列舉類型。
Definition Character.h:538
物件基底類別
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