22 #ifndef NDN_UTIL_STRING_HELPER_HPP 23 #define NDN_UTIL_STRING_HELPER_HPP 25 #include "../common.hpp" 36 :
std::invalid_argument(what)
80 printHex(std::ostream& os, uint64_t num,
bool wantUpperCase =
false);
102 printHex(std::ostream& os,
const uint8_t* buffer,
size_t length,
bool wantUpperCase =
true);
112 printHex(std::ostream& os,
const Buffer& buffer,
bool wantUpperCase =
true);
133 toHex(
const uint8_t* buffer,
size_t length,
bool wantUpperCase =
true);
142 toHex(
const Buffer& buffer,
bool wantUpperCase =
true);
157 fromHex(
const std::string& hexString);
177 #endif // NDN_UTIL_STRING_HELPER_HPP
Copyright (c) 2013-2017 Regents of the University of California.
std::string toHex(const uint8_t *buffer, size_t length, bool wantUpperCase)
Return a string containing the hex representation of the bytes in buffer.
std::ostream & operator<<(std::ostream &os, const Data &data)
Helper class to convert a number to hexadecimal format, for use with stream insertion operators...
StringHelperError(const std::string &what)
shared_ptr< Buffer > fromHex(const std::string &hexString)
Convert the hex string to buffer.
std::string unescape(const std::string &str)
Decode a percent-encoded string.
int fromHexChar(char c)
Convert the hex character to an integer from 0 to 15, or -1 if not a hex character.
void printHex(std::ostream &os, uint64_t num, bool wantUpperCase)
Output the hex representation of num to the output stream os.
General-purpose automatically managed/resized buffer.
constexpr AsHex(uint64_t val) noexcept