20 #ifndef RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
21 #define RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
23 #include <ripple/basics/Blob.h>
24 #include <ripple/basics/strHex.h>
26 #include <boost/format.hpp>
27 #include <boost/utility/string_view.hpp>
48 template <
class Iterator>
58 for (
int i = 0; i < 10; ++i)
61 for (
int i = 0; i < 6; ++i)
72 out.reserve((strSize + 1) / 2);
78 int c = unxtab[*iter++];
88 int cHigh = unxtab[*iter++];
93 int cLow = unxtab[*iter++];
98 out.push_back(
static_cast<unsigned char>((cHigh << 4) | cLow));
101 return {std::move(
out)};
113 return strUnHex(strSrc.size(), strSrc.cbegin(), strSrc.cend());
std::vector< unsigned char > Blob
Storage for linear binary data.
std::optional< Blob > strViewUnHex(boost::string_view const &strSrc)
bool operator==(parsedURL const &other) const
std::string trim_whitespace(std::string str)
std::optional< std::uint16_t > port
std::optional< std::uint64_t > to_uint64(std::string const &s)
bool parseUrl(parsedURL &pUrl, std::string const &strUrl)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool isProperlyFormedTomlDomain(std::string const &domain)
Determines if the given string looks like a TOML-file hosting domain.
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
std::string sqlBlobLiteral(Blob const &blob)
Format arbitrary binary data as an SQLite "blob literal".