| 1 | #ifndef BOOST_SYSTEM_DETAIL_APPEND_INT_HPP_INCLUDED |
| 2 | #define BOOST_SYSTEM_DETAIL_APPEND_INT_HPP_INCLUDED |
| 3 | |
| 4 | // Copyright 2021 Peter Dimov |
| 5 | // Distributed under the Boost Software License, Version 1.0. |
| 6 | // https://www.boost.org/LICENSE_1_0.txt) |
| 7 | |
| 8 | #include <boost/system/detail/snprintf.hpp> |
| 9 | #include <string> |
| 10 | |
| 11 | // |
| 12 | |
| 13 | namespace boost |
| 14 | { |
| 15 | namespace system |
| 16 | { |
| 17 | namespace detail |
| 18 | { |
| 19 | |
| 20 | inline void append_int( std::string& s, int v ) |
| 21 | { |
| 22 | char buffer[ 32 ]; |
| 23 | detail::snprintf( s: buffer, maxlen: sizeof( buffer ), format: ":%d" , v ); |
| 24 | |
| 25 | s += buffer; |
| 26 | } |
| 27 | |
| 28 | } // namespace detail |
| 29 | } // namespace system |
| 30 | } // namespace boost |
| 31 | |
| 32 | #endif // #ifndef BOOST_SYSTEM_DETAIL_APPEND_INT_HPP_INCLUDED |
| 33 | |