libutil++  1.9.3
 All Classes Functions Variables
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
sella::util::String Class Reference

Public Types

enum  Algo : uint8_t { Auto, Zlib, LZ4, Gzip }
 
typedef const
boost::regex_constants::syntax_option_type 
REFlag
 
typedef const
boost::regex_constants::match_flag_type 
MatchFlag
 

Static Public Member Functions

static REFlag & DefaultREFlags (void)
 
static MatchFlag & DefaultMatchFlags (void)
 
static const std::string & DefaultSalt (void)
 
static const std::string & AlphaNumericMixedCase (void)
 
static const std::string & AlphaNumbericUpperCase (void)
 
static const std::string & AlphaNumbericLowerCase (void)
 
static const std::string & Whitespace (void)
 
static const std::string & Delim (void)
 
static const std::string & nil (void)
 
static const char * RadixLookup (void)
 
static std::string sprintf (const char *format,...) throw ()
 
static std::string sprintf (const std::string &format,...) throw ()
 
static std::string vsprintf (const char *format, va_list args) throw ()
 
static std::string vsprintf (const std::string &format, va_list args) throw ()
 
static int strcmp (const std::string &a, const std::string &b) throw ()
 
static int strcasecmp (const std::string &a, const std::string &b) throw ()
 
static int strncmp (const std::string &a, const std::string &b, size_t len) throw ()
 
static int strncasecmp (const std::string &a, const std::string &b, size_t len) throw ()
 
static bool str_imatch (const std::string &a, const std::string &b) throw ()
 
static std::string substr_replace (const std::string &src, const std::string &search, const std::string &replace=nil(), bool global=true) throw ()
 
static std::string & substr_replace (std::string &src, const std::string &search, const std::string &replace=nil(), bool global=true) throw ()
 
static std::string substr_ireplace (const std::string &src, const std::string &search, const std::string &replace=nil(), bool global=true) throw ()
 
static std::string & substr_ireplace (std::string &src, const std::string &search, const std::string &replace=nil(), bool global=true) throw ()
 
static std::string escape_percent (const std::string &src) throw ()
 
static std::string escape (const std::string &src, const std::string &chars="\"", const std::string &escape="\\") throw ()
 
static std::string regex_replace (const std::string &src, const boost::regex &regex, const std::string &replace=nil(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string regex_replace (const std::string &src, const std::string &regex, const std::string &replace=nil(), REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string & regex_replace (std::string &src, const boost::regex &regex, const std::string &replace=nil(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string & regex_replace (std::string &src, const std::string &regex, const std::string &replace=nil(), REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string regex_ireplace (const std::string &src, const boost::regex &regex, const std::string &replace=nil(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string regex_ireplace (const std::string &src, const std::string &regex, const std::string &replace=nil(), REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string & regex_ireplace (std::string &src, const boost::regex &regex, const std::string &replace=nil(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::string & regex_ireplace (std::string &src, const std::string &regex, const std::string &replace=nil(), REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const boost::regex &regex, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const std::string &regex, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const boost::regex &regex, boost::cmatch &matches, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const std::string &regex, boost::cmatch &matches, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const boost::regex &regex, std::string &match, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const std::string &regex, std::string &match, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const boost::regex &regex, std::vector< std::string > &matches, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_match (const std::string &src, const std::string &regex, std::vector< std::string > &matches, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const boost::regex &regex, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const std::string &regex, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const boost::regex &regex, boost::cmatch &matches, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const std::string &regex, boost::cmatch &matches, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const boost::regex &regex, std::string &match, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const std::string &regex, std::string &match, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const boost::regex &regex, std::vector< std::string > &matches, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_imatch (const std::string &src, const std::string &regex, std::vector< std::string > &matches, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const boost::regex &regex, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const std::string &regex, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const boost::regex &regex, boost::cmatch &matches, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const std::string &regex, boost::cmatch &matches, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const boost::regex &regex, std::string &match, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const std::string &regex, std::string &match, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const boost::regex &regex, std::vector< std::string > &matches, bool global=true, bool subexp=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const std::string &regex, std::vector< std::string > &matches, bool global=true, bool subexp=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const boost::regex &regex, std::set< std::string > &matches, bool global=true, bool subexp=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search (const std::string &src, const std::string &regex, std::set< std::string > &matches, bool global=true, bool subexp=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search_sub (const std::string &src, const boost::regex &regex, std::vector< std::string > &matches, bool global=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search_sub (const std::string &src, const std::string &regex, std::vector< std::string > &matches, bool global=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search_sub (const std::string &src, const boost::regex &regex, std::set< std::string > &matches, bool global=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_search_sub (const std::string &src, const std::string &regex, std::set< std::string > &matches, bool global=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const boost::regex &regex, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const std::string &regex, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const boost::regex &regex, boost::cmatch &matches, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const std::string &regex, boost::cmatch &matches, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const boost::regex &regex, std::string &match, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const std::string &regex, std::string &match, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const boost::regex &regex, std::vector< std::string > &matches, bool global=true, bool subexp=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const std::string &regex, std::vector< std::string > &matches, bool global=true, bool subexp=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const boost::regex &regex, std::set< std::string > &matches, bool global=true, bool subexp=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch (const std::string &src, const std::string &regex, std::set< std::string > &matches, bool global=true, bool subexp=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch_sub (const std::string &src, const boost::regex &regex, std::vector< std::string > &matches, bool global=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch_sub (const std::string &src, const std::string &regex, std::vector< std::string > &matches, bool global=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch_sub (const std::string &src, const boost::regex &regex, std::set< std::string > &matches, bool global=true, MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static bool regex_isearch_sub (const std::string &src, const std::string &regex, std::set< std::string > &matches, bool global=true, REFlag reFlags=DefaultREFlags(), MatchFlag mFlags=DefaultMatchFlags()) throw (RegexException)
 
static std::vector< std::string > regex_split (const std::string &str, const boost::regex &delim, bool empty=true, size_t limit=-1) throw (RegexException)
 
static std::vector< std::string > regex_split (const std::string &str, const std::string &regex, bool empty=true, size_t limit=-1, REFlag reFlags=DefaultREFlags()) throw (RegexException)
 
static std::vector< std::string > regex_isplit (const std::string &str, const boost::regex &delim, bool empty=true, size_t limit=-1) throw (RegexException)
 
static std::vector< std::string > regex_isplit (const std::string &str, const std::string &regex, bool empty=true, size_t limit=-1, REFlag reFlags=DefaultREFlags()) throw (RegexException)
 
static std::vector< std::string > split (const std::string &str, const std::string &delim=Delim(), bool exact=false, bool empty=true, size_t limit=-1) throw ()
 
static std::vector< std::string > split (const std::string &str, char delim, bool empty=true, size_t limit=-1) throw ()
 
static std::vector< std::string > split (const std::string &str, const boost::regex &delim, bool empty=true, size_t limit=-1) throw ()
 
static std::vector< std::string > split_csv (const std::string &line, const std::string &delim, bool empty=true, size_t limit=-1) throw ()
 
static std::string join (const std::vector< std::string > &src, const std::string &delim, char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::vector< std::string > &src, char delim= ',', char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::list< std::string > &src, const std::string &delim, char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::list< std::string > &src, char delim= ',', char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::set< std::string > &src, const std::string &delim, char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::set< std::string > &src, char delim= ',', char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::vector< variant::Variant > &src, const std::string &delim, char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string join (const std::vector< variant::Variant > &src, char delim= ',', char quote= '\0', const std::string &empty=nil(), const std::string &lbr=nil(), const std::string &rbr=nil(), size_t threshold=1) throw ()
 
static std::string trim (const std::string &str, const std::string &space=Whitespace()) throw ()
 
static std::string trim (const std::string &str, char space) throw ()
 
static std::string & trim (std::string &str, const std::string &space=Whitespace()) throw ()
 
static std::string & trim (std::string &str, char space) throw ()
 
static std::string rtrim (const std::string &str, const std::string &space=Whitespace()) throw ()
 
static std::string rtrim (const std::string &str, char space) throw ()
 
static std::string & rtrim (std::string &str, const std::string &space=Whitespace()) throw ()
 
static std::string & rtrim (std::string &str, char space) throw ()
 
static std::string ltrim (const std::string &str, const std::string &space=Whitespace()) throw ()
 
static std::string ltrim (const std::string &str, char space) throw ()
 
static std::string & ltrim (std::string &str, const std::string &space=Whitespace()) throw ()
 
static std::string & ltrim (std::string &str, char space) throw ()
 
static std::string lower (const std::string &src) throw ()
 
static std::string & lower (std::string &src) throw ()
 
static std::string upper (const std::string &src) throw ()
 
static std::string & upper (std::string &src) throw ()
 
static std::string ucfirst (const std::string &src) throw ()
 
static std::string & ucfirst (std::string &src) throw ()
 
static std::string ucword (const std::string &src) throw ()
 
static std::string & ucword (std::string &src) throw ()
 
static std::string itoa (int64_t src, int base=10) throw ()
 
static std::string itoa (uint64_t src, int base=10) throw ()
 
static std::string itoa (long src, int base=10) throw ()
 
static std::string itoa (unsigned long src, int base=10) throw ()
 
static char * itoa (int64_t src, char *dst, size_t &len, int base=10) throw ()
 
static char * itoa (uint64_t src, char *dst, size_t &len, int base=10) throw ()
 
static char * itoa (long src, char *dst, size_t &len, int base=10) throw ()
 
static char * itoa (unsigned long src, char *dst, size_t &len, int base=10) throw ()
 
static std::string bandwidth (int64_t bps, int decimals=0) throw ()
 
static std::string bandwidth (uint64_t bps, int decimals=0) throw ()
 
static std::string bandwidth (long bps, int decimals=0) throw ()
 
static std::string bandwidth (unsigned long bps, int decimals=0) throw ()
 
static std::string rate (int64_t bps, int decimals=0, const std::string &suffix="s") throw ()
 
static std::string rate (uint64_t bps, int decimals=0, const std::string &suffix="s") throw ()
 
static std::string rate (long bps, int decimals=0, const std::string &suffix="s") throw ()
 
static std::string rate (unsigned long bps, int decimals=0, const std::string &suffix="s") throw ()
 
static std::string dataSize (int64_t bytes, int decimals=0) throw ()
 
static std::string dataSize (uint64_t bytes, int decimals=0) throw ()
 
static std::string dataSize (long bytes, int decimals=0) throw ()
 
static std::string dataSize (unsigned long bytes, int decimals=0) throw ()
 
static uint64_t dataSize (const std::string &dataSize) throw ()
 
static std::string dataRate (int64_t bps, int decimals=0) throw ()
 
static std::string dataRate (uint64_t bps, int decimals=0) throw ()
 
static std::string dataRate (long bps, int decimals=0) throw ()
 
static std::string dataRate (unsigned long bps, int decimals=0) throw ()
 
static uint64_t dataRate (const std::string &dataRate) throw ()
 
static std::string duration (int64_t usec, int decimals=0) throw ()
 
static std::string duration (uint64_t usec, int decimals=0) throw ()
 
static std::string duration (long usec, int decimals=0) throw ()
 
static std::string duration (unsigned long usec, int decimals=0) throw ()
 
static std::string scale (int64_t value, int decimals=0) throw ()
 
static std::string scale (uint64_t value, int decimals=0) throw ()
 
static std::string scale (long value, int decimals=0) throw ()
 
static std::string scale (unsigned long value, int decimals=0) throw ()
 
static std::string deflate (const std::string &src, Algo algo=Zlib, int level=DefaultLevel) throw (CompressionException)
 
static std::vector< char > deflate (const std::vector< char > &src, Algo algo=Zlib, int level=DefaultLevel, size_t size=0) throw (CompressionException)
 
static std::string inflate (const std::string &src, Algo algo=Auto) throw (CompressionException)
 
static std::vector< char > inflate (const std::vector< char > &src, Algo algo=Auto, size_t size=0) throw (CompressionException)
 
static std::string encrypt (const std::string &src, const std::string &password, const std::string &salt=DefaultSalt(), uint32_t seed=0) throw (CryptException)
 
static std::string & encrypt (std::string &src, const std::string &password, const std::string &salt=DefaultSalt(), uint32_t seed=0) throw (CryptException)
 
static std::string decrypt (const std::string &src, const std::string &password, const std::string &salt=DefaultSalt(), uint32_t seed=0) throw (CryptException)
 
static std::string & decrypt (std::string &src, const std::string &password, const std::string &salt=DefaultSalt(), uint32_t seed=0) throw (CryptException)
 
static std::string random (size_t len, const std::string &charset=AlphaNumericMixedCase(), uint32_t seed=0) throw ()
 
static std::string base64_encode (unsigned char const *src, unsigned int in_len, bool standard=true) throw ()
 
static std::string base64_encode (const std::string &src, bool standard=true) throw ()
 
static std::string base64_decode (const std::string &src, bool standard=true) throw ()
 
static bool isPrintable (const std::string &src) throw ()
 

Static Public Attributes

static const int DefaultLevel = 6
 

Detailed Description

Definition at line 36 of file String.h.


The documentation for this class was generated from the following files: