27#ifndef _STRING_TOOLS_H_
28#define _STRING_TOOLS_H_
33#include <boost/utility/string_ref.hpp>
42#ifdef WINDOWS_PLATFORM
43#pragma comment (lib, "Rpcrt4.lib")
70 std::string get_current_module_path();
76 inline std::string&
trim(std::string&
str)
83 inline std::string
trim(
const std::string& str_)
85 std::string
str = str_;
90 std::string
pad_string(std::string
s,
size_t n,
char c =
' ',
bool prepend =
false);
93 template<
class t_pod_type>
96 static_assert(std::is_standard_layout<t_pod_type>(),
"expected standard layout type");
100 template<
class t_pod_type>
103 static_assert(std::is_standard_layout<t_pod_type>(),
"expected standard layout type");
107 template<
class t_pod_type>
108 bool hex_to_pod(
const boost::string_ref hex_str, tools::scrubbed<t_pod_type>&
s)
113 template<
class t_pod_type>
122 static_assert(std::is_arithmetic<T>::value,
"only arithmetic types");
123 std::stringstream ss;
124 ss << std::hex << val;
135 std::wstring utf8_to_utf16(
const std::string&
str);
136 std::string utf16_to_utf8(
const std::wstring& wstr);
#define s(x, c)
Definition: aesb.c:47
const char * res
Definition: hmac_keccak.cpp:42
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:40
span< std::uint8_t > as_mut_byte_span(T &src) noexcept
Definition: span.h:161
span< const std::uint8_t > to_byte_span(const span< const T > src) noexcept
Definition: span.h:144
T & unwrap(mlocked< T > &src)
Definition: mlocker.h:81
constexpr span< const typename T::value_type > to_span(const T &src)
Definition: span.h:122
span< const std::uint8_t > as_byte_span(const T &src) noexcept
Definition: span.h:152
const char *const str
Definition: portlistingparse.c:23
boost::endian::big_uint16_t port
Definition: socks.cpp:59
boost::endian::big_uint32_t ip
Definition: socks.cpp:60
unsigned short uint16_t
Definition: stdint.h:125
signed __int64 int64_t
Definition: stdint.h:135
unsigned int uint32_t
Definition: stdint.h:126
unsigned __int64 uint64_t
Definition: stdint.h:136
static bool to_string(std::string &out, boost::string_ref src)
Definition: hex.cpp:90
static bool to_buffer(span< std::uint8_t > out, boost::string_ref src) noexcept
Definition: hex.cpp:96
static std::string string(const span< const std::uint8_t > src)
Definition: hex.cpp:69
const char * str1
Definition: testupnpdescgen.c:131
const char * str2
Definition: testupnpdescgen.c:132