17 #include <boost/lexical_cast.hpp> 18 #include <boost/shared_ptr.hpp> 55 std::string
trim(
const std::string& instring);
85 std::vector<std::string>
tokens(
const std::string& text,
86 const std::string& delim = std::string(
" \t\n"),
101 return (static_cast<char>(std::toupper(static_cast<int>(chr))));
111 std::transform(text.begin(), text.end(), text.begin(),
126 return (static_cast<char>(std::tolower(static_cast<int>(chr))));
135 std::transform(text.begin(), text.end(), text.begin(),
151 const std::vector<std::string>& args);
163 std::string
getToken(std::istringstream& iss);
186 template <
typename NumType,
int BitSize>
191 num = boost::lexical_cast<NumType>(num_token);
192 }
catch (
const boost::bad_lexical_cast&) {
196 if (num < 0 || num >= (static_cast<NumType>(1) << BitSize)) {
238 std::vector<uint8_t>& binary);
257 std::vector<uint8_t>& binary);
260 class StringSanitizerImpl;
285 const std::string& char_replacement);
299 std::string
scrub(
const std::string& original);
~StringSanitizer()
Destructor.
void lowercase(std::string &text)
Lowercase String.
StringSanitizer(const std::string &char_set, const std::string &char_replacement)
Constructor.
StringTokenError(const char *file, size_t line, const char *what)
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
void decodeFormattedHexString(const std::string &hex_string, std::vector< uint8_t > &binary)
Converts a formatted string of hexadecimal digits into a vector.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void uppercase(std::string &text)
Uppercase String.
NumType tokenToNum(const std::string &num_token)
Converts a string token to an unsigned integer.
char toLower(char chr)
Lowercase Character.
std::string getToken(std::istringstream &iss)
Returns one token from the given stringstream.
void normalizeSlash(std::string &name)
Normalize Backslash.
vector< string > tokens(const std::string &text, const std::string &delim, bool escape)
Split String into Tokens.
A Set of C++ Utilities for Manipulating Strings.
std::vector< uint8_t > quotedStringToBinary(const std::string "ed_string)
Converts a string in quotes into vector.
Implements a regular expression based string scrubber.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void decodeColonSeparatedHexString(const std::string &hex_string, std::vector< uint8_t > &binary)
Converts a string of hexadecimal digits with colons into a vector.
std::string scrub(const std::string &original)
Returns a scrubbed copy of a given string.
char toUpper(char chr)
Uppercase Character.
string trim(const string &instring)
Trim Leading and Trailing Spaces.
boost::shared_ptr< StringSanitizer > StringSanitizerPtr
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.