OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Static Public Member Functions | List of all members
Misc::StringUtils Class Reference

#include <stringops.hpp>

Collaboration diagram for Misc::StringUtils:

Classes

struct  ci
 
struct  CiComp
 

Static Public Member Functions

static char toLower (char c)
 
static Utf8Stream::UnicodeChar toLowerUtf8 (Utf8Stream::UnicodeChar ch)
 
static std::string lowerCaseUtf8 (const std::string str)
 
static bool ciLess (const std::string &x, const std::string &y)
 
static bool ciEqual (const std::string &x, const std::string &y)
 
static int ciCompareLen (const std::string &x, const std::string &y, size_t len)
 
static void lowerCaseInPlace (std::string &inout)
 Transforms input string to lower case w/o copy. More...
 
static std::string lowerCase (const std::string &in)
 Returns lower case copy of input string. More...
 
template<typename Iterator , typename T >
static Iterator partialBinarySearch (Iterator begin, Iterator end, const T &key)
 Performs a binary search on a sorted container for a string that 'key' starts with. More...
 
static std::string & replaceAll (std::string &str, const char *what, const char *with, std::size_t whatLen=std::string::npos, std::size_t withLen=std::string::npos)
 Replaces all occurrences of a string in another string. More...
 

Member Function Documentation

static int Misc::StringUtils::ciCompareLen ( const std::string &  x,
const std::string &  y,
size_t  len 
)
inlinestatic

Here is the call graph for this function:

Here is the caller graph for this function:

static bool Misc::StringUtils::ciEqual ( const std::string &  x,
const std::string &  y 
)
inlinestatic

Here is the call graph for this function:

static bool Misc::StringUtils::ciLess ( const std::string &  x,
const std::string &  y 
)
inlinestatic

Here is the caller graph for this function:

static std::string Misc::StringUtils::lowerCase ( const std::string &  in)
inlinestatic

Returns lower case copy of input string.

Here is the call graph for this function:

static void Misc::StringUtils::lowerCaseInPlace ( std::string &  inout)
inlinestatic

Transforms input string to lower case w/o copy.

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string Misc::StringUtils::lowerCaseUtf8 ( const std::string  str)
inlinestatic

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename Iterator , typename T >
static Iterator Misc::StringUtils::partialBinarySearch ( Iterator  begin,
Iterator  end,
const T key 
)
inlinestatic

Performs a binary search on a sorted container for a string that 'key' starts with.

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string& Misc::StringUtils::replaceAll ( std::string &  str,
const char *  what,
const char *  with,
std::size_t  whatLen = std::string::npos,
std::size_t  withLen = std::string::npos 
)
inlinestatic

Replaces all occurrences of a string in another string.

Parameters
strThe string to operate on.
whatThe string to replace.
withThe replacement string.
whatLenThe length of the string to replace.
withLenThe length of the replacement string.
Returns
A reference to the string passed in str.

Here is the caller graph for this function:

static char Misc::StringUtils::toLower ( char  c)
inlinestatic

Plain and simple locale-unaware toLower. Anything from A to Z is lower-cased, multibyte characters are unchanged. Don't use std::tolower(char, locale&) because that is abysmally slow. Don't use tolower(int) because that depends on global locale.

Here is the caller graph for this function:

static Utf8Stream::UnicodeChar Misc::StringUtils::toLowerUtf8 ( Utf8Stream::UnicodeChar  ch)
inlinestatic

Here is the caller graph for this function:


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