File indexing completed on 2025-01-18 09:29:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_STRING_PARAM_HPP
0011 #define BOOST_BEAST_STRING_PARAM_HPP
0012
0013 #if defined(BOOST_BEAST_ALLOW_DEPRECATED) && !defined(BOOST_BEAST_DOXYGEN)
0014
0015
0016 #include <boost/beast/core/detail/config.hpp>
0017 #include <boost/beast/core/string.hpp>
0018 #include <boost/beast/core/static_string.hpp>
0019 #include <boost/beast/core/detail/static_ostream.hpp>
0020 #include <boost/optional.hpp>
0021
0022 namespace boost {
0023 namespace beast {
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 class string_param
0045 {
0046 string_view sv_;
0047 char buf_[128];
0048 boost::optional<detail::static_ostream> os_;
0049
0050 template<class T>
0051 typename std::enable_if<
0052 std::is_integral<T>::value>::type
0053 print(T const&);
0054
0055 template<class T>
0056 typename std::enable_if<
0057 ! std::is_integral<T>::value &&
0058 ! std::is_convertible<T, string_view>::value
0059 >::type
0060 print(T const&);
0061
0062 void
0063 print(string_view);
0064
0065 template<class T>
0066 typename std::enable_if<
0067 std::is_integral<T>::value>::type
0068 print_1(T const&);
0069
0070 template<class T>
0071 typename std::enable_if<
0072 ! std::is_integral<T>::value>::type
0073 print_1(T const&);
0074
0075 void
0076 print_n()
0077 {
0078 }
0079
0080 template<class T0, class... TN>
0081 void
0082 print_n(T0 const&, TN const&...);
0083
0084 template<class T0, class T1, class... TN>
0085 void
0086 print(T0 const&, T1 const&, TN const&...);
0087
0088 public:
0089
0090 string_param(string_param const&) = delete;
0091
0092
0093 string_param& operator=(string_param const&) = delete;
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110 template<class... Args>
0111 string_param(Args const&... args);
0112
0113
0114 string_view
0115 str() const
0116 {
0117 return sv_;
0118 }
0119
0120
0121 operator string_view const() const
0122 {
0123 return sv_;
0124 }
0125 };
0126
0127 }
0128 }
0129
0130 #include <boost/beast/core/impl/string_param.hpp>
0131
0132 #endif
0133
0134 #endif