xtd 0.2.0
println.hpp
Go to the documentation of this file.
1
4#pragma once
5#define __XTD_CORE_INTERNAL__
7#undef __XTD_CORE_INTERNAL__
8#include "string.hpp"
9
11namespace xtd {
14 inline void println(FILE* file) {
15 __xtd_print_with_file_write__(true, file, "");
16 }
17
22 template<class arg_t>
23 void println(FILE* file, arg_t&& value) {
24 __xtd_print_with_file_write__(true, file, string::format("{}", value));
25 }
26
28 template<class type_t>
29 void println(FILE* file, const std::initializer_list<type_t>& il) {
30 __xtd_print_with_file_write__(true, file, string::format("{}", il));
31 }
33
39 template<class ...args_t>
40 void println(FILE* file, const xtd::string& fmt, args_t&& ... values) {
41 __xtd_print_with_file_write__(true, file, string::format(fmt, std::forward<args_t>(values)...));
42 }
48 template<class ...args_t>
49 void println(FILE* file, const char* fmt, args_t&& ... values) {
50 __xtd_print_with_file_write__(true, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
51 }
52#if defined(__xtd__cpp_lib_char8_t)
58 template<class ...args_t>
59 void println(FILE* file, const char8_t* fmt, args_t&& ... values) {
60 __xtd_print_with_file_write__(true, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
61 }
62#endif
68 template<class ...args_t>
69 void println(FILE* file, const char16_t* fmt, args_t&& ... values) {
70 __xtd_print_with_file_write__(true, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
71 }
77 template<class ...args_t>
78 void println(FILE* file, const char32_t* fmt, args_t&& ... values) {
79 __xtd_print_with_file_write__(true, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
80 }
86 template<class ...args_t>
87 void println(FILE* file, const wchar_t* fmt, args_t&& ... values) {
88 __xtd_print_with_file_write__(true, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
89 }
90
93 inline void println(std::ostream& os) {
94 __xtd_print_with_ostream_write__(true, os, "");
95 }
96
101 template<class arg_t>
102 void println(std::ostream& os, arg_t&& value) {
103 __xtd_print_with_ostream_write__(true, os, string::format("{}", value));
104 }
105
107 template<class type_t>
108 void println(std::ostream& os, const std::initializer_list<type_t>& il) {
109 __xtd_print_with_ostream_write__(true, os, string::format("{}", il));
110 }
112
118 template<class ...args_t>
119 void println(std::ostream& os, const xtd::string& fmt, args_t&& ... values) {
120 __xtd_print_with_ostream_write__(true, os, string::format(fmt, std::forward<args_t>(values)...));
121 }
127 template<class ...args_t>
128 void println(std::ostream& os, const char* fmt, args_t&& ... values) {
129 __xtd_print_with_ostream_write__(true, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
130 }
131#if defined(__xtd__cpp_lib_char8_t)
137 template<class ...args_t>
138 void println(std::ostream& os, const char8_t* fmt, args_t&& ... values) {
139 __xtd_print_with_ostream_write__(true, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
140 }
141#endif
147 template<class ...args_t>
148 void println(std::ostream& os, const char16_t* fmt, args_t&& ... values) {
149 __xtd_print_with_ostream_write__(true, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
150 }
156 template<class ...args_t>
157 void println(std::ostream& os, const char32_t* fmt, args_t&& ... values) {
158 __xtd_print_with_ostream_write__(true, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
159 }
165 template<class ...args_t>
166 void println(std::ostream& os, const wchar_t* fmt, args_t&& ... values) {
167 __xtd_print_with_ostream_write__(true, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
168 }
169
171 inline void println() {xtd::println(stdout);}
172
176 template<class arg_t>
177 void println(arg_t&& value) {xtd::println(stdout, value);}
178
180 template<class type_t>
181 void println(const std::initializer_list<type_t>& il) {xtd::println(stdout, il);}
183
188 template<class ...args_t>
189 void println(const xtd::string& fmt, args_t&& ... values) {xtd::println(stdout, fmt, std::forward<args_t>(values)...);}
194 template<class ...args_t>
195 void println(const char* fmt, args_t&& ... values) {xtd::println(stdout, fmt, std::forward<args_t>(values)...);}
196#if defined(__xtd__cpp_lib_char8_t)
201 template<class ...args_t>
202 void println(const char8_t* fmt, args_t&& ... values) {xtd::println(stdout, fmt, std::forward<args_t>(values)...);}
203#endif
208 template<class ...args_t>
209 void println(const char16_t* fmt, args_t&& ... values) {xtd::println(stdout, fmt, std::forward<args_t>(values)...);}
214 template<class ...args_t>
215 void println(const char32_t* fmt, args_t&& ... values) {xtd::println(stdout, fmt, std::forward<args_t>(values)...);}
220 template<class ...args_t>
221 void println(const wchar_t* fmt, args_t&& ... values) {xtd::println(stdout, fmt, std::forward<args_t>(values)...);}
222}
Contains xtd_print_with_file_write and xtd_print_with_ostream_write methods.
Represents text as a sequence of character units.
Definition basic_string.hpp:71
static basic_string format(const basic_string< char > &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
void println()
Writes the current line terminator to the standard output stream using the specified format informati...
Definition println.hpp:171
Contains xtd::string alias.