NCBI C++ ToolKit
Classes | Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
NStr Class Reference

Search Toolkit Book for NStr

NStr –. More...

#include <corelib/ncbistr.hpp>

Classes

class  CWrapDestStringList
 
class  IWrapDest
 

Public Types

enum  ENumToStringFlags {
  fUseLowercase = (1 << 4) , fWithRadix = (1 << 5) , fWithSign = (1 << 6) , fWithCommas = (1 << 7) ,
  fDoubleFixed = (1 << 8) , fDoubleScientific = (1 << 9) , fDoublePosix = (1 << 10) , fDoubleGeneral = fDoubleFixed | fDoubleScientific ,
  fDS_Binary = (1 << 11) , fDS_NoDecimalPoint = (1 << 12) , fDS_PutSpaceBeforeSuffix = (1 << 13) , fDS_ShortSuffix = (1 << 14) ,
  fDS_PutBSuffixToo = (1 << 15)
}
 Number to string conversion flags. More...
 
enum  EStringToNumFlags {
  fConvErr_NoThrow = (1 << 0) , fConvErr_NoErrMessage = (1 << 2) , fMandatorySign = (1 << 17) , fAllowCommas = (1 << 18) ,
  fAllowLeadingSpaces = (1 << 19) , fAllowLeadingSymbols = (1 << 20) | fAllowLeadingSpaces , fAllowTrailingSpaces = (1 << 21) , fAllowTrailingSymbols = (1 << 22) | fAllowTrailingSpaces ,
  fDecimalPosix = (1 << 23) , fDecimalPosixOrLocal = (1 << 24) , fDecimalPosixFinite = (1 << 25) , fDS_ForceBinary = (1 << 26) ,
  fDS_ProhibitFractions = (1 << 27) , fDS_ProhibitSpaceBeforeSuffix = (1 << 28)
}
 String to number conversion flags. More...
 
enum  ECase { eCase , eNocase }
 Which type of string comparison. More...
 
enum  EOccurrence { eFirst , eLast }
 Whether it is the first or last occurrence. More...
 
enum  EDirection { eForwardSearch = 0 , eReverseSearch }
 Search direction for Find() methods. More...
 
enum  ETrunc { eTrunc_Begin , eTrunc_End , eTrunc_Both }
 Which end to truncate a string. More...
 
enum  ESplitFlags {
  fSplit_MergeDelimiters = 1 << 0 , fSplit_Truncate_Begin = 1 << 1 , fSplit_Truncate_End = 1 << 2 , fSplit_Truncate = fSplit_Truncate_Begin | fSplit_Truncate_End ,
  fSplit_ByPattern = 1 << 3 , fSplit_CanEscape = 1 << 4 , fSplit_CanSingleQuote = 1 << 5 , fSplit_CanDoubleQuote = 1 << 6 ,
  fSplit_CanQuote = fSplit_CanSingleQuote | fSplit_CanDoubleQuote , fSplit_Tokenize = fSplit_MergeDelimiters | fSplit_Truncate
}
 Flags for Split*() methods. More...
 
enum  EMergeDelims { eMergeDelims = fSplit_MergeDelimiters | fSplit_Truncate , eNoMergeDelims = 0 }
 Whether to merge adjacent delimiters. More...
 
enum  EPrintableMode {
  fNewLine_Quote = 0 , eNewLine_Quote = fNewLine_Quote , fNewLine_Passthru = 1 , eNewLine_Passthru = fNewLine_Passthru ,
  fNonAscii_Passthru = 0 , fNonAscii_Quote = 2 , fPrintable_Full = 64
}
 How to display printable strings. More...
 
enum  ESS_Flags {
  fSS_alpha = 1 << 0 , fSS_digit = 1 << 1 , fSS_alnum = 1 << 2 , fSS_print = 1 << 3 ,
  fSS_cntrl = 1 << 4 , fSS_punct = 1 << 5 , fSS_Reject = 1 << 11 , fSS_Remove = 1 << 12 ,
  fSS_NoMerge = 1 << 13 , fSS_NoTruncate_Begin = 1 << 14 , fSS_NoTruncate_End = 1 << 15 , fSS_NoTruncate = fSS_NoTruncate_Begin | fSS_NoTruncate_End
}
 Flags for Sanitize(). More...
 
enum  EEscSeqRange {
  eEscSeqRange_Standard , eEscSeqRange_FirstByte , eEscSeqRange_Throw , eEscSeqRange_Errno ,
  eEscSeqRange_User
}
 C-style escape sequences parsing mode. More...
 
enum  EQuoted { eQuoted , eNotQuoted }
 Define that string is quoted or not. More...
 
enum  EXmlEncode { eXmlEnc_Contents = 0 , eXmlEnc_CommentSafe = 1 << 0 , eXmlEnc_Unsafe_Skip = 1 << 1 , eXmlEnc_Unsafe_Throw = 1 << 2 }
 XML-encode flags. More...
 
enum  EHtmlEncode {
  fHtmlEnc_EncodeAll = 0 , fHtmlEnc_SkipLiteralEntities = 1 << 1 , fHtmlEnc_SkipNumericEntities = 1 << 2 , fHtmlEnc_SkipEntities = fHtmlEnc_SkipLiteralEntities | fHtmlEnc_SkipNumericEntities ,
  fHtmlEnc_CheckPreencoded = 1 << 3
}
 HTML-decode flags. More...
 
enum  EHtmlDecode { fHtmlDec_CharRef_Entity = 1 , fHtmlDec_CharRef_Numeric = 1 << 1 , fHtmlDec_Encoding_Changed = 1 << 2 }
 HTML-decode flags. More...
 
enum  EJsonEncode { eJsonEnc_UTF8 , eJsonEnc_Quoted }
 Json-encode flags. More...
 
enum  EUrlEncode {
  eUrlEnc_SkipMarkChars , eUrlEnc_ProcessMarkChars , eUrlEnc_PercentOnly , eUrlEnc_Path ,
  eUrlEnc_URIScheme , eUrlEnc_URIUserinfo , eUrlEnc_URIHost , eUrlEnc_URIPath ,
  eUrlEnc_URIQueryName , eUrlEnc_URIQueryValue , eUrlEnc_URIFragment , eUrlEnc_Cookie ,
  eUrlEnc_None
}
 URL-encode flags. More...
 
enum  EUrlDecode { eUrlDec_All , eUrlDec_Percent }
 URL decode flags. More...
 
enum  ESqlEncode { eSqlEnc_Plain , eSqlEnc_TagNonASCII }
 SQL encode flags. More...
 
enum  EWrapFlags { fWrap_Hyphenate = 0x1 , fWrap_HTMLPre = 0x2 , fWrap_FlatFile = 0x4 }
 How to wrap the words in a string to a new line. More...
 
enum  EDedentFlags { fDedent_NormalizeEmptyLines = 1 << 0 , fDedent_SkipFirstLine = 1 << 1 , fDedent_SkipEmptyFirstLine = 1 << 2 }
 Flags for Dedent() method. More...
 
typedef int TNumToStringFlags
 Bitwise OR of "ENumToStringFlags". More...
 
typedef EStringToNumFlags EConvErrFlags
 Formerly split out. More...
 
typedef int TStringToNumFlags
 Bitwise OR of "EStringToNumFlags". More...
 
typedef TStringToNumFlags TConvErrFlags
 Formerly split out. More...
 
typedef int TSplitFlags
 Bitwise OR of ESplitFlags. More...
 
typedef int TPrintableMode
 Bitwise OR of EPrintableMode flags. More...
 
typedef int TSS_Flags
 Bitwise OR of ESS_Flags. More...
 
typedef int TXmlEncode
 
typedef int THtmlEncode
 
typedef int THtmlDecode
 
typedef int TWrapFlags
 Bitwise OR of "EWrapFlags". More...
 
typedef int TDedentFlags
 Bitwise OR of EDedentFlags. More...
 

Static Public Member Functions

template<typename TNumeric >
static TNumeric StringToNumeric (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to a numeric value. More...
 
template<typename TNumeric >
static bool StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags=0, int base=10)
 Convert string to a numeric value. More...
 
static int StringToNonNegativeInt (const CTempString str, TStringToNumFlags flags=0)
 Convert string to non-negative integer value. More...
 
static int StringToNumeric (const string &str)
 
static int StringToInt (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to int. More...
 
static unsigned int StringToUInt (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to unsigned int. More...
 
static long StringToLong (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to long. More...
 
static unsigned long StringToULong (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to unsigned long. More...
 
static double StringToDoublePosix (const char *str, char **endptr=0, TStringToNumFlags flags=0)
 Convert string to double-precision value (analog of strtod function) More...
 
static double StringToDouble (const CTempStringEx str, TStringToNumFlags flags=0)
 Convert string to double. More...
 
static double StringToDoubleEx (const char *str, size_t size, TStringToNumFlags flags=0)
 This version accepts zero-terminated string. More...
 
static Int8 StringToInt8 (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to Int8. More...
 
static Uint8 StringToUInt8 (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to Uint8. More...
 
static Uint8 StringToUInt8_DataSize (const CTempString str, TStringToNumFlags flags=0)
 Convert string that can contain "software" qualifiers to Uint8. More...
 
static Uint8 StringToUInt8_DataSize (const CTempString str, TStringToNumFlags flags, int base)
 Convert string to number of bytes. More...
 
static size_t StringToSizet (const CTempString str, TStringToNumFlags flags=0, int base=10)
 Convert string to size_t. More...
 
static const void * StringToPtr (const CTempStringEx str, TStringToNumFlags flags=0)
 Convert string to pointer. More...
 
static int HexChar (char ch)
 Convert character to integer. More...
 
template<typename TNumeric >
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString (TNumeric value, TNumToStringFlags flags=0, int base=10)
 Convert numeric value to string. More...
 
template<typename TStrictId >
static enable_if< is_integral< typename TStrictId::TId >::value &&is_member_function_pointer< decltype(&TStrictId::Get)>::value, string >::type NumericToString (TStrictId value, TNumToStringFlags flags=0, int base=10)
 
template<typename TNumeric >
static void NumericToString (string &out_str, TNumeric value, TNumToStringFlags flags=0, int base=10)
 Convert numeric value to string. More...
 
static string IntToString (int value, TNumToStringFlags flags=0, int base=10)
 Convert int to string. More...
 
static string IntToString (unsigned int value, TNumToStringFlags flags=0, int base=10)
 
static void IntToString (string &out_str, int value, TNumToStringFlags flags=0, int base=10)
 Convert int to string. More...
 
static void IntToString (string &out_str, unsigned int value, TNumToStringFlags flags=0, int base=10)
 
static string UIntToString (unsigned int value, TNumToStringFlags flags=0, int base=10)
 Convert UInt to string. More...
 
static string UIntToString (int value, TNumToStringFlags flags=0, int base=10)
 
static void UIntToString (string &out_str, unsigned int value, TNumToStringFlags flags=0, int base=10)
 Convert UInt to string. More...
 
static void UIntToString (string &out_str, int value, TNumToStringFlags flags=0, int base=10)
 
static string LongToString (long value, TNumToStringFlags flags=0, int base=10)
 Convert Int to string. More...
 
static void LongToString (string &out_str, long value, TNumToStringFlags flags=0, int base=10)
 Convert Int to string. More...
 
static string ULongToString (unsigned long value, TNumToStringFlags flags=0, int base=10)
 Convert unsigned long to string. More...
 
static void ULongToString (string &out_str, unsigned long value, TNumToStringFlags flags=0, int base=10)
 Convert unsigned long to string. More...
 
static string Int8ToString (Int8 value, TNumToStringFlags flags=0, int base=10)
 Convert Int8 to string. More...
 
static void Int8ToString (string &out_str, Int8 value, TNumToStringFlags flags=0, int base=10)
 Convert Int8 to string. More...
 
static string UInt8ToString (Uint8 value, TNumToStringFlags flags=0, int base=10)
 Convert UInt8 to string. More...
 
static void UInt8ToString (string &out_str, Uint8 value, TNumToStringFlags flags=0, int base=10)
 Convert UInt8 to string. More...
 
static string UInt8ToString_DataSize (Uint8 value, TNumToStringFlags flags=0, unsigned int max_digits=3)
 Convert UInt8 to string using "software" qualifiers. More...
 
static void UInt8ToString_DataSize (string &out_str, Uint8 value, TNumToStringFlags flags=0, unsigned int max_digits=3)
 Convert UInt8 to string using "software" qualifiers. More...
 
static string DoubleToString (double value, int precision=-1, TNumToStringFlags flags=0)
 Convert double to string. More...
 
static void DoubleToString (string &out_str, double value, int precision=-1, TNumToStringFlags flags=0)
 Convert double to string. More...
 
static SIZE_TYPE DoubleToString (double value, unsigned int precision, char *buf, SIZE_TYPE buf_size, TNumToStringFlags flags=0)
 Convert double to string with specified precision and place the result in the specified buffer. More...
 
static SIZE_TYPE DoubleToStringPosix (double value, unsigned int precision, char *buf, SIZE_TYPE buf_size)
 Convert double to string with specified precision and put the result into a character buffer, in scientific format. More...
 
static SIZE_TYPE DoubleToString_Ecvt (double value, unsigned int precision, char *buf, SIZE_TYPE buf_size, int *dec, int *sign)
 Convert double to string with specified precision. More...
 
static string SizetToString (size_t value, TNumToStringFlags flags=0, int base=10)
 Convert size_t to string. More...
 
static void PtrToString (string &out_str, const void *ptr)
 Convert pointer to string. More...
 
static string PtrToString (const void *ptr)
 Convert pointer to string. More...
 
static const string BoolToString (bool value)
 Convert bool to string. More...
 
static bool StringToBool (const CTempString str)
 Convert string to bool. More...
 
static string FormatVarargs (const char *format, va_list args)
 Handle an arbitrary printf-style format string. More...
 
static int CompareCase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
 Case-sensitive compare of a substring with another string. More...
 
static int CompareCase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const CTempString s2)
 Case-sensitive compare of a substring with another string. More...
 
static int CompareCase (const char *s1, const char *s2)
 Case-sensitive compare of two strings – char* version. More...
 
static int CompareCase (const CTempStringEx s1, const CTempStringEx s2)
 Case-sensitive compare of two strings – CTempStringEx version. More...
 
static int CompareNocase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
 Case-insensitive compare of a substring with another string. More...
 
static int CompareNocase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const CTempString s2)
 Case-insensitive compare of a substring with another string. More...
 
static int CompareNocase (const char *s1, const char *s2)
 Case-insensitive compare of two strings – char* version. More...
 
static int CompareNocase (const CTempStringEx s1, const CTempStringEx s2)
 Case-insensitive compare of two strings – CTempStringEx version. More...
 
static int Compare (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
 Compare of a substring with another string. More...
 
static int Compare (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const CTempString s2, ECase use_case=eCase)
 Compare of a substring with another string. More...
 
static int Compare (const char *s1, const char *s2, ECase use_case=eCase)
 Compare two strings – char* version. More...
 
static int Compare (const CTempStringEx s1, const CTempStringEx s2, ECase use_case=eCase)
 Compare two strings – CTempStringEx version. More...
 
static bool EqualCase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
 Case-sensitive equality of a substring with another string. More...
 
static bool EqualCase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const CTempString s2)
 Case-sensitive equality of a substring with another string. More...
 
static bool EqualCase (const char *s1, const char *s2)
 Case-sensitive equality of two strings – char* version. More...
 
static bool EqualCase (const CTempStringEx s1, const CTempStringEx s2)
 Case-sensitive equality of two strings. More...
 
static bool EqualNocase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
 Case-insensitive equality of a substring with another string. More...
 
static bool EqualNocase (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const CTempString s2)
 Case-insensitive equality of a substring with another string. More...
 
static bool EqualNocase (const char *s1, const char *s2)
 Case-insensitive equality of two strings – char* version. More...
 
static bool EqualNocase (const CTempStringEx s1, const CTempStringEx s2)
 Case-insensitive equality of two strings. More...
 
static bool Equal (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
 Test for equality of a substring with another string. More...
 
static bool Equal (const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const CTempString s2, ECase use_case=eCase)
 Test for equality of a substring with another string. More...
 
static bool Equal (const char *s1, const char *s2, ECase use_case=eCase)
 Test for equality of two strings – char* version. More...
 
static bool Equal (const CTempStringEx s1, const CTempStringEx s2, ECase use_case=eCase)
 Test for equality of two strings. More...
 
static int strcmp (const char *s1, const char *s2)
 String compare. More...
 
static int strncmp (const char *s1, const char *s2, size_t n)
 String compare up to specified number of characters. More...
 
static int strcasecmp (const char *s1, const char *s2)
 Case-insensitive comparison of two zero-terminated strings. More...
 
static int strncasecmp (const char *s1, const char *s2, size_t n)
 Case-insensitive comparison of two zero-terminated strings, narrowed to the specified number of characters. More...
 
static size_t strftime (char *s, size_t maxsize, const char *format, const struct tm *timeptr)
 Wrapper for the function strftime() that corrects handling D and T time formats on MS Windows. More...
 
static bool MatchesMask (CTempString str, CTempString mask, ECase use_case=eCase)
 Match "str" against the "mask". More...
 
static bool IsBlank (const CTempString str, SIZE_TYPE pos=0)
 Check if a string is blank (has no text). More...
 
static bool IsLower (const CTempString str)
 Checks if all letters in the given string have a lower case. More...
 
static bool IsUpper (const CTempString str)
 Checks if all letters in the given string have a upper case. More...
 
static stringToLower (string &str)
 Convert string to lower case – string& version. More...
 
static char * ToLower (char *str)
 Convert string to lower case – char* version. More...
 
static stringToUpper (string &str)
 Convert string to upper case – string& version. More...
 
static char * ToUpper (char *str)
 Convert string to upper case – char* version. More...
 
static bool StartsWith (const CTempString str, const CTempString start, ECase use_case=eCase)
 Check if a string starts with a specified prefix value. More...
 
static bool StartsWith (const CTempString str, char start, ECase use_case=eCase)
 Check if a string starts with a specified character value. More...
 
static bool EndsWith (const CTempString str, const CTempString end, ECase use_case=eCase)
 Check if a string ends with a specified suffix value. More...
 
static bool EndsWith (const CTempString str, char end, ECase use_case=eCase)
 Check if a string ends with a specified character value. More...
 
static SIZE_TYPE CommonPrefixSize (const CTempString s1, const CTempString s2)
 Determine the common prefix of two strings. More...
 
static SIZE_TYPE CommonSuffixSize (const CTempString s1, const CTempString s2)
 Determine the common suffix of two strings. More...
 
static SIZE_TYPE CommonOverlapSize (const CTempString s1, const CTempString s2)
 Determine if the suffix of one string is the prefix of another. More...
 
static SIZE_TYPE Find (const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
 Find the pattern in the string. More...
 
static SIZE_TYPE Find (const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst, ECase use_case=eCase)
 Find the pattern in the specified range of a string. More...
 
static SIZE_TYPE Find (const CTempString str, const CTempString pattern, SIZE_TYPE start)
 Wrapper for backward-compatibility. More...
 
static SIZE_TYPE FindCase (const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
 Find the pattern in the specified range of a string using a case sensitive search. More...
 
static SIZE_TYPE FindCase (const CTempString str, const CTempString pattern)
 Wrappers for backward-compatibility. More...
 
static SIZE_TYPE FindCase (const CTempString str, const CTempString pattern, SIZE_TYPE start)
 
static SIZE_TYPE FindNoCase (const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
 Find the pattern in the specified range of a string using a case insensitive search. More...
 
static SIZE_TYPE FindNoCase (const CTempString str, const CTempString pattern)
 Wrapper for backward-compatibility. More...
 
static SIZE_TYPE FindNoCase (const CTempString str, const CTempString pattern, SIZE_TYPE start)
 
static const stringFind (const list< string > &lst, const CTempString val, ECase use_case=eCase)
 Test for presence of a given string in a list or vector of strings. More...
 
static const stringFindCase (const list< string > &lst, const CTempString val)
 
static const stringFindNoCase (const list< string > &lst, const CTempString val)
 
static const stringFind (const vector< string > &vec, const CTempString val, ECase use_case=eCase)
 
static const stringFindCase (const vector< string > &vec, const CTempString val)
 
static const stringFindNoCase (const vector< string > &vec, const CTempString val)
 
static SIZE_TYPE FindWord (const CTempString str, const CTempString word, ECase use_case=eCase, EDirection direction=eForwardSearch)
 Find given word in the string. More...
 
static SIZE_TYPE FindWord (const CTempString str, const CTempString word, EOccurrence which, ECase use_case=eCase)
 Find given word in the string. More...
 
static string TruncateSpaces (const string &str, ETrunc where=eTrunc_Both)
 Truncate whitespace in a string. More...
 
static CTempString TruncateSpaces_Unsafe (const CTempString str, ETrunc where=eTrunc_Both)
 Truncate whitespace in a string. More...
 
static CTempString TruncateSpaces (const CTempString str, ETrunc where=eTrunc_Both)
 
static CTempString TruncateSpaces (const char *str, ETrunc where=eTrunc_Both)
 
static void TruncateSpacesInPlace (string &str, ETrunc where=eTrunc_Both)
 Truncate whitespace in a string (in-place) More...
 
static void TruncateSpacesInPlace (CTempString &, ETrunc where=eTrunc_Both)
 
static void TrimPrefixInPlace (string &str, const CTempString prefix, ECase use_case=eCase)
 Trim prefix from a string (in-place) More...
 
static void TrimPrefixInPlace (CTempString &str, const CTempString prefix, ECase use_case=eCase)
 
static CTempString TrimPrefix_Unsafe (const CTempString str, const CTempString prefix, ECase use_case=eCase)
 Trim prefix from a string. More...
 
static void TrimSuffixInPlace (string &str, const CTempString suffix, ECase use_case=eCase)
 Trim suffix from a string (in-place) More...
 
static void TrimSuffixInPlace (CTempString &str, const CTempString suffix, ECase use_case=eCase)
 
static CTempString TrimSuffix_Unsafe (const CTempString str, const CTempString suffix, ECase use_case=eCase)
 Trim suffix from a string. More...
 
static stringReplace (const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
 Replace occurrences of a substring within a string. More...
 
static string Replace (const string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
 Replace occurrences of a substring within a string and returns the result as a new string. More...
 
static stringReplaceInPlace (string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
 Replace occurrences of a substring within a string. More...
 
static list< string > & Split (const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
 Split a string using specified delimiters. More...
 
static vector< string > & Split (const CTempString str, const CTempString delim, vector< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
 
static list< CTempString > & Split (const CTempString str, const CTempString delim, list< CTempString > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static vector< CTempString > & Split (const CTempString str, const CTempString delim, vector< CTempString > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static list< CTempStringEx > & Split (const CTempString str, const CTempString delim, list< CTempStringEx > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static vector< CTempStringEx > & Split (const CTempString str, const CTempString delim, vector< CTempStringEx > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static bool SplitInTwo (const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
 Split a string into two pieces using the specified delimiters. More...
 
static bool SplitInTwo (const CTempString str, const CTempString delim, CTempString &str1, CTempString &str2, TSplitFlags flags=0, CTempString_Storage *storage=NULL)
 
static bool SplitInTwo (const CTempString str, const CTempString delim, CTempStringEx &str1, CTempStringEx &str2, TSplitFlags flags=0, CTempString_Storage *storage=NULL)
 
static list< string > & SplitByPattern (const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
 Variation of Split() with fSplit_ByPattern flag applied by default. More...
 
static vector< string > & SplitByPattern (const CTempString str, const CTempString delim, vector< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
 
static list< CTempString > & SplitByPattern (const CTempString str, const CTempString delim, list< CTempString > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static vector< CTempString > & SplitByPattern (const CTempString str, const CTempString delim, vector< CTempString > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static list< CTempStringEx > & SplitByPattern (const CTempString str, const CTempString delim, list< CTempStringEx > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
static vector< CTempStringEx > & SplitByPattern (const CTempString str, const CTempString delim, vector< CTempStringEx > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL, CTempString_Storage *storage=NULL)
 
template<typename TContainer >
static string Join (const TContainer &arr, const CTempString &delim)
 Join strings using the specified delimiter. More...
 
template<typename TValue >
static string Join (const initializer_list< TValue > &arr, const CTempString &delim)
 
template<typename TInputIterator >
static string Join (TInputIterator from, TInputIterator to, const CTempString &delim)
 
template<typename TInputIterator >
static string JoinNumeric (TInputIterator from, TInputIterator to, const CTempString &delim)
 
template<typename TIterator , typename FTransform >
static string TransformJoin (TIterator from, TIterator to, const CTempString &delim, FTransform fnTransform)
 
static string PrintableString (const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
 Get a printable version of the specified string. More...
 
static string Escape (const CTempString str, const CTempString metacharacters, char escape_char='\\')
 Escape string (generic version). More...
 
static string Unescape (const CTempString str, char escape_char='\\')
 Unescape string (generic version). More...
 
static string Quote (const CTempString str, char quote_char='"', char escape_char = '\\')
 Quote string (generic version). More...
 
static string Unquote (const CTempString str, char escape_char='\\')
 Unquote string (generic version). More...
 
static string Sanitize (CTempString str, TSS_Flags flags=fSS_print)
 Sanitize a string, allowing only specified classes of characters. More...
 
static string Sanitize (CTempString str, CTempString allow_chars, CTempString reject_chars, char reject_replacement=' ', TSS_Flags flags=0)
 Sanitize a string, allowing only specified characters or character classes. More...
 
static string ParseEscapes (const CTempString str, EEscSeqRange mode=eEscSeqRange_Standard, char user_char='?')
 Parse C-style escape sequences in the specified string. More...
 
static string ParseQuoted (const CTempString str, size_t *n_read=NULL)
 Discard C-style backslash escapes and extract a quoted string. More...
 
static string CEncode (const CTempString str, EQuoted quoted=eQuoted)
 Encode a string for C/C++. More...
 
static string CParse (const CTempString str, EQuoted quoted=eQuoted)
 Discard C-style backslash escapes. More...
 
static string JavaScriptEncode (const CTempString str)
 Encode a string for JavaScript. More...
 
static string XmlEncode (const CTempString str, TXmlEncode flags=eXmlEnc_Contents)
 Encode a string for XML. More...
 
static string HtmlEncode (const CTempString str, THtmlEncode flags=fHtmlEnc_EncodeAll)
 Encode a string for HTML. More...
 
static string HtmlDecode (const CTempString str, EEncoding encoding=eEncoding_Unknown, THtmlDecode *result_flags=NULL)
 Decode HTML entities and character references. More...
 
static string HtmlEntity (TUnicodeSymbol uch)
 Returns HTML entity name for this symbol if one exists (without leading ampersand and trailing semicolon); or empty string if suitable HTML entity was not found. More...
 
static string JsonEncode (const CTempString str, EJsonEncode encoding=eJsonEnc_UTF8)
 Encode a string for JSON. More...
 
static string JsonDecode (const CTempString str, size_t *n_read=NULL)
 Decode a string encoded by JsonEncode. More...
 
static string ShellEncode (const string &str)
 Quotes a string in Bourne Again Shell (BASH) syntax, in a way that disallows non-printable characters in the result. More...
 
static string URLEncode (const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
 URL-encode string. More...
 
static CStringUTF8 SQLEncode (const CStringUTF8 &str, ESqlEncode flag)
 SQL-encode string. More...
 
static CStringUTF8 SQLEncode (const CStringUTF8 &str)
 
static string URLDecode (const CTempString str, EUrlDecode flag=eUrlDec_All)
 URL-decode string. More...
 
static void URLDecodeInPlace (string &str, EUrlDecode flag=eUrlDec_All)
 URL-decode string to itself. More...
 
static bool NeedsURLEncoding (const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
 Check if the string needs the requested URL-encoding. More...
 
static string Base64Encode (const CTempString str, size_t line_len=0)
 Base64-encode string. More...
 
static string Base64Decode (const CTempString str)
 Base64-decode string. More...
 
static bool IsIPAddress (const CTempStringEx str)
 Check if the string contains a valid IP address. More...
 
template<typename _D >
static void WrapIt (const string &str, SIZE_TYPE width, _D &dest, TWrapFlags flags=0, const string *prefix=0, const string *prefix1=0)
 Wrap the specified string into lines of a specified width. More...
 
static void Wrap (const string &str, SIZE_TYPE width, IWrapDest &dest, TWrapFlags flags, const string *prefix, const string *prefix1)
 
static list< string > & Wrap (const string &str, SIZE_TYPE width, list< string > &arr, TWrapFlags flags=0, const string *prefix=0, const string *prefix1=0)
 
static list< string > & Wrap (const string &str, SIZE_TYPE width, list< string > &arr, TWrapFlags flags, const string &prefix, const string *prefix1=0)
 
static list< string > & Wrap (const string &str, SIZE_TYPE width, list< string > &arr, TWrapFlags flags, const string &prefix, const string &prefix1)
 
static list< string > & WrapList (const list< string > &l, SIZE_TYPE width, const string &delim, list< string > &arr, TWrapFlags flags=0, const string *prefix=0, const string *prefix1=0)
 Wrap the list using the specified criteria. More...
 
static list< string > & WrapList (const list< string > &l, SIZE_TYPE width, const string &delim, list< string > &arr, TWrapFlags flags, const string &prefix, const string *prefix1=0)
 
static list< string > & WrapList (const list< string > &l, SIZE_TYPE width, const string &delim, list< string > &arr, TWrapFlags flags, const string &prefix, const string &prefix1)
 
static list< string > & Justify (const CTempString str, SIZE_TYPE width, list< string > &par, const CTempString *pfx=0, const CTempString *pfx1=0)
 Justify the specified string into a series of lines of the same width. More...
 
static list< string > & Justify (const CTempString str, SIZE_TYPE width, list< string > &par, const CTempString pfx, const CTempString *pfx1=0)
 
static list< string > & Justify (const CTempString str, SIZE_TYPE width, list< string > &par, const CTempString pfx, const CTempString pfx1)
 
static string Dedent (const CTempString str, TDedentFlags flags=0)
 Dedent multi-line string, removing common whitespace prefix for each line. More...
 
static string DedentR (const CTempString str)
 
static string GetField (const CTempString str, size_t field_no, const CTempString delimiters, EMergeDelims merge=eNoMergeDelims)
 Search for a field. More...
 
static string GetField (const CTempString str, size_t field_no, char delimiter, EMergeDelims merge=eNoMergeDelims)
 Search for a field. More...
 
static CTempString GetField_Unsafe (const CTempString str, size_t field_no, const CTempString delimiters, EMergeDelims merge=eNoMergeDelims)
 Search for a field. More...
 
static CTempString GetField_Unsafe (const CTempString str, size_t field_no, char delimiter, EMergeDelims merge=eNoMergeDelims)
 Search for a field. More...
 

Static Private Member Functions

static void ToLower (const char *)
 Privatized ToLower() with const char* parameter to prevent passing of constant strings. More...
 
static void ToUpper (const char *)
 Privatized ToUpper() with const char* parameter to prevent passing of constant strings. More...
 
static bool x_ReportLimitsError (const CTempString str, TStringToNumFlags flags)
 
template<typename TNumeric , typename TSource >
static bool x_VerifyIntLimits (TSource v, const CTempString str, TStringToNumFlags flags)
 
template<typename TNumeric , typename TSource >
static bool x_VerifyFloatLimits (TSource v, const CTempString str, TStringToNumFlags flags)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)< sizeof(int)), TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)< sizeof(unsigned int)), TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)==sizeof(int) &&!is_same< TNumeric, long >::value), TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)==sizeof(unsigned int) &&!is_same< TNumeric, unsigned long >::value), TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_same< TNumeric, long >::value, TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_same< TNumeric, unsigned long >::value, TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)==sizeof(Int8) &&!is_same< TNumeric, long >::value), TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)==sizeof(Uint8) &&!is_same< TNumeric, unsigned long >::value), TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TStrictId >
static enable_if< is_integral< typename TStrictId::TId >::value &&is_member_function_pointer< decltype(&TStrictId::Get)>::value, TStrictId >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_same< TNumeric, float >::value, TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int)
 
template<typename TNumeric >
static enable_if< is_same< TNumeric, double >::value, TNumeric >::type x_StringToNumeric (const CTempString str, TStringToNumFlags flags, int)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)< sizeof(int)), bool >::type x_StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)< sizeof(unsigned int)), bool >::type x_StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)==sizeof(int) &&!is_same< TNumeric, long >::value), bool >::type x_StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)==sizeof(unsigned int) &&!is_same< TNumeric, unsigned long >::value), bool >::type x_StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags, int base)
 
static bool x_StringToNumeric (const CTempString str, long *value, TStringToNumFlags flags, int base)
 
static bool x_StringToNumeric (const CTempString str, unsigned long *value, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)==sizeof(Int8) &&!is_same< TNumeric, long >::value), bool >::type x_StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)==sizeof(Uint8) &&!is_same< TNumeric, unsigned long >::value), bool >::type x_StringToNumeric (const CTempString str, TNumeric *value, TStringToNumFlags flags, int base)
 
static bool x_StringToNumeric (const CTempString str, float *value, TStringToNumFlags flags, int)
 
static bool x_StringToNumeric (const CTempString str, double *value, TStringToNumFlags flags, int)
 
template<typename TStrictId >
static enable_if< is_integral< typename TStrictId::TId >::value &&is_member_function_pointer< decltype(&TStrictId::Get)>::value, bool >::type x_StringToNumeric (const CTempString str, TStrictId *value, TStringToNumFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)<=sizeof(int) &&!is_same< TNumeric, long >::value), void >::type x_NumericToString (string &out_str, TNumeric value, TNumToStringFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)<=sizeof(unsigned int) &&!is_same< TNumeric, unsigned long >::value), void >::type x_NumericToString (string &out_str, TNumeric value, TNumToStringFlags flags, int base)
 
static void x_NumericToString (string &out_str, long value, TNumToStringFlags flags, int base)
 
static void x_NumericToString (string &out_str, unsigned long value, TNumToStringFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_signed< TNumeric >::value &&(sizeof(TNumeric)==sizeof(Int8) &&!is_same< TNumeric, long >::value), void >::type x_NumericToString (string &out_str, TNumeric value, TNumToStringFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_integral< TNumeric >::value &&is_unsigned< TNumeric >::value &&(sizeof(TNumeric)==sizeof(Uint8) &&!is_same< TNumeric, unsigned long >::value), void >::type x_NumericToString (string &out_str, TNumeric value, TNumToStringFlags flags, int base)
 
template<typename TNumeric >
static enable_if< is_floating_point< TNumeric >::value, void >::type x_NumericToString (string &out_str, TNumeric value, TNumToStringFlags flags, int)
 
template<typename TStrictId >
static enable_if< is_integral< typename TStrictId::TId >::value &&is_member_function_pointer< decltype(&TStrictId::Get)>::value, void >::type x_NumericToString (string &out_str, TStrictId value, TNumToStringFlags flags, int base)
 
template<typename TIterator >
static string xx_Join (TIterator from, TIterator to, const CTempString &delim)
 
template<typename TIterator >
static enable_if< is_same< typename TIterator::iterator_category, input_iterator_tag >::value &&is_convertible< typename TIterator::value_type, string >::value, string >::type x_Join (TIterator from, TIterator to, const CTempString &delim)
 
template<typename TIterator >
static enable_if< is_convertible< typename TIterator::iterator_category, forward_iterator_tag >::value &&is_convertible< typename TIterator::value_type, string >::value, string >::type x_Join (TIterator from, TIterator to, const CTempString &delim)
 
template<typename TValue >
static enable_if< is_convertible< TValue, string >::value, string >::type x_Join (TValue *from, TValue *to, const CTempString &delim)
 
template<typename TIterator >
static enable_if< is_convertible< typename TIterator::iterator_category, input_iterator_tag >::value &&is_arithmetic< typename TIterator::value_type >::value, string >::type x_Join (TIterator from, TIterator to, const CTempString &delim)
 
template<typename TValue >
static enable_if< is_arithmetic< TValue >::value, string >::type x_Join (TValue *from, TValue *to, const CTempString &delim)
 

Detailed Description

NStr –.

Encapsulates class-wide string processing functions.

Examples
/home/coremake/doxygen/cxx/include/corelib/ncbistr.hpp.

Definition at line 242 of file ncbistr.hpp.

Member Function Documentation

◆ x_Join() [1/3]

template<typename TIterator >
static enable_if<is_convertible<typename TIterator::iterator_category, forward_iterator_tag>::value && is_convertible<typename TIterator::value_type, string>::value, string>::type NStr::x_Join ( TIterator  from,
TIterator  to,
const CTempString delim 
)
inlinestaticprivate

Definition at line 3803 of file ncbistr.hpp.

References xx_Join().

◆ x_Join() [2/3]

template<typename TIterator >
static enable_if<is_convertible<typename TIterator::iterator_category, input_iterator_tag>::value && is_arithmetic< typename TIterator::value_type>::value, string>::type NStr::x_Join ( TIterator  from,
TIterator  to,
const CTempString delim 
)
inlinestaticprivate

Definition at line 3818 of file ncbistr.hpp.

References i, NumericToString(), and TransformJoin().

◆ x_Join() [3/3]

template<typename TValue >
static enable_if<is_arithmetic<TValue>::value, string>::type NStr::x_Join ( TValue *  from,
TValue *  to,
const CTempString delim 
)
inlinestaticprivate

Definition at line 3825 of file ncbistr.hpp.

References i, NumericToString(), and TransformJoin().

◆ x_NumericToString() [1/4]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) <= sizeof(unsigned int) && !is_same<TNumeric, unsigned long>::value), void>::type NStr::x_NumericToString ( string out_str,
TNumeric  value,
TNumToStringFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3736 of file ncbistr.hpp.

References flags, UIntToString(), and rapidjson::value.

◆ x_NumericToString() [2/4]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_signed<TNumeric>::value && (sizeof(TNumeric) == sizeof(Int8) && !is_same<TNumeric, long>::value), void>::type NStr::x_NumericToString ( string out_str,
TNumeric  value,
TNumToStringFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3764 of file ncbistr.hpp.

References flags, Int8ToString(), and rapidjson::value.

◆ x_NumericToString() [3/4]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) == sizeof(Uint8) && !is_same<TNumeric, unsigned long>::value), void>::type NStr::x_NumericToString ( string out_str,
TNumeric  value,
TNumToStringFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3770 of file ncbistr.hpp.

References flags, UInt8ToString(), and rapidjson::value.

◆ x_NumericToString() [4/4]

template<typename TNumeric >
static enable_if< is_floating_point<TNumeric>::value, void>::type NStr::x_NumericToString ( string out_str,
TNumeric  value,
TNumToStringFlags  flags,
int   
)
inlinestaticprivate

Definition at line 3776 of file ncbistr.hpp.

References DoubleToString(), flags, and rapidjson::value.

◆ x_StringToNumeric() [1/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) < sizeof(unsigned int)), bool>::type NStr::x_StringToNumeric ( const CTempString  str,
TNumeric *  value,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3653 of file ncbistr.hpp.

References flags, n, str(), StringToUInt(), and rapidjson::value.

◆ x_StringToNumeric() [2/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_signed<TNumeric>::value && (sizeof(TNumeric) == sizeof(int) && !is_same<TNumeric, long>::value), bool>::type NStr::x_StringToNumeric ( const CTempString  str,
TNumeric *  value,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3665 of file ncbistr.hpp.

References flags, str(), StringToInt(), and rapidjson::value.

◆ x_StringToNumeric() [3/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) == sizeof(unsigned int) && !is_same<TNumeric, unsigned long>::value), bool>::type NStr::x_StringToNumeric ( const CTempString  str,
TNumeric *  value,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3672 of file ncbistr.hpp.

References flags, str(), StringToUInt(), and rapidjson::value.

◆ x_StringToNumeric() [4/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_signed<TNumeric>::value && (sizeof(TNumeric) == sizeof(Int8) && !is_same<TNumeric, long>::value), bool>::type NStr::x_StringToNumeric ( const CTempString  str,
TNumeric *  value,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3691 of file ncbistr.hpp.

References flags, str(), StringToInt8(), and rapidjson::value.

◆ x_StringToNumeric() [5/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) == sizeof(Uint8) && !is_same<TNumeric, unsigned long>::value), bool>::type NStr::x_StringToNumeric ( const CTempString  str,
TNumeric *  value,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3698 of file ncbistr.hpp.

References flags, str(), StringToUInt8(), and rapidjson::value.

◆ x_StringToNumeric() [6/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) < sizeof(unsigned int)), TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3576 of file ncbistr.hpp.

References flags, n, str(), and StringToUInt().

◆ x_StringToNumeric() [7/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_signed<TNumeric>::value && (sizeof(TNumeric) == sizeof(int) && !is_same<TNumeric, long>::value), TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3584 of file ncbistr.hpp.

References flags, str(), and StringToInt().

◆ x_StringToNumeric() [8/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) == sizeof(unsigned int) && !is_same<TNumeric, unsigned long>::value), TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3590 of file ncbistr.hpp.

References flags, str(), and StringToUInt().

◆ x_StringToNumeric() [9/15]

template<typename TNumeric >
static enable_if< is_same<TNumeric, long>::value, TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3596 of file ncbistr.hpp.

References flags, str(), and StringToLong().

◆ x_StringToNumeric() [10/15]

template<typename TNumeric >
static enable_if< is_same<TNumeric, unsigned long>::value, TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3602 of file ncbistr.hpp.

References flags, str(), and StringToULong().

◆ x_StringToNumeric() [11/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_signed<TNumeric>::value && (sizeof(TNumeric) == sizeof(Int8) && !is_same<TNumeric, long>::value), TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3608 of file ncbistr.hpp.

References flags, str(), and StringToInt8().

◆ x_StringToNumeric() [12/15]

template<typename TNumeric >
static enable_if< is_integral<TNumeric>::value && is_unsigned<TNumeric>::value && (sizeof(TNumeric) == sizeof(Uint8) && !is_same<TNumeric, unsigned long>::value), TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3614 of file ncbistr.hpp.

References flags, str(), and StringToUInt8().

◆ x_StringToNumeric() [13/15]

template<typename TStrictId >
static enable_if< is_integral<typename TStrictId::TId>::value && is_member_function_pointer<decltype(&TStrictId::Get)>::value, TStrictId>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int  base 
)
inlinestaticprivate

Definition at line 3620 of file ncbistr.hpp.

References flags, and str().

◆ x_StringToNumeric() [14/15]

template<typename TNumeric >
static enable_if< is_same<TNumeric, float>::value, TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int   
)
inlinestaticprivate

Definition at line 3627 of file ncbistr.hpp.

References flags, n, str(), and StringToDouble().

◆ x_StringToNumeric() [15/15]

template<typename TNumeric >
static enable_if< is_same<TNumeric, double>::value, TNumeric>::type NStr::x_StringToNumeric ( const CTempString  str,
TStringToNumFlags  flags,
int   
)
inlinestaticprivate

Definition at line 3634 of file ncbistr.hpp.

References flags, str(), and StringToDouble().


The documentation for this class was generated from the following files:
Modified on Wed Jul 17 13:20:52 2024 by modify_doxy.py rev. 669887