strusBase  0.17
Classes | Namespaces | Enumerations | Functions
string_conv.hpp File Reference
#include <string>
#include <stdexcept>

Go to the source code of this file.

Classes

struct  strus::string_conv
 Inlined version of string conversion functions throwing an exception instead of setting an error code on failure. More...
 

Namespaces

 strus
 Wrapper to structures needed for atomic counters.
 

Enumerations

enum  strus::StringConvError { strus::StringConvOk = 0x0, strus::StringConvErrNoMem = 0x1, strus::StringConvErrConversion = 0x2 }
 

Functions

std::runtime_error strus::stringconv_exception (StringConvError errcode)
 Convert string conversion error code into an exception. More...
 
std::string strus::tolower (const char *val, StringConvError &err)
 Convert ASCII letters in string to lowercase. More...
 
std::string strus::tolower (const char *val, std::size_t size, StringConvError &err)
 Convert ASCII letters in string to lowercase. More...
 
std::string strus::tolower (const std::string &val, StringConvError &err)
 Convert ASCII letters in string to lowercase. More...
 
std::string strus::trim (const std::string &val, StringConvError &err)
 Trim trailing and heading whitespace and control characters. More...
 
std::string strus::trim (const char *val, std::size_t size, StringConvError &err)
 Trim trailing and heading whitespace and control characters. More...
 
bool strus::isEmptyString (const char *val, std::size_t size)
 Evaluate if a string is empty or contains only space characters. More...
 
bool strus::isEmptyString (const std::string &val)
 Evaluate if a string is empty or contains only space characters. More...
 
bool strus::caseInsensitiveEquals (const std::string &val1, const std::string &val2)
 Compare on Ascii letter caseinsensitive equality. More...
 
bool strus::caseInsensitiveStartsWith (const std::string &val, const std::string &prefix)
 Test prefix on Ascii letter caseinsensitive equality. More...
 
bool strus::stringStartsWith (const std::string &val, const std::string &prefix)
 Test prefix on equality. More...
 
std::string strus::utf8clean (const std::string &name, StringConvError &err)
 Convert possibly broken UTF-8 to valid UTF-8. More...
 
std::string strus::unescape (const std::string &val, StringConvError &err)
 Convert excaped control characters to their unescaped form (e.g. \n to
) More...