FastLED 3.9.15
Loading...
Searching...
No Matches

◆ format_impl() [2/2]

template<typename T, typename... Args>
void fl::printf_detail::format_impl ( StrStream & stream,
const char * format,
const T & first,
const Args &... rest )

Definition at line 347 of file printf.h.

347 {
348 while (*format) {
349 if (*format == '%') {
350 FormatSpec spec = parse_format_spec(format);
351 if (spec.type == '%') {
352 stream << "%";
353 } else {
354 // Format the first argument and continue with the rest
355 format_arg(stream, spec, first);
356 format_impl(stream, format, rest...);
357 return;
358 }
359 } else {
360 // Create a single-character string since StrStream treats char as number
361 char temp_str[2] = {*format, '\0'};
362 stream << temp_str;
363 ++format;
364 }
365 }
366
367 // If we get here, there are unused arguments
368 // This is not an error in printf, so we just ignore them
369}
void format_impl(StrStream &stream, const char *format)
Definition printf.h:326
FormatSpec parse_format_spec(const char *&format)
Definition printf.h:95
void format_arg(StrStream &stream, const FormatSpec &spec, const T &arg)
Definition printf.h:225

References format_arg(), format_impl(), parse_format_spec(), and fl::printf_detail::FormatSpec::type.

+ Here is the call graph for this function: