xtd 0.2.0
print.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#define __XTD_CORE_INTERNAL__
8#undef __XTD_CORE_INTERNAL__
9#include "string.hpp"
10
12namespace xtd {
18 template<class arg_t>
19 void print(FILE* file, arg_t&& value) {
20 __xtd_print_with_file_write__(false, file, string::format("{}", value));
21 }
22
24 template<class type_t>
25 void print(FILE* file, std::initializer_list<type_t>&& il) {
26 __xtd_print_with_file_write__(false, file, string::format("{}", il));
27 }
29
36 template<class ...args_t>
37 void print(FILE* file, const xtd::string& fmt, args_t&& ... values) {
38 __xtd_print_with_file_write__(false, file, string::format(fmt, std::forward<args_t>(values)...));
39 }
46 template<class ...args_t>
47 void print(FILE* file, const char* fmt, args_t&& ... values) {
48 __xtd_print_with_file_write__(false, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
49 }
50#if defined(__xtd__cpp_lib_char8_t)
57 template<class ...args_t>
58 void print(FILE* file, const char8_t* fmt, args_t&& ... values) {
59 __xtd_print_with_file_write__(false, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
60 }
61#endif
68 template<class ...args_t>
69 void print(FILE* file, const char16_t* fmt, args_t&& ... values) {
70 __xtd_print_with_file_write__(false, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
71 }
78 template<class ...args_t>
79 void print(FILE* file, const char32_t* fmt, args_t&& ... values) {
80 __xtd_print_with_file_write__(false, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
81 }
88 template<class ...args_t>
89 void print(FILE* file, const wchar_t* fmt, args_t&& ... values) {
90 __xtd_print_with_file_write__(false, file, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
91 }
92
97 template<class arg_t>
98 void print(std::ostream& os, arg_t&& value) {
99 __xtd_print_with_ostream_write__(false, os, string::format("{}", value));
100 }
101
103 template<class type_t>
104 void print(std::ostream& os, std::initializer_list<type_t>&& il) {
105 __xtd_print_with_ostream_write__(false, os, string::format("{}", il));
106 }
108
114 template<class ...args_t>
115 void print(std::ostream& os, const xtd::string& fmt, args_t&& ... values) {
116 __xtd_print_with_ostream_write__(false, os, string::format(fmt, std::forward<args_t>(values)...));
117 }
123 template<class ...args_t>
124 void print(std::ostream& os, const char* fmt, args_t&& ... values) {
125 __xtd_print_with_ostream_write__(false, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
126 }
127#if defined(__xtd__cpp_lib_char8_t)
133 template<class ...args_t>
134 void print(std::ostream& os, const char8_t* fmt, args_t&& ... values) {
135 __xtd_print_with_ostream_write__(false, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
136 }
137#endif
143 template<class ...args_t>
144 void print(std::ostream& os, const char16_t* fmt, args_t&& ... values) {
145 __xtd_print_with_ostream_write__(false, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
146 }
152 template<class ...args_t>
153 void print(std::ostream& os, const char32_t* fmt, args_t&& ... values) {
154 __xtd_print_with_ostream_write__(false, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
155 }
161 template<class ...args_t>
162 void print(std::ostream& os, const wchar_t* fmt, args_t&& ... values) {
163 __xtd_print_with_ostream_write__(false, os, string::format(xtd::string {fmt}, std::forward<args_t>(values)...));
164 }
165
169 template<class arg_t>
170 void print(arg_t&& value) {print(stdout, value);}
171
173 template<class type_t>
174 void print(std::initializer_list<type_t>&& il) {print(stdout, il);}
176
181 template<class ...args_t>
182 void print(const xtd::string& fmt, args_t&& ... values) {print(stdout, fmt, std::forward<args_t>(values)...);}
187 template<class ...args_t>
188 void print(const char* fmt, args_t&& ... values) {print(stdout, fmt, std::forward<args_t>(values)...);}
189#if defined(__xtd__cpp_lib_char8_t)
194 template<class ...args_t>
195 void print(const char8_t* fmt, args_t&& ... values) {print(stdout, fmt, std::forward<args_t>(values)...);}
196#endif
201 template<class ...args_t>
202 void print(const char16_t* fmt, args_t&& ... values) {print(stdout, fmt, std::forward<args_t>(values)...);}
207 template<class ...args_t>
208 void print(const char32_t* fmt, args_t&& ... values) {print(stdout, fmt, std::forward<args_t>(values)...);}
213 template<class ...args_t>
214 void print(const wchar_t* fmt, args_t&& ... values) {print(stdout, fmt, std::forward<args_t>(values)...);}
215
216}
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 ...
@ print
The PRINT key.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::string alias.