aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/printf.h
blob: c6199a15efd1b5e7b1c16e71f2a5269186750961 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <util/system/compat.h>

class IOutputStream; 

/**
 * Stream-based `printf` function. Prints formatted data into the provided stream.
 * Works the same way as a standard C `printf`.
 *
 * @param out                           Stream to write into.
 * @param fmt                           Format string.
 * @param ...                           Additional arguments.
 */
size_t Y_PRINTF_FORMAT(2, 3) Printf(IOutputStream& out, const char* fmt, ...); 

/**
 * Stream-based `vprintf` function. Prints formatted data from variable argument
 * list into the provided stream. Works the same way as a standard C `vprintf`.
 *
 * @param out                           Stream to write into.
 * @param fmt                           Format string.
 * @param params                        Additional arguments as a variable argument list.
 */
size_t Y_PRINTF_FORMAT(2, 0) Printf(IOutputStream& out, const char* fmt, va_list params);