4 #include <cstdarg> // variadic argument fun
5 #include <cstdio> // (v)snprintf() and size_t
10 * @brief Formats a message and writes it into @a buffer.
12 * It is guaranteed that not more than @a length characters
13 * are written to @a buffer.
15 * @TODO what to do when buffer too small?
17 * @param buffer String to be filled.
18 * @param length Size of buffer.
19 * @param file Filename in which the error occured.
20 * @param line Line number in which the error occured.
21 * @param message printf formatstring template
22 * @param ap variadic argument list, holds parameters
23 * to be used when formatting (vsnprintf()).
28 const char* const file
,
30 const char* const message
,
34 * @brief Same as the vformat() but uses "real" variadic
35 * arguments instead of va_list parameter.
40 const char* const file
,
42 const char* const message
,
46 * @brief Instanciates T with properly formatted message.
48 * T is supposed to have a static const char*
49 * MessageTemplate field, which will be used as
50 * formatstring for makeMessage().
52 * @param file To be passed on to format().
53 * @param line To be passed on to format().
54 * @param ... Passed to format() (sprintf() like).
56 * @return Instance of T.
59 T
formatted(const char* const file
, unsigned short line
, ...) throw();
63 #include "utility.ixx"