ゴミ箱
string_param.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9 
10 #ifndef BOOST_BEAST_STRING_PARAM_HPP
11 #define BOOST_BEAST_STRING_PARAM_HPP
12 
13 #include <boost/beast/config.hpp>
18 #include <boost/optional.hpp>
19 
20 namespace boost {
21 namespace beast {
22 
43 {
44  string_view sv_;
45  char buf_[128];
46  boost::optional<detail::static_ostream> os_;
47 
48  template<class T>
49  typename std::enable_if<
50  std::is_integral<T>::value>::type
51  print(T const&);
52 
53  template<class T>
54  typename std::enable_if<
55  ! std::is_integral<T>::value &&
56  ! std::is_convertible<T, string_view>::value
57  >::type
58  print(T const&);
59 
60  void
61  print(string_view);
62 
63  template<class T>
64  typename std::enable_if<
65  std::is_integral<T>::value>::type
66  print_1(T const&);
67 
68  template<class T>
69  typename std::enable_if<
70  ! std::is_integral<T>::value>::type
71  print_1(T const&);
72 
73  void
74  print_n()
75  {
76  }
77 
78  template<class T0, class... TN>
79  void
80  print_n(T0 const&, TN const&...);
81 
82  template<class T0, class T1, class... TN>
83  void
84  print(T0 const&, T1 const&, TN const&...);
85 
86 public:
88  string_param(string_param const&) = delete;
89 
91  string_param& operator=(string_param const&) = delete;
92 
108  template<class... Args>
109  string_param(Args const&... args);
110 
113  str() const
114  {
115  return sv_;
116  }
117 
119  operator string_view const() const
120  {
121  return sv_;
122  }
123 };
124 
125 } // beast
126 } // boost
127 
129 
130 #endif
Definition: async_result.hpp:20
Definition: string_param.hpp:42
boost::string_ref string_view
The type of string view used by the library.
Definition: string.hpp:36
string_param(string_param const &)=delete
Copy constructor (disallowed)
string_param & operator=(string_param const &)=delete
Copy assignment (disallowed)
string_view str() const
Returns the contained string.
Definition: string_param.hpp:113