27 #ifndef _STRING_TOOLS_H_ 28 #define _STRING_TOOLS_H_ 33 #include <boost/utility/string_ref.hpp> 34 #include <boost/algorithm/string.hpp> 43 #ifdef WINDOWS_PLATFORM 44 #pragma comment (lib, "Rpcrt4.lib") 49 namespace string_tools
83 return boost::trim_copy(
str);
88 template<
class t_pod_type>
91 static_assert(std::is_standard_layout<t_pod_type>(),
"expected standard layout type");
92 static_assert(
alignof(t_pod_type) == 1,
"type may have padding");
96 template<
class t_pod_type>
97 bool hex_to_pod(
const boost::string_ref hex_str, t_pod_type&
s)
99 static_assert(std::is_standard_layout<t_pod_type>(),
"expected standard layout type");
100 static_assert(
alignof(t_pod_type) == 1,
"type may have padding");
101 static_assert(std::is_trivially_copyable<t_pod_type>(),
"type must be trivially copyable");
105 template<
class t_pod_type>
106 bool hex_to_pod(
const boost::string_ref hex_str, tools::scrubbed<t_pod_type>&
s)
111 template<
class t_pod_type>
121 std::stringstream ss;
138 #endif //_STRING_TOOLS_H_
const char * res
Definition: hmac_keccak.cpp:42
const uint32_t T[512]
Definition: groestl_tables.h:36
span< const std::uint8_t > as_byte_span(const T &src) noexcept
Definition: span.h:161
::std::string string
Definition: gtest-port.h:1097
const char * s
Definition: minissdp.c:596
unsigned short uint16_t
Definition: stdint.h:125
span< std::uint8_t > as_mut_byte_span(T &src) noexcept
Definition: span.h:172
const char * str2
Definition: testupnpdescgen.c:132
const char * str1
Definition: testupnpdescgen.c:131
unsigned int uint32_t
Definition: stdint.h:126
::std::wstring wstring
Definition: gtest-port.h:1103
unsigned __int64 uint64_t
Definition: stdint.h:136
static bool to_buffer(span< std::uint8_t > out, boost::string_ref src) noexcept
Definition: hex.cpp:96
static bool to_string(std::string &out, boost::string_ref src)
Definition: hex.cpp:90
boost::endian::big_uint32_t ip
Definition: socks.cpp:62
boost::endian::big_uint16_t port
Definition: socks.cpp:61
const char *const str
Definition: portlistingparse.c:23
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:39
constexpr span< const typename T::value_type > to_span(const T &src)
Definition: span.h:122
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
signed __int64 int64_t
Definition: stdint.h:135
T & unwrap(mlocked< T > &src)
Definition: mlocker.h:81
static std::string string(const span< const std::uint8_t > src)
Definition: hex.cpp:69
static constexpr const char hex[]
Definition: wipeable_string.cpp:36
c
Definition: pymoduletest.py:79
span< const std::uint8_t > to_byte_span(const span< const T > src) noexcept
Definition: span.h:138