sources/format.h

changeset 72
1b9c53e0c846
parent 70
0e947b487b18
child 73
07dda51a7a8e
equal deleted inserted replaced
71:4f7c2c944637 72:1b9c53e0c846
201 { 201 {
202 print_to (handle, fmtstr, args...); 202 print_to (handle, fmtstr, args...);
203 fclose (handle); 203 fclose (handle);
204 } 204 }
205 } 205 }
206
207 // -------------------------------------------------------------------------------------------------
208 //
209 // Prints the formatting result to the console
210 //
211 template<typename... argtypes>
212 void print (const String& fmtstr, const argtypes&... args)
213 {
214 print_to_console (format (fmtstr, args...));
215 }
216
217 // -------------------------------------------------------------------------------------------------
218 //
219 // Prints the formatting result as a warning to the console
220 //
221 template<typename... argtypes>
222 void print_warning (const String& fmtstr, const argtypes&... args)
223 {
224 print_to_console (TEXTCOLOR_BrightYellow "-!- " + format (fmtstr, args...) + TEXTCOLOR_Reset);
225 }
226
227 // -------------------------------------------------------------------------------------------------
228 //
229 // Prints the formatting result as a warning to the console
230 //
231 template<typename... argtypes>
232 void print_error (const String& fmtstr, const argtypes&... args)
233 {
234 print_to_console (TEXTCOLOR_BrightRed "!!! " + format (fmtstr, args...) + TEXTCOLOR_Reset);
235 }

mercurial