tlx
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
14
#include <
tlx/define/attribute_format_printf.hpp
>
15
16
#include <string>
17
18
namespace
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
*/
28
std::string
ssprintf
(
const
char
* fmt, ...)
29
TLX_ATTRIBUTE_FORMAT_PRINTF
(1, 2);
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
*/
37
std
::
string
ssnprintf
(
size_t
max_size, const
char
* fmt, ...)
38
TLX_ATTRIBUTE_FORMAT_PRINTF
(2, 3);
39
40
//! \}
41
42
}
// namespace tlx
43
44
#endif // !TLX_STRING_SSPRINTF_HEADER
45
46
/******************************************************************************/
std
STL namespace.
attribute_format_printf.hpp
tlx
Definition:
exclusive_scan.hpp:17
TLX_ATTRIBUTE_FORMAT_PRINTF
#define TLX_ATTRIBUTE_FORMAT_PRINTF(X, Y)
Definition:
attribute_format_printf.hpp:26
tlx::ssprintf
std::string ssprintf(const char *fmt,...)
Helper for return the result of a sprintf() call inside a std::string.
Definition:
ssprintf.cpp:18
tlx::ssnprintf
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
tlx
string
ssprintf.hpp
Generated on Sat Oct 2 2021 20:29:00 for tlx by
1.8.11