17 #include <boost/lexical_cast.hpp>
18 #include <boost/shared_ptr.hpp>
54 std::string
trim(
const std::string& instring);
70 template<
typename Iterator>
73 for ( ; end != begin && *(end - 1) == trim_val; --end);
104 std::vector<std::string>
tokens(
const std::string& text,
105 const std::string& delim = std::string(
" \t\n"),
106 bool escape =
false);
119 return (static_cast<char>(std::toupper(static_cast<int>(chr))));
128 std::transform(text.begin(), text.end(), text.begin(),
143 return (static_cast<char>(std::tolower(static_cast<int>(chr))));
152 std::transform(text.begin(), text.end(), text.begin(),
167 const std::vector<std::string>& args);
179 std::string
getToken(std::istringstream& iss);
202 template <
typename NumType,
int BitSize>
207 num = boost::lexical_cast<NumType>(num_token);
208 }
catch (
const boost::bad_lexical_cast&) {
212 if (num < 0 || num >= (static_cast<NumType>(1) << BitSize)) {
257 const std::string& sep,
258 std::vector<uint8_t>& binary);
271 std::vector<uint8_t>& binary);
292 std::vector<uint8_t>& binary);
295 class StringSanitizerImpl;
320 const std::string& char_replacement);
334 std::string
scrub(
const std::string& original);
356 for (
const auto& ch : content) {
357 if (isprint(static_cast<int>(ch)) == 0) {
370 for (
const auto& ch : content) {
371 if (isprint(static_cast<int>(ch)) == 0) {
static const uint32_t MAX_DATA_SIZE
The maximum size for regex parameters.
~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)
void decodeSeparatedHexString(const std::string &hex_string, const std::string &sep, std::vector< uint8_t > &binary)
Converts a string of separated hexadecimal digits into a vector.
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.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
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.
Iterator seekTrimmed(Iterator begin, Iterator end, uint8_t trim_val)
Finds the "trimmed" end of a buffer.
string trim(const string &instring)
Trim Leading and Trailing Spaces.
boost::shared_ptr< StringSanitizer > StringSanitizerPtr
bool isPrintable(const std::string &content)
Check if a string is printable.
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.