string-helper.hpp File Reference
#include "../common.hpp"
+ Include dependency graph for string-helper.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ndn::AsHex
 Helper class to convert a number to hexadecimal format, for use with stream insertion operators. More...
 
class  ndn::StringHelperError
 

Namespaces

 ndn
 Copyright (c) 2013-2017 Regents of the University of California.
 

Functions

std::string ndn::escape (const std::string &str)
 Percent-encode a string. More...
 
void ndn::escape (std::ostream &os, const char *str, size_t len)
 
shared_ptr< Buffer > ndn::fromHex (const std::string &hexString)
 Convert the hex string to buffer. More...
 
constexpr int ndn::fromHexChar (char c) noexcept
 Convert the hex character c to an integer in [0, 15], or -1 if it's not a hex character. More...
 
std::ostream & ndn::operator<< (std::ostream &os, const AsHex &hex)
 
void ndn::printHex (std::ostream &os, uint64_t num, bool wantUpperCase=false)
 Output the hex representation of num to the output stream os. More...
 
void ndn::printHex (std::ostream &os, const uint8_t *buffer, size_t length, bool wantUpperCase=true)
 Output the hex representation of the bytes in buffer to the output stream os. More...
 
void ndn::printHex (std::ostream &os, const Buffer &buffer, bool wantUpperCase=true)
 Output the hex representation of the bytes in buffer to the output stream os. More...
 
std::string ndn::toHex (const uint8_t *buffer, size_t length, bool wantUpperCase=true)
 Return a string containing the hex representation of the bytes in buffer. More...
 
std::string ndn::toHex (const Buffer &buffer, bool wantUpperCase=true)
 Return a string containing the hex representation of the bytes in buffer. More...
 
constexpr char ndn::toHexChar (unsigned int n, bool wantUpperCase=true) noexcept
 Convert (the least significant nibble of) n to the corresponding hex character. More...
 
std::string ndn::unescape (const std::string &str)
 Decode a percent-encoded string. More...
 
void ndn::unescape (std::ostream &os, const char *str, size_t len)