E-MailRelay
Classes | Functions
G::StrImp Namespace Reference

An implementation namespace for G::Str. More...

Classes

struct  InPlaceBackInserter
 A character appender used by G::Str. More...
 
struct  Joiner
 A sub-string joiner used by G::Str. More...
 
struct  PrintableAppender
 A character appender used by G::Str. More...
 

Functions

bool isDigit (char c)
 
bool isHex (char c)
 
bool isPrintableAscii (char c)
 
char toLower (char c)
 
char toUpper (char c)
 
unsigned short toUShort (const std::string &s, bool &overflow, bool &invalid)
 
unsigned long toULong (const std::string &s, bool &overflow, bool &invalid)
 
unsigned long toULongHex (const std::string &s, bool limited)
 
unsigned int toUInt (const std::string &s, bool &overflow, bool &invalid)
 
short toShort (const std::string &s, bool &overflow, bool &invalid)
 
long toLong (const std::string &s, bool &overflow, bool &invalid)
 
int toInt (const std::string &s, bool &overflow, bool &invalid)
 
void strncpy (char *, const char *, std::size_t) noexcept
 
void escape (std::string &s, char c_escape, const char *specials_in, const char *specials_out, bool with_nul)
 
void readLineFrom (std::istream &stream, const std::string &eol, std::string &line)
 
template<typename S , typename T , typename SV >
void splitIntoTokens (const S &in, T &out, const SV &ws)
 
template<typename S , typename T >
void splitIntoTokens (const S &in, T &out, const S &ws, typename S::value_type esc)
 
template<typename T >
void splitIntoFields (const std::string &in, T &out, string_view ws)
 
template<typename T >
void splitIntoFields (const std::string &in_in, T &out, string_view ws, char escape, bool remove_escapes)
 
template<typename T1 , typename T2 , typename P >
bool equal4 (T1 p1, T1 end1, T2 p2, T2 end2, P p)
 
bool ilessc (char c1, char c2)
 
bool iless (const std::string &a, const std::string &b)
 
bool imatchc (char c1, char c2)
 
bool imatch (const std::string &a, const std::string &b)
 
bool match (const std::string &a, const std::string &b, bool ignore_case)
 
template<typename T , typename V >
unique (T in, T end, V repeat, V replacement)
 
bool inList (StringArray::const_iterator begin, StringArray::const_iterator end, const std::string &s, bool i)
 
bool notInList (StringArray::const_iterator begin, StringArray::const_iterator end, const std::string &s, bool i)
 
void join (const std::string &, std::string &, const std::string &)
 
template<typename Tout >
std::size_t outputHex (Tout out, char c)
 
template<typename Tout >
std::size_t outputHex (Tout out, wchar_t c)
 
template<typename Tout , typename Tchar >
std::size_t outputPrintable (Tout, Tchar, Tchar, char, bool)
 

Detailed Description

An implementation namespace for G::Str.

Function Documentation

◆ equal4()

template<typename T1 , typename T2 , typename P >
bool G::StrImp::equal4 ( T1  p1,
T1  end1,
T2  p2,
T2  end2,
p 
)

Definition at line 1379 of file gstr.cpp.

◆ escape()

void G::StrImp::escape ( std::string &  s,
char  c_escape,
const char *  specials_in,
const char *  specials_out,
bool  with_nul 
)

Definition at line 117 of file gstr.cpp.

◆ iless()

bool G::StrImp::iless ( const std::string &  a,
const std::string &  b 
)

Definition at line 1397 of file gstr.cpp.

◆ ilessc()

bool G::StrImp::ilessc ( char  c1,
char  c2 
)

Definition at line 1390 of file gstr.cpp.

◆ imatch()

bool G::StrImp::imatch ( const std::string &  a,
const std::string &  b 
)

Definition at line 1419 of file gstr.cpp.

◆ imatchc()

bool G::StrImp::imatchc ( char  c1,
char  c2 
)

Definition at line 1407 of file gstr.cpp.

◆ inList()

bool G::StrImp::inList ( StringArray::const_iterator  begin,
StringArray::const_iterator  end,
const std::string &  s,
bool  i 
)

Definition at line 1485 of file gstr.cpp.

◆ isDigit()

bool G::StrImp::isDigit ( char  c)

Definition at line 375 of file gstr.cpp.

◆ isHex()

bool G::StrImp::isHex ( char  c)

Definition at line 381 of file gstr.cpp.

◆ isPrintableAscii()

bool G::StrImp::isPrintableAscii ( char  c)

Definition at line 387 of file gstr.cpp.

◆ join()

void G::StrImp::join ( const std::string &  sep,
std::string &  result,
const std::string &  s 
)

Definition at line 1231 of file gstr.cpp.

◆ match()

bool G::StrImp::match ( const std::string &  a,
const std::string &  b,
bool  ignore_case 
)

Definition at line 1424 of file gstr.cpp.

◆ notInList()

bool G::StrImp::notInList ( StringArray::const_iterator  begin,
StringArray::const_iterator  end,
const std::string &  s,
bool  i 
)

Definition at line 1492 of file gstr.cpp.

◆ outputHex() [1/2]

template<typename Tout >
std::size_t G::StrImp::outputHex ( Tout  out,
char  c 
)

Definition at line 762 of file gstr.cpp.

◆ outputHex() [2/2]

template<typename Tout >
std::size_t G::StrImp::outputHex ( Tout  out,
wchar_t  c 
)

Definition at line 773 of file gstr.cpp.

◆ outputPrintable()

template<typename Tout , typename Tchar >
std::size_t G::StrImp::outputPrintable ( Tout  out,
Tchar  c,
Tchar  escape_in,
char  escape_out,
bool  eight_bit 
)

Definition at line 787 of file gstr.cpp.

◆ readLineFrom()

void G::StrImp::readLineFrom ( std::istream &  stream,
const std::string &  eol,
std::string &  line 
)

Definition at line 931 of file gstr.cpp.

◆ splitIntoFields() [1/2]

template<typename T >
void G::StrImp::splitIntoFields ( const std::string &  in,
T &  out,
string_view  ws 
)

Definition at line 1090 of file gstr.cpp.

◆ splitIntoFields() [2/2]

template<typename T >
void G::StrImp::splitIntoFields ( const std::string &  in_in,
T &  out,
string_view  ws,
char  escape,
bool  remove_escapes 
)

Definition at line 1110 of file gstr.cpp.

◆ splitIntoTokens() [1/2]

template<typename S , typename T >
void G::StrImp::splitIntoTokens ( const S &  in,
T &  out,
const S &  ws,
typename S::value_type  esc 
)

Definition at line 1036 of file gstr.cpp.

◆ splitIntoTokens() [2/2]

template<typename S , typename T , typename SV >
void G::StrImp::splitIntoTokens ( const S &  in,
T &  out,
const SV &  ws 
)

Definition at line 1020 of file gstr.cpp.

◆ strncpy()

void G::StrImp::strncpy ( char *  dst,
const char *  src,
std::size_t  n 
)
noexcept

Definition at line 1517 of file gstr.cpp.

◆ toInt()

int G::StrImp::toInt ( const std::string &  s,
bool &  overflow,
bool &  invalid 
)

Definition at line 520 of file gstr.cpp.

◆ toLong()

long G::StrImp::toLong ( const std::string &  s,
bool &  overflow,
bool &  invalid 
)

Definition at line 542 of file gstr.cpp.

◆ toLower()

char G::StrImp::toLower ( char  c)

Definition at line 393 of file gstr.cpp.

◆ toShort()

short G::StrImp::toShort ( const std::string &  s,
bool &  overflow,
bool &  invalid 
)

Definition at line 577 of file gstr.cpp.

◆ toUInt()

unsigned int G::StrImp::toUInt ( const std::string &  s,
bool &  overflow,
bool &  invalid 
)

Definition at line 617 of file gstr.cpp.

◆ toULong()

unsigned long G::StrImp::toULong ( const std::string &  s,
bool &  overflow,
bool &  invalid 
)

Definition at line 693 of file gstr.cpp.

◆ toULongHex()

unsigned long G::StrImp::toULongHex ( const std::string &  s,
bool  limited 
)

Definition at line 651 of file gstr.cpp.

◆ toUpper()

char G::StrImp::toUpper ( char  c)

Definition at line 399 of file gstr.cpp.

◆ toUShort()

unsigned short G::StrImp::toUShort ( const std::string &  s,
bool &  overflow,
bool &  invalid 
)

Definition at line 726 of file gstr.cpp.

◆ unique()

template<typename T , typename V >
T G::StrImp::unique ( in,
end,
repeat,
replacement 
)

Definition at line 1451 of file gstr.cpp.