3#include <xrpl/beast/utility/instrumentation.h>
5#include <boost/core/detail/string_view.hpp>
22template <
class Out,
class In>
31 template <
class Arithmetic = In>
40 template <
class Enumeration = In>
51template <
typename Out>
58 "beast::LexicalCast can only be used with integral types");
60 template <
class Integral = Out>
65 auto first = in.data();
66 auto last = in.data() + in.size();
68 if (first != last && *first ==
'+')
73 return ret.ec ==
std::errc() && ret.ptr == last;
83 return std::tolower(static_cast<unsigned char>(c));
86 if (result ==
"1" || result ==
"true")
92 if (result ==
"0" || result ==
"false")
114 operator()(Out& out, boost::core::basic_string_view<char> in)
const
142 XRPL_ASSERT(in,
"beast::detail::LexicalCast(char const*) : non-null input");
157 XRPL_ASSERT(in,
"beast::detail::LexicalCast(char*) : non-null input");
179template <
class Out,
class In>
193template <
class Out,
class In>
209template <
class Out,
class In>
T back_inserter(T... args)
constexpr Out lexicalCastThrow(In in)
Convert from one type to another, throw on error.
constexpr bool lexicalCastChecked(Out &out, In in)
Intelligently convert from one type to another.
constexpr Out lexicalCast(In in, Out defaultValue=Out())
Convert from one type to another.
Thrown when a conversion is not possible with LexicalCast.
constexpr bool operator()(Out &out, boost::core::basic_string_view< char > in) const
constexpr bool operator()(Out &out, char *in) const
constexpr bool operator()(Out &out, char const *in) const
constexpr bool operator()(Out &out, std::string in) const
constexpr bool operator()(Integral &out, std::string_view in) const
bool operator()(bool &out, std::string_view in) const
bool operator()(std::string &out, Enumeration in)
bool operator()(std::string &out, Arithmetic in)