tlx
Loading...
Searching...
No Matches
ssprintf.hpp
Go to the documentation of this file.
1/*******************************************************************************
2 * tlx/string/ssprintf.hpp
3 *
4 * Part of tlx - http://panthema.net/tlx
5 *
6 * Copyright (C) 2007-2019 Timo Bingmann <tb@panthema.net>
7 *
8 * All rights reserved. Published under the Boost Software License, Version 1.0
9 ******************************************************************************/
10
11#ifndef TLX_STRING_SSPRINTF_HEADER
12#define TLX_STRING_SSPRINTF_HEADER
13
15
16#include <string>
17
18namespace tlx {
19
20//! \addtogroup tlx_string
21//! \{
22
23/*!
24 * Helper for return the result of a sprintf() call inside a std::string.
25 *
26 * \param fmt printf format and additional parameters
27 */
28std::string ssprintf(const char* fmt, ...)
30
31/*!
32 * Helper for return the result of a snprintf() call inside a std::string.
33 *
34 * \param max_size maximum length of output string, longer ones are truncated.
35 * \param fmt printf format and additional parameters
36 */
37std::string ssnprintf(size_t max_size, const char* fmt, ...)
39
40//! \}
41
42} // namespace tlx
43
44#endif // !TLX_STRING_SSPRINTF_HEADER
45
46/******************************************************************************/
#define TLX_ATTRIBUTE_FORMAT_PRINTF(X, Y)
std::string ssnprintf(size_t max_size, const char *fmt,...)
Helper for return the result of a snprintf() call inside a std::string.
Definition ssprintf.cpp:42
std::string ssprintf(const char *fmt,...)
Helper for return the result of a sprintf() call inside a std::string.
Definition ssprintf.cpp:18
STL namespace.