printf.h 939 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <util/system/compat.h>
  3. class IOutputStream;
  4. /**
  5. * Stream-based `printf` function. Prints formatted data into the provided stream.
  6. * Works the same way as a standard C `printf`.
  7. *
  8. * @param out Stream to write into.
  9. * @param fmt Format string.
  10. * @param ... Additional arguments.
  11. */
  12. size_t Y_PRINTF_FORMAT(2, 3) Printf(IOutputStream& out, const char* fmt, ...);
  13. /**
  14. * Stream-based `vprintf` function. Prints formatted data from variable argument
  15. * list into the provided stream. Works the same way as a standard C `vprintf`.
  16. *
  17. * @param out Stream to write into.
  18. * @param fmt Format string.
  19. * @param params Additional arguments as a variable argument list.
  20. */
  21. size_t Y_PRINTF_FORMAT(2, 0) Printf(IOutputStream& out, const char* fmt, va_list params);