A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/corelib_2ncbistr_8hpp_source.html below:

NCBI C++ ToolKit: include/corelib/ncbistr.hpp Source File

1 #ifndef CORELIB___NCBISTR__HPP 2 #define CORELIB___NCBISTR__HPP 59 #define NcbiEmptyCStr NCBI_NS_NCBI::kEmptyCStr 61 #if defined(HAVE_WSTRING) 63 #define NcbiEmptyWCStr NCBI_NS_NCBI::kEmptyWCStr 67 #if defined(NCBI_OS_MSWIN) \ 68  || (defined(NCBI_OS_LINUX) \ 69  && (defined(NCBI_COMPILER_GCC) || defined(NCBI_COMPILER_ANY_CLANG))) 75  static const string

&

Get

(

void

)

77  static string

empty_str;

81 #if defined(HAVE_WSTRING) 86  static const

wstring&

Get

(

void

)

88  static

wstring empty_str;

98  static const string

&

Get

(

void

);

102  static const string

& FirstGet(

void

);

103  static const string

* m_Str;

106 # if defined(HAVE_WSTRING) 111  static const

wstring&

Get

(

void

);

115  static const

wstring& FirstGet(

void

);

116  static const

wstring* m_Str;

122 #define NcbiEmptyString NCBI_NS_NCBI::CNcbiEmptyString::Get() 123 #define kEmptyStr NcbiEmptyString 125 #if defined(HAVE_WSTRING) 126 # define NcbiEmptyWString NCBI_NS_NCBI::CNcbiEmptyWString::Get() 127 # define kEmptyWStr NcbiEmptyWString 133 #define NPOS NCBI_NS_STD::string::npos 145 #if defined(NCBI_OS_MSWIN) && defined(_UNICODE) 151 # define _TX(x) L ## x 155 # define _T_XSTRING(x) \ 156  ncbi::CUtf8::AsBasicString<ncbi::TXChar>(x, NULL, ncbi::CUtf8::eValidate) 158 # define _T_XSTRING(x) \ 159  ncbi::CUtf8::AsBasicString<ncbi::TXChar>(x, NULL, ncbi::CUtf8::eNoValidate) 161 # define _T_STDSTRING(x) ncbi::CUtf8::AsUTF8(x) 162 # define _T_XCSTRING(x) _T_XSTRING(x).c_str() 163 # define _T_CSTRING(x) _T_STDSTRING(x).c_str() 165 # define NcbiEmptyXCStr NcbiEmptyWCStr 166 # define NcbiEmptyXString NcbiEmptyWString 167 # define kEmptyXStr kEmptyWStr 168 # define kEmptyXCStr kEmptyWCStr 179 # define _T_XSTRING(x) (x) 180 # define _T_STDSTRING(x) (x) 181 # define _T_XCSTRING(x) ncbi::impl_ToCString(x) 182 # define _T_CSTRING(x) (x) 184 # define NcbiEmptyXCStr NcbiEmptyCStr 185 # define NcbiEmptyXString NcbiEmptyString 186 # define kEmptyXStr kEmptyStr 187 # define kEmptyXCStr kEmptyCStr 198 #if defined(NCBI_CUTF8_ENCODING_CLASSIC) || !defined(HAVE_ENUM_CLASS) 227 #define eEncoding_Unknown EEncoding::Unknown 228 #define eEncoding_UTF8 EEncoding::UTF8 229 #define eEncoding_Ascii EEncoding::Ascii 230 #define eEncoding_ISO8859_1 EEncoding::ISO8859_1 231 #define eEncoding_Windows_1252 EEncoding::Windows_1252 232 #define eEncoding_CESU8 EEncoding::CESU8 251

fUseLowercase = (1 << 4),

252

fWithRadix = (1 << 5),

253

fWithSign = (1 << 6),

254

fWithCommas = (1 << 7),

255

fDoubleFixed = (1 << 8),

256

fDoubleScientific = (1 << 9),

257

fDoublePosix = (1 << 10),

258

fDoubleGeneral = fDoubleFixed | fDoubleScientific,

260

fDS_Binary = (1 << 11),

261

fDS_NoDecimalPoint = (1 << 12),

262

fDS_PutSpaceBeforeSuffix = (1 << 13),

263

fDS_ShortSuffix = (1 << 14),

264

fDS_PutBSuffixToo = (1 << 15)

285 

fConvErr_NoThrow = (1 << 0),

291

fConvErr_NoErrMessage = (1 << 2),

292

fMandatorySign = (1 << 17),

293

fAllowCommas = (1 << 18),

294

fAllowLeadingSpaces = (1 << 19),

295

fAllowLeadingSymbols = (1 << 20) | fAllowLeadingSpaces,

297 

fAllowTrailingSpaces = (1 << 21),

298

fAllowTrailingSymbols = (1 << 22) | fAllowTrailingSpaces,

300 

fDecimalPosix = (1 << 23),

301

fDecimalPosixOrLocal = (1 << 24),

302

fDecimalPosixFinite = (1 << 25),

306

fDS_ForceBinary = (1 << 26),

307

fDS_ProhibitFractions = (1 << 27),

308

fDS_ProhibitSpaceBeforeSuffix = (1 << 28)

329  template

<

typename

TNumeric>

334  return

x_StringToNumeric<TNumeric>(

str

,

flags

, base);

355  template

<

typename

TNumeric>

382  return

StringToNonNegativeInt(

str

);

401

TStringToNumFlags

flags

= 0,

420

TStringToNumFlags

flags

= 0,

439

TStringToNumFlags

flags

= 0,

458

TStringToNumFlags

flags

= 0,

490  static double

StringToDoublePosix(

const char

*

str

,

char

** endptr=0,

491

TStringToNumFlags

flags

=0);

511

TStringToNumFlags

flags

= 0);

518  static double

StringToDoubleEx(

const char

*

str

,

size_t size

,

519

TStringToNumFlags

flags

= 0);

537

TStringToNumFlags

flags

= 0,

556

TStringToNumFlags

flags

= 0,

583

TStringToNumFlags

flags

= 0);

611

TStringToNumFlags

flags

,

630

TStringToNumFlags

flags

= 0,

654  static int

HexChar(

char

ch);

671  template

<

typename

TNumeric>

679  template

<

typename

TStrictId>

683  return

NumericToString(

value

.Get(),

flags

, base);

703  template

<

typename

TNumeric>

707

x_NumericToString(out_str,

value

,

flags

, base);

724  static string

IntToString(

int value

, TNumToStringFlags

flags

= 0,

727  static string

IntToString(

unsigned int value

, TNumToStringFlags

flags

= 0,

746  static void

IntToString(

string

& out_str,

int value

,

747

TNumToStringFlags

flags

= 0,

750  static void

IntToString(

string

& out_str,

unsigned int value

,

751

TNumToStringFlags

flags

= 0,

768  static string

UIntToString(

unsigned int value

,

769

TNumToStringFlags

flags

= 0,

772  static string

UIntToString(

int value

,

773

TNumToStringFlags

flags

= 0,

792  static void

UIntToString(

string

& out_str,

unsigned int value

,

793

TNumToStringFlags

flags

= 0,

796  static void

UIntToString(

string

& out_str,

int value

,

797

TNumToStringFlags

flags

= 0,

814  static string

LongToString(

long value

, TNumToStringFlags

flags

= 0,

833  static void

LongToString(

string

& out_str,

long value

,

834

TNumToStringFlags

flags

= 0,

851  static string

ULongToString(

unsigned long value

,

852

TNumToStringFlags

flags

= 0,

871  static void

ULongToString(

string

& out_str,

unsigned long value

,

872

TNumToStringFlags

flags

= 0,

890

TNumToStringFlags

flags

= 0,

910

TNumToStringFlags

flags

= 0,

928

TNumToStringFlags

flags

= 0,

947  static void

UInt8ToString(

string

& out_str,

Uint8 value

,

948

TNumToStringFlags

flags

= 0,

979  static string

UInt8ToString_DataSize(

Uint8 value

,

980

TNumToStringFlags

flags

= 0,

981  unsigned int

max_digits = 3);

996  static void

UInt8ToString_DataSize(

string

& out_str,

998

TNumToStringFlags

flags

= 0,

999  unsigned int

max_digits = 3);

1020

TNumToStringFlags

flags

= 0);

1043  static void

DoubleToString(

string

& out_str,

double value

,

1045

TNumToStringFlags

flags

= 0);

1069

TNumToStringFlags

flags

= 0);

1129  int

* dec,

int

* sign);

1145  static string

SizetToString(

size_t value

,

1146

TNumToStringFlags

flags

= 0,

1159  static void

PtrToString(

string

& out_str,

const void

* ptr);

1169  static string

PtrToString(

const void

* ptr);

1179  static const string

BoolToString(

bool value

);

1200  static string

FormatVarargs(

const char

*

format

, va_list args);

1275  static int

CompareCase(

const char

* s1,

const char

* s2);

1343  static int CompareNocase

(

const char

* s1,

const char

* s2);

1380  const char

* s2, ECase use_case = eCase);

1421  static int Compare

(

const char

* s1,

const char

* s2,

1422

ECase use_case = eCase);

1441

ECase use_case = eCase);

1492  static bool

EqualCase(

const char

* s1,

const char

* s2);

1556  static bool

EqualNocase(

const char

* s1,

const char

* s2);

1591  const char

* s2, ECase use_case = eCase);

1631  static bool

Equal(

const char

* s1,

const char

* s2,

1632

ECase use_case = eCase);

1649

ECase use_case = eCase);

1666  static int strcmp

(

const char

* s1,

const char

* s2);

1682  static int strncmp

(

const char

* s1,

const char

* s2,

size_t n

);

1696  static int strcasecmp

(

const char

* s1,

const char

* s2);

1711  static int strncasecmp

(

const char

* s1,

const char

* s2,

size_t n

);

1715  static size_t

strftime(

char

* s,

size_t

maxsize,

const char

*

format

,

1716  const struct

tm* timeptr);

1820  static string

& ToLower(

string

&

str

);

1828  static char

* ToLower(

char

*

str

);

1836  static string

& ToUpper(

string

&

str

);

1844  static char

* ToUpper(

char

*

str

);

1867  ECase

use_case = eCase);

1879  ECase

use_case = eCase);

1891  ECase

use_case = eCase);

1903  ECase

use_case = eCase);

1972

ECase use_case = eCase,

1973

EDirection direction = eForwardSearch,

2027

EOccurrence which = eFirst,

2028

ECase use_case = eCase);

2033

{

return

FindCase(

str

, pattern, start); }

2091

EOccurrence which = eFirst);

2150

EOccurrence which = eFirst);

2158  static const string

* Find (

const

list<string>& lst,

2160

ECase use_case = eCase);

2162  static const string

* FindCase (

const

list<string>& lst,

2165  static const string

* FindNoCase(

const

list<string>& lst,

2168  static const string

* Find (

const

vector<string>& vec,

2170

ECase use_case = eCase);

2172  static const string

* FindCase (

const

vector<string>& vec,

2175  static const string

* FindNoCase(

const

vector<string>& vec,

2196

ECase use_case = eCase,

2197

EDirection direction = eForwardSearch);

2233  ECase

use_case = eCase) {

2234  return

FindWord(

str

, word, use_case, which == eFirst ? eForwardSearch : eReverseSearch);

2254  static string

TruncateSpaces(

const string

&

str

,

2255

ETrunc where = eTrunc_Both);

2273

ETrunc where = eTrunc_Both);

2280  ETrunc

where = eTrunc_Both) {

2281  return

TruncateSpaces_Unsafe(

str

, where);

2289  ETrunc

where = eTrunc_Both) {

2290  return

TruncateSpaces_Unsafe(

str

, where);

2301  static void

TruncateSpacesInPlace(

string

&

str

, ETrunc where = eTrunc_Both);

2302  static void

TruncateSpacesInPlace(

CTempString

&, ETrunc where = eTrunc_Both);

2316  static void

TrimPrefixInPlace(

string

&

str

,

const CTempString

prefix,

2317

ECase use_case = eCase);

2319

ECase use_case = eCase);

2341

ECase use_case = eCase);

2353  static void

TrimSuffixInPlace(

string

&

str

,

const CTempString

suffix,

2354

ECase use_case = eCase);

2356

ECase use_case = eCase);

2378

ECase use_case = eCase);

2409  static string

& Replace(

const string

& src,

2410  const string

& search,

2411  const string

& replace,

2446  static string

Replace(

const string

& src,

2447  const string

& search,

2448  const string

& replace,

2482  static string

& ReplaceInPlace(

string

& src,

2483  const string

& search,

2484  const string

& replace,

2500

fSplit_MergeDelimiters = 1 << 0,

2501

fSplit_Truncate_Begin = 1 << 1,

2502

fSplit_Truncate_End = 1 << 2,

2503

fSplit_Truncate = fSplit_Truncate_Begin | fSplit_Truncate_End,

2504

fSplit_ByPattern = 1 << 3,

2505

fSplit_CanEscape = 1 << 4,

2506

fSplit_CanSingleQuote = 1 << 5,

2507

fSplit_CanDoubleQuote = 1 << 6,

2508

fSplit_CanQuote = fSplit_CanSingleQuote | fSplit_CanDoubleQuote,

2510 

fSplit_Tokenize = fSplit_MergeDelimiters | fSplit_Truncate

2517

eMergeDelims = fSplit_MergeDelimiters | fSplit_Truncate,

2548

TSplitFlags

flags

= 0,

2549

vector<SIZE_TYPE>* token_pos =

NULL

);

2551  static

vector<string>& Split(

2554

vector<string>&

arr

,

2555

TSplitFlags

flags

= 0,

2556

vector<SIZE_TYPE>* token_pos =

NULL

);

2558  static

list<CTempString>& Split(

2561

list<CTempString>&

arr

,

2562

TSplitFlags

flags

= 0,

2563

vector<SIZE_TYPE>* token_pos =

NULL

,

2566  static

vector<CTempString>& Split(

2569

vector<CTempString>&

arr

,

2570

TSplitFlags

flags

= 0,

2571

vector<SIZE_TYPE>* token_pos =

NULL

,

2574  static

list<CTempStringEx>& Split(

2577

list<CTempStringEx>&

arr

,

2578

TSplitFlags

flags

= 0,

2579

vector<SIZE_TYPE>* token_pos =

NULL

,

2582  static

vector<CTempStringEx>& Split(

2585

vector<CTempStringEx>&

arr

,

2586

TSplitFlags

flags

= 0,

2587

vector<SIZE_TYPE>* token_pos =

NULL

,

2622

TSplitFlags

flags

= 0);

2628

TSplitFlags

flags

= 0,

2635

TSplitFlags

flags

= 0,

2641  static

list<string>& SplitByPattern(

2645

TSplitFlags

flags

= 0,

2646

vector<SIZE_TYPE>* token_pos =

NULL

);

2648  static

vector<string>& SplitByPattern(

2651

vector<string>&

arr

,

2652

TSplitFlags

flags

= 0,

2653

vector<SIZE_TYPE>* token_pos =

NULL

);

2655  static

list<CTempString>& SplitByPattern(

2658

list<CTempString>&

arr

,

2659

TSplitFlags

flags

= 0,

2660

vector<SIZE_TYPE>* token_pos =

NULL

,

2663  static

vector<CTempString>& SplitByPattern(

2666

vector<CTempString>&

arr

,

2667

TSplitFlags

flags

= 0,

2668

vector<SIZE_TYPE>* token_pos =

NULL

,

2671  static

list<CTempStringEx>& SplitByPattern(

2674

list<CTempStringEx>&

arr

,

2675

TSplitFlags

flags

= 0,

2676

vector<SIZE_TYPE>* token_pos =

NULL

,

2679  static

vector<CTempStringEx>& SplitByPattern(

2682

vector<CTempStringEx>&

arr

,

2683

TSplitFlags

flags

= 0,

2684

vector<SIZE_TYPE>* token_pos =

NULL

,

2697  template

<

typename

TContainer>

2701  return

x_Join(begin(

arr

), end(

arr

), delim);

2703  template

<

typename

TValue>

2707  return

x_Join(begin(

arr

), end(

arr

), delim);

2709  template

<

typename

TInputIterator>

2713  return

x_Join(from, to, delim);

2715  template

<

typename

TInputIterator>

2719  return

x_Join( from, to, delim);

2721  template

<

typename

TIterator,

typename

FTransform>

2731

eNewLine_Quote = fNewLine_Quote,

2732

fNewLine_Passthru = 1,

2733

eNewLine_Passthru = fNewLine_Passthru,

2734

fNonAscii_Passthru = 0,

2735

fNonAscii_Quote = 2,

2736

fPrintable_Full = 64

2783  char

escape_char =

'\\'

);

2796  static string

Unescape(

const CTempString str

,

char

escape_char =

'\\'

);

2818  static string

Quote(

const CTempString str

,

char

quote_char =

'"'

,

char

escape_char =

'\\'

);

2831  static string

Unquote(

const CTempString str

,

char

escape_char =

'\\'

);

2845

fSS_Reject = 1 << 11,

2849

fSS_Remove = 1 << 12,

2850

fSS_NoMerge = 1 << 13,

2851

fSS_NoTruncate_Begin = 1 << 14,

2852

fSS_NoTruncate_End = 1 << 15,

2853

fSS_NoTruncate = fSS_NoTruncate_Begin | fSS_NoTruncate_End

2932  char

reject_replacement =

' '

,

2933

TSS_Flags

flags

= 0);

2941

eEscSeqRange_Standard,

2943 

eEscSeqRange_FirstByte,

2973

EEscSeqRange

mode

= eEscSeqRange_Standard,

2974  char

user_char =

'?'

);

3002  static string

CEncode(

const CTempString str

, EQuoted quoted = eQuoted);

3029 

eXmlEnc_Contents = 0,

3032 

eXmlEnc_CommentSafe = 1 << 0,

3036 

eXmlEnc_Unsafe_Skip = 1 << 1,

3037

eXmlEnc_Unsafe_Throw = 1 << 2

3050

fHtmlEnc_EncodeAll = 0,

3051

fHtmlEnc_SkipLiteralEntities = 1 << 1,

3052

fHtmlEnc_SkipNumericEntities = 1 << 2,

3053

fHtmlEnc_SkipEntities = fHtmlEnc_SkipLiteralEntities | fHtmlEnc_SkipNumericEntities,

3054

fHtmlEnc_CheckPreencoded = 1 << 3

3069

fHtmlDec_CharRef_Entity = 1,

3070

fHtmlDec_CharRef_Numeric = 1 << 1,

3071

fHtmlDec_Encoding_Changed = 1 << 2

3115  static string

JsonEncode(

const CTempString str

, EJsonEncode encoding = eJsonEnc_UTF8);

3140  static string

ShellEncode(

const string

&

str

);

3195

{

return

SQLEncode(

str

, eSqlEnc_Plain); }

3200  static void

URLDecodeInPlace(

string

&

str

,

EUrlDecode

flag = eUrlDec_All);

3213  static string

Base64Encode(

const CTempString str

,

size_t

line_len = 0);

3230

fWrap_Hyphenate = 0x1,

3231

fWrap_HTMLPre = 0x2,

3232

fWrap_FlatFile = 0x4

3264  template

<

typename

_D>

3265  static void

WrapIt(

const string

&

str

,

SIZE_TYPE

width,

3267  const string

* prefix = 0,

3268  const string

* prefix1 = 0);

3286

m_list.push_back(s);

3291

m_list.back().assign(s.

data

(), s.

length

());

3295  static void

Wrap(

const string

&

str

,

SIZE_TYPE

width,

3296

IWrapDest& dest, TWrapFlags

flags

,

3297  const string

* prefix,

3298  const string

* prefix1);

3300  static

list<string>& Wrap(

const string

&

str

,

SIZE_TYPE

width,

3301

list<string>&

arr

, TWrapFlags

flags

= 0,

3302  const string

* prefix = 0,

3303  const string

* prefix1 = 0);

3305  static

list<string>& Wrap(

const string

&

str

,

SIZE_TYPE

width,

3306

list<string>&

arr

, TWrapFlags

flags

,

3307  const string

& prefix,

3308  const string

* prefix1 = 0);

3310  static

list<string>& Wrap(

const string

&

str

,

SIZE_TYPE

width,

3311

list<string>&

arr

, TWrapFlags

flags

,

3312  const string

& prefix,

3313  const string

& prefix1);

3345  static

list<string>& WrapList(

const

list<string>&

l

,

SIZE_TYPE

width,

3346  const string

& delim, list<string>&

arr

,

3347

TWrapFlags

flags

= 0,

3348  const string

* prefix = 0,

3349  const string

* prefix1 = 0);

3351  static

list<string>& WrapList(

const

list<string>&

l

,

SIZE_TYPE

width,

3352  const string

& delim, list<string>&

arr

,

3354  const string

& prefix,

3355  const string

* prefix1 = 0);

3357  static

list<string>& WrapList(

const

list<string>&

l

,

SIZE_TYPE

width,

3358  const string

& delim, list<string>&

arr

,

3360  const string

& prefix,

3361  const string

& prefix1);

3410

fDedent_NormalizeEmptyLines = 1 << 0,

3414

fDedent_SkipFirstLine = 1 << 1,

3415

fDedent_SkipEmptyFirstLine = 1 << 2,

3549  template

<

typename

TNumeric,

typename

TSource>

3553  return

x_ReportLimitsError(

str

,

flags

);

3557  template

<

typename

TNumeric,

typename

TSource>

3562  return

x_ReportLimitsError(

str

,

flags

);

3567  template

<

typename

TNumeric>

3571  int n

= StringToInt(

str

,

flags

, base);

3572  return

x_VerifyIntLimits<TNumeric>(

n

,

str

,

flags

) ? (TNumeric)

n

: 0;

3574  template

<

typename

TNumeric>

3578  unsigned int n

= StringToUInt(

str

,

flags

, base);

3579  return

x_VerifyIntLimits<TNumeric>(

n

,

str

,

flags

) ? (TNumeric)

n

: 0;

3582  template

<

typename

TNumeric>

3586  return

StringToInt(

str

,

flags

, base);

3588  template

<

typename

TNumeric>

3592  return

StringToUInt(

str

,

flags

, base);

3594  template

<

typename

TNumeric>

3598  return

StringToLong(

str

,

flags

, base);

3600  template

<

typename

TNumeric>

3604  return

StringToULong(

str

,

flags

, base);

3606  template

<

typename

TNumeric>

3612  template

<

typename

TNumeric>

3616  return

StringToUInt8(

str

,

flags

, base);

3618  template

<

typename

TStrictId>

3622  return

TStrictId(StringToNumeric<typename TStrictId::TId>(

str

,

flags

, base));

3625  template

<

typename

TNumeric>

3629  double n

= StringToDouble(

str

,

flags

);

3630  return

x_VerifyFloatLimits<TNumeric>(

n

,

str

,

flags

) ? (TNumeric)

n

: 0;

3632  template

<

typename

TNumeric>

3636  return

StringToDouble(

str

,

flags

);

3639  template

<

typename

TNumeric>

3643  int n

= StringToInt(

str

,

flags

, base);

3645  if

(( !

n

&& errno ) || !x_VerifyIntLimits<TNumeric>(

n

,

str

,

flags

)) {

3651  template

<

typename

TNumeric>

3655  unsigned int n

= StringToUInt(

str

,

flags

, base);

3657  if

(( !

n

&& errno ) || !x_VerifyIntLimits<TNumeric>(

n

,

str

,

flags

)) {

3663  template

<

typename

TNumeric>

3668  return

(*

value

|| !errno);

3670  template

<

typename

TNumeric>

3675  return

(*

value

|| !errno);

3681  return

(*

value

|| !errno);

3687  return

(*

value

|| !errno);

3689  template

<

typename

TNumeric>

3694  return

(*

value

|| !errno);

3696  template

<

typename

TNumeric>

3701  return

(*

value

|| !errno);

3706  double n

= StringToDouble(

str

,

flags

);

3708  if

(( !

n

&& errno ) || !x_VerifyFloatLimits<float>(

n

,

str

,

flags

)) {

3718  return

(*

value

|| !errno);

3720  template

<

typename

TStrictId>

3724  return

x_StringToNumeric(

str

, &

value

->Set(),

flags

, base);

3728  template

<

typename

TNumeric>

3734  template

<

typename

TNumeric>

3748

ULongToString(out_str,

value

,

flags

, base);

3750 #if NCBI_COMPILER_MSVC && (_MSC_VER < 1900) 3752

x_NumericToString(

string

& out_str,

Int8 value

, TNumToStringFlags

flags

,

int

base)

3757

x_NumericToString(

string

& out_str,

Uint8 value

, TNumToStringFlags

flags

,

int

base)

3759

UInt8ToString(out_str,

value

,

flags

, base);

3762  template

<

typename

TNumeric>

3768  template

<

typename

TNumeric>

3772

UInt8ToString(out_str,

value

,

flags

, base);

3774  template

<

typename

TNumeric>

3780  template

<

typename

TStrictId>

3784  return

x_NumericToString(out_str,

value

.Get(),

flags

, base);

3789  template

<

typename

TIterator>

3792  template

<

typename

TIterator>

3800  template

<

typename

TIterator>

3805  return

xx_Join(from, to, delim);

3808  template

<

typename

TValue>

3812  return

xx_Join(from, to, delim);

3815  template

<

typename

TIterator>

3820  return

TransformJoin( from, to, delim, [](

const typename TIterator::value_type

&

i

){

return

NumericToString(

i

);});

3823  template

<

typename

TValue>

3827  return

TransformJoin( from, to, delim, [](

const

TValue&

i

){

return

NumericToString(

i

);});

3850

os.write((

const char

*)

str

.data(),

str

.size() *

sizeof

(

TCharUCS2

));

3888  return

x_Append(u8,src,encoding,

validate

);

3891 #if defined(HAVE_WSTRING) 3901  return

x_Append(u8,src,lcl);

3911  template

<

typename

TChar>

3916  return

x_Append(u8, src.data(), src.size());

3926  template

<

typename

TChar>

3931  return

x_Append(u8, src, tchar_count);

3942  template

<

typename

TChar>

3946  return

x_Append(dest, src.data(), src.size());

3960  template

<

typename

TChar>

3964  return

x_Append(dest, src, tchar_count);

3975  template

<

typename

TChar>

3979  return

x_Append(dest, &ch, 1);

3999  return

x_Append(dest,src,encoding,

validate

);

4002 #if defined(HAVE_WSTRING) 4017  return

x_Append(dest,src,lcl);

4041 #if defined(HAVE_WSTRING) 4076  static string

AsSingleByteString

4078  const char

* substitute_on_error = 0, EValidate

validate

= eNoValidate);

4080 #if defined(HAVE_WSTRING) 4081  static string

AsSingleByteString

4083  const char

* substitute_on_error = 0, EValidate

validate

= eNoValidate);

4100  template

<

typename

TChar>

4104  return

x_AsBasicString(src,substitute_on_error,

validate

);

4107  template

<

typename

TChar>

4111  return

x_AsBasicString<TChar>(src,

nullptr

,eNoValidate);

4155  return

x_EvalFirst(ch, more);

4165  return

x_EvalNext(ch);

4195  static string

EncodingToString(

EEncoding

encoding);

4216 #if defined(HAVE_WSTRING) 4238 #if defined(HAVE_WSTRING) 4309 #ifndef NCBI_COMPILER_WORKSHOP 4349 #if defined(HAVE_WSTRING) 4352  template

<

typename

TChar>

4354  template

<

typename

TChar>

4357  template

<

typename

TChar>

4358  static

basic_string<TChar> x_AsBasicString

4362  template

<

typename

TIterator>

4366  static bool

x_EvalFirst(

char

ch,

SIZE_TYPE

& more);

4367  static bool

x_EvalNext(

char

ch);

4389 template

<

class

TBase>

4402  case eErr

:

return "eErr"

;

4412  EErrCode

err_code,

const string

& message,

4414

: TBase(

info

, prev_exception, message, severity, 0),

m_Pos

(pos)

4416

this->x_Init(

info

,

4438  out

<<

"m_Pos = "

<< (

unsigned

long)

m_Pos

;

4444  virtual const char

*

GetType

(

void

)

const override 4445 

{

return "CParseTemplException"

; }

4452

(

TErrCode

) this->x_GetErrCode() :

4462  const string

& message,

4464

: TBase(

info

, prev_exception, message, severity,

flags

),

m_Pos

(pos)

4466

this->x_Init(

info

,

4510  virtual const char

* GetErrCodeString(

void

)

const override

;

4586 template

<

class

TContainer>

4727  ITERATE

(list<string>, it, lst) {

4767  const string

& arg_sep,

4768  const string

& val_sep,

4775  if

( !ret.empty() ) {

4784

ret += it->first + val_sep + it->second;

4828  bool IsEncoded

(

void

)

const

{

return

m_Encoded.get() != 0; }

4833 

{

return

IsEncoded() ? *m_Encoded : m_Original; }

4836  bool IsEmpty

(

void

)

const

{

return

m_Original.empty(); }

4856 template

<

typename

T>

4860  int Compare

(

const T

& s1,

const T

& s2)

const

;

4863  bool Less

(

const T

& s1,

const T

& s2)

const

;

4866  bool Equals

(

const T

& s1,

const T

& s2)

const

;

4886 template

<

typename

T>

4893  bool Less

(

const T

& s1,

const T

& s2)

const

;

4916 template

<

typename

T>

4930  int Compare

(

const T

& s1,

const T

& s2)

const

;

4933  bool Less

(

const T

& s1,

const T

& s2)

const

;

4936  bool Equals

(

const T

& s1,

const T

& s2)

const

;

4957 template

<

typename

T>

4965  return

this->

Equals

(s1, s2);

4983 template

<

typename

T>

4997  return

this->

Equals

(s1, s2);

5016  size_t

len1 = s1.

size

(), len2 = s2.

size

();

5017  return

len1 < len2 ||

5018

(len1 == len2 && ::memcmp(s1.

data

(), s2.

data

(), len1) < 0);

5029 template

<

class

Arg1,

class

Arg2,

class

Pred>

5033  return

pr.Equals(x, y);

5051 #if !defined(NCBI_OS_MSWIN) && \ 5052  !(defined(NCBI_OS_LINUX) && \ 5053  (defined(NCBI_COMPILER_GCC) || defined(NCBI_COMPILER_ANY_CLANG))) 5057  const string

*

str

= m_Str;

5058  return str

? *

str

: FirstGet();

5061 # ifdef HAVE_WSTRING 5065  const

wstring*

str

= m_Str;

5066  return str

? *

str

: FirstGet();

5173  unsigned int

max_digits

)

5192  unsigned int

rc = ch -

'0'

;

5196

rc = (ch |

' '

) -

'a'

;

5197  return

rc <= 5 ?

int

(rc + 10) : -1;

5216 #if defined(HAVE_STRICMP) 5217 #if NCBI_COMPILER_MSVC && (_MSC_VER >= 1400) 5218

return ::_stricmp(s1, s2);

5220

return ::stricmp(s1, s2);

5223 #elif defined(HAVE_STRCASECMP_LC) 5228  for

( ;; ++s1, ++s2) {

5231

diff =

tolower

((

unsigned char

) c1) -

tolower

((

unsigned char

)(*s2));

5243 #if defined(HAVE_STRICMP) 5244 #if NCBI_COMPILER_MSVC && (_MSC_VER >= 1400) 5245

return ::_strnicmp(s1, s2,

n

);

5247

return ::strnicmp(s1, s2,

n

);

5250 #elif defined(HAVE_STRCASECMP_LC) 5255  for

( ; ; ++s1, ++s2, --

n

) {

5260

diff =

tolower

((

unsigned char

) c1) -

tolower

((

unsigned char

)(*s2));

5271  const struct

tm* timeptr)

5275

return ::strftime(s, maxsize, x_format.c_str(), timeptr);

5292  const char

* s2,

ECase

use_case)

5321  return

s1.

substr

(pos,

n

) == s2;

5327  return

s1.

substr

(pos,

n

) == s2;

5333  size_t n

= strlen(s1);

5334  if

(

n

!= strlen(s2)) {

5361  size_t n

= strlen(s1);

5362  if

(

n

!= strlen(s2)) {

5379  const char

* s2,

ECase

use_case)

5408  return str

.size() >= start.

size

() &&

5409  Equal

(

str

.substr(0, start.

size

()), start, use_case);

5415  return

!

str

.empty() &&

5416

(use_case ==

eCase

? (

str

[0] == start)

5417

: (

str

[0] == start ||

5418  toupper

((

unsigned char

)

str

[0]) == start ||

5426  return str

.size() >= end.

size

() &&

5433  if

(!

str

.empty()) {

5435  return

use_case ==

eCase

? (

last

== end)

5448  if

(s1[

i

] != s2[

i

]) {

5462  if

(s1[len1 -

i

] != s2[len2 -

i

]) {

5489  return

(pos ==

NPOS

|| (pos + pattern.

length

()) > end) ?

NPOS

: pos;

5492  return

(pos ==

NPOS

|| pos < start) ?

NPOS

: pos;

5552 template

<

typename

TIterator,

typename

FTransform>

5559  string result

(fnTransform(*from++));

5560  for

( ; from != to; ++from) {

5561  result

.append(delim).append(fnTransform(*from));

5566 template

<

typename

TIterator>

5574  size_t

sz_all = 0, sz_delim = delim.

size

();

5576

sz_all +=

string

(*f).size() + sz_delim;

5579  for

( ; from != to; ++from) {

5580  result

.append(delim).append(

string

(*from));

5588  const string

* prefix1)

5596  const string

& prefix1)

5603  const string

& delim, list<string>&

arr

,

5605  const string

* prefix1)

5612  const string

& delim, list<string>&

arr

,

5614  const string

& prefix1)

5624  return Justify

(

str

, width, par, &pfx, pfx1);

5632  return Justify

(

str

, width, par, &pfx, &pfx1);

5654  return

(err-src.

begin

());

5659 #ifndef NCBI_COMPILER_WORKSHOP 5676 template

<

typename

TChar> basic_string<TChar>

5684

basic_string<TChar>

result

;

5688  for

(; src != to; ++src) {

5690  if

(

sizeof

(

TChar

) > 2 && ch >= 0xD800 && ch <= 0xDBFF) {

5692

ch = (ch - 0xD800) * 0x400 + (

ch2

- 0xDC00) + 0x10000;

5694  if

(ch > max_char) {

5695  if

(

sizeof

(

TChar

) == 2) {

5703  if

(substitute_on_error) {

5704  result

.append(substitute_on_error);

5708  "Failed to convert symbol to wide character"

,

5709

(src -

str

.begin()));

5717 template

<

typename

TChar>

bool 5720  if

( *src >= 0xD800 && *src <= 0xDBFF &&

5721

*(src+1) >= 0xDC00 && *(src+1) <= 0xDFFF &&

sizeof

(

TChar

) == 2) {

5722

ch = (*(src) - 0xD800) * 0x400 + (*(src+1) - 0xDC00) + 0x10000;

5732  const TChar

* srcBuf;

5736  for

(pos=0, srcBuf=src;

5737

(to ==

NPOS

) ? (*srcBuf != 0) : (pos<to); ++pos, ++srcBuf) {

5748

u8str.reserve(

max

(u8str.capacity(),u8str.length()+needed+1));

5749  for

(pos=0, srcBuf=src;

5750

(to ==

NPOS

) ? (*srcBuf != 0) : (pos<to); ++pos, ++srcBuf) {

5776 template

<

typename

T>

5783 template

<

typename

T>

5790 template

<

typename

T>

5797 template

<

typename

T>

5801  return

Less(s1, s2);

5811 template

<

typename

T>

5818 template

<

typename

T>

5825 template

<

typename

T>

5832 template

<

typename

T>

5836  return

Less(s1, s2);

5843 template

<

typename

T>

5846

: m_CaseSensitive(cs)

5849 template

<

typename

T>

5856 template

<

typename

T>

5863 template

<

typename

T>

5870 template

<

typename

T>

5874  return

Less(s1, s2);

void x_Assign(CObject_id &dst, const CObject_id &src)

ncbi::TMaskedQueryRegions mask

Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function.

CParseTemplException –.

URL-decoder for string pairs parser.

URL-encoder for string pairs parser.

Template for parsing string into pairs of name and value or merging them back into a single string.

Helper class to allocate memory for CTempString[Ex] on demand in the functions which need to modify t...

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

Encoder interface. Names and values can be encoded with different rules.

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)

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 enable_if< is_arithmetic< TValue >::value, string >::type x_Join(TValue *from, TValue *to, const CTempString &delim)

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)

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)

Define Case-insensitive string equality (not less-than) comparison method Case sensitivity can be tur...

Define Case-insensitive string equality (not less-than) comparison method.

Define Case-insensitive string comparison methods.

static vector< string > arr

std::ofstream out("events_result.xml")

main entry point for tests

static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)

static const char * str(char *buf, int n)

static const char * validate(DSNINFO *di)

Go looking for trouble.

void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)

Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

element_type * get(void) const

Get pointer.

@ eTakeOwnership

An object can take ownership of another.

@ eNoOwnership

No ownership is assumed.

EDiagSev

Severity level for the posted diagnostics.

@ eDiag_Error

Error message.

#define NCBI_THROW2(exception_class, err_code, message, extra)

Throw exception with extra parameter.

EErrCode

Error types that an application can generate.

virtual const char * GetErrCodeString(void) const

Get error code interpreted as text.

#define EXCEPTION_VIRTUAL_BASE

Do not use virtual base classes in exception declaration at all, because in this case derived class s...

@ eInvalid

To be used ONLY as a return value; please, NEVER throw an exception with this code.

sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)

Returns the sequence::ECompare containment relationship between CSeq_locs.

int64_t Int8

8-byte (64-bit) signed integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

EStringToNumFlags EConvErrFlags

Formerly split out.

EJsonEncode

Json-encode flags.

CParseTemplException(const CDiagCompileInfo &info, const CException *prev_exception, const string &message, string::size_type pos, EDiagSev severity, CException::TFlags flags)

bool operator()(const CTempString s1, const CTempString s2) const

static void NumericToString(string &out_str, TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

static bool x_StringToNumeric(const CTempString str, double *value, TStringToNumFlags flags, int)

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)

static bool x_TCharToUnicodeSymbol(TUnicodeSymbol &u, const TChar *src)

static bool x_StringToNumeric(const CTempString str, unsigned long *value, TStringToNumFlags flags, int base)

static void x_Validate(const CTempString &str)

NCBI_NS_STD::string::size_type SIZE_TYPE

virtual void Append(const string &s)=0

static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)

Convert size_t to string.

CParseTemplException(void)

Constructor.

PEqualNocase_Generic< const char * > PEqualNocase_CStr

vector< pair< string, string > > TStringPairsVector

static TUnicodeSymbol x_Decode(TIterator &src)

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), basic_string< TChar > >::type AsBasicString(const CTempString &src, const TChar *substitute_on_error, EValidate validate=eNoValidate)

Convert UTF8 string into Unicode.

static bool x_VerifyIntLimits(TSource v, const CTempString str, TStringToNumFlags flags)

static CStringUTF8 & AppendAsUTF8(CStringUTF8 &dest, const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)

Convert non-Unicode C++ string into UTF8 and append it to existing string.

EPrintableMode

How to display printable strings.

static void x_NumericToString(string &out_str, unsigned long value, TNumToStringFlags flags, int base)

static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)

Convert Int8 to string.

EDedentFlags

Flags for Dedent() method.

int Compare(const T &s1, const T &s2) const

Return difference between "s1" and "s2".

PCase_Generic< string > PCase

PNocase_Generic< const char * > PNocase_CStr

ESS_Flags

Flags for Sanitize().

int TDedentFlags

Bitwise OR of EDedentFlags.

EStringToNumFlags

String to number conversion flags.

string::size_type m_Pos

Error position.

EErrCode

Error types that for exception class.

void Parse(const CTempString str, NStr::EMergeDelims merge_argsep=NStr::eMergeDelims)

Parse the string.

static CStringUTF8 & x_Append(CStringUTF8 &u8str, const CTempString &src, EEncoding encoding, EValidate validate)

CStringPairs(IStringDecoder *decoder=NULL, EOwnership own_decoder=eTakeOwnership, IStringEncoder *encoder=NULL, EOwnership own_encoder=eTakeOwnership)

Create parser with the specified decoder/encoder and default separators.

static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)

Convert double to string.

string Merge(void) const

Merge name-value pairs into a single string using the currently set separators and the provided encod...

CParseTemplException(const CDiagCompileInfo &info, const CException *prev_exception, EErrCode err_code, const string &message, string::size_type pos, EDiagSev severity=eDiag_Error)

Constructor.

static bool StringToNumeric(const CTempString str, TNumeric *value, TStringToNumFlags flags=0, int base=10)

Convert string to a numeric value.

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)

char16_t TCharUCS2

Type for character in UCS-2 encoding.

ESqlEncode

SQL encode flags.

ESplitFlags

Flags for Split*() methods.

EWrapFlags

How to wrap the words in a string to a new line.

static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive compare of a substring with another string.

CNcbiOstream & operator<<(CNcbiOstream &os, const TStringUCS2 &str)

Operator for writing TStringUCS2 to stream.

EUrlEncode

URL-encode flags.

EMergeDelims

Whether to merge adjacent delimiters.

AutoPtr< IStringDecoder > m_Decoder

CWrapDestStringList(list< string > &l)

EOccurrence

Whether it is the first or last occurrence.

static string Merge(const TStrPairs &pairs, const string &arg_sep, const string &val_sep, IStringEncoder *encoder=NULL, EOwnership own=eTakeOwnership)

Merge name-value pairs from the provided container, separators and encoder.

static void x_NumericToString(string &out_str, long value, TNumToStringFlags flags, int base)

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), CStringUTF8 >::type AsUTF8(const TChar *src, SIZE_TYPE tchar_count=NCBI_NS_STD::string::npos)

Convert into UTF8 from a Unicode character buffer.

const string & GetEncodedString(void) const

Get encoded string.

int TPrintableMode

Bitwise OR of EPrintableMode flags.

TStrPairs & GetPairs(void)

Get non-const data.

int TNumToStringFlags

Bitwise OR of "ENumToStringFlags".

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.

virtual string Encode(const CTempString src, EStringType stype) const =0

Encode the string.

void SetDecoder(IStringDecoder *decoder, EOwnership own=eTakeOwnership)

Set string decoder.

CParseTemplException(const CParseTemplException< TBase > &other)

Constructor.

const char * impl_ToCString(const char *s)

CStringPairs(const CTempString arg_sep, const CTempString val_sep, IStringDecoder *decoder=NULL, EOwnership own_decoder=eTakeOwnership, IStringEncoder *encoder=NULL, EOwnership own_encoder=eTakeOwnership)

Create parser with the specified parameters.

EUrlDecode

URL decode flags.

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.

bool Less(const T &s1, const T &s2) const

Return TRUE if s1 < s2.

static CTempString TruncateSpaces_Unsafe(const CTempString &str, NStr::ETrunc side=NStr::eTrunc_Both)

Truncate whitespace in the string.

static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)

Check if a string ends with a specified suffix value.

static SIZE_TYPE x_BytesNeeded(TUnicodeSymbol ch)

static string LongToString(long value, TNumToStringFlags flags=0, int base=10)

Convert Int to string.

unique_ptr< string > m_Encoded

static int strcmp(const char *s1, const char *s2)

String compare.

EDirection

Search direction for Find() methods.

EXmlEncode

XML-encode flags.

NStr::ECase m_CaseSensitive

case sensitive when TRUE

static bool EvaluateNext(char ch)

Check that the character is valid continuation byte of an UTF8 byte sequence.

PEqualNocase_Conditional_Generic< string > PEqualNocase_Conditional

bool IsEmpty(void) const

Check if the string is empty.

virtual void Append(const CTempString &s)

static string TransformJoin(TIterator from, TIterator to, const CTempString &delim, FTransform fnTransform)

static SIZE_TYPE GetSymbolCount(const CTempString &src)

Get the number of symbols (code points) in UTF8 string.

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 chara...

static CTempString TruncateSpaces(const CTempString str, ETrunc where=eTrunc_Both)

IStringEncoder * GetEncoder(void)

Get encoder or NULL. Does not affect encoder ownership.

static string Join(const initializer_list< TValue > &arr, const CTempString &delim)

PEqualNocase_Generic< string > PEqualNocase

static TNumeric StringToNumeric(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to a numeric value.

static string Join(TInputIterator from, TInputIterator to, const CTempString &delim)

static string JoinNumeric(TInputIterator from, TInputIterator to, const CTempString &delim)

ENumToStringFlags

Number to string conversion flags.

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static CStringUTF8 TruncateSpaces(const CTempString &str, NStr::ETrunc side=NStr::eTrunc_Both)

Truncate whitespace in the string.

static SIZE_TYPE CommonSuffixSize(const CTempString s1, const CTempString s2)

Determine the common suffix of two strings.

virtual const char * GetType(void) const override

Get exception class type.

string::size_type GetPos(void) const noexcept

Get error position.

int Compare(const T &s1, const T &s2) const

Return difference between "s1" and "s2".

virtual void ReportExtra(ostream &out) const override

Report error position.

void SetEncoder(IStringEncoder *encoder, EOwnership own=eTakeOwnership)

Set string encoder.

static string DedentR(const CTempString str)

const string & GetOriginalString(void) const

Get the original unencoded string.

NCBI_EXCEPTION_DEFAULT2(CStringException, CParseTemplException< CCoreException >, std::string::size_type)

CStringPairs(NStr::EUrlDecode decode_flag, NStr::EUrlEncode encode_flag)

Create parser with the selected URL-encoding/decoding options and default separators.

static string Dedent(const CTempString str, TDedentFlags flags=0)

Dedent multi-line string, removing common whitespace prefix for each line.

EErrCode

Error types that string classes can generate.

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.

static CStringUTF8 AsUTF8(const CTempString &src, const locale &lcl)

Convert into UTF8 from a C/C++ string.

PNocase_Generic< string > PNocase

const char * const_iterator

static SIZE_TYPE GetValidSymbolCount(const CTempString &src)

Get the number of valid UTF-8 symbols (code points) in buffer.

static int HexChar(char ch)

Convert character to integer.

static void ToUpper(const char *)

Privatized ToUpper() with const char* parameter to prevent passing of constant strings.

static string Join(const TContainer &arr, const CTempString &delim)

Join strings using the specified delimiter.

static void Parse(TStrPairs &pairs, const CTempString str, const CTempString arg_sep, const CTempString val_sep, IStringDecoder *decoder=NULL, EOwnership own=eTakeOwnership, NStr::EMergeDelims merge_argsep=NStr::eMergeDelims)

Parse the string using the provided decoder, put data into the container.

virtual ~IStringEncoder(void)

virtual ~IStringDecoder(void)

int TSplitFlags

Bitwise OR of ESplitFlags.

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)

ETrunc

Which end to truncate a string.

static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-sensitive equality of a substring with another string.

static basic_string< TChar > x_AsBasicString(const CTempString &src, const TChar *substitute_on_error, EValidate validate)

const char * data(void) const

Return a pointer to the array represented.

static string UInt8ToString_DataSize(Uint8 value, TNumToStringFlags flags=0, unsigned int max_digits=3)

Convert UInt8 to string using "software" qualifiers.

virtual ~CParseTemplException(void) noexcept

Destructor.

AutoPtr< IStringEncoder > m_Encoder

basic_string< TUnicodeSymbol > TStringUnicode

Unicode string.

const wchar_t *const kEmptyWCStr

char32_t TUnicodeSymbol

Unicode character.

bool operator()(const T &s1, const T &s2) const

Return TRUE if s1 < s2 ignoring case.

static TUnicodeSymbol DecodeFirst(char ch, SIZE_TYPE &more)

Begin converting first character of UTF8 sequence into Unicode.

static int strcasecmp(const char *s1, const char *s2)

Case-insensitive comparison of two zero-terminated strings.

EStringType

Type of string to be decoded.

TStringUnicode TStringUCS4

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)

static bool x_VerifyFloatLimits(TSource v, const CTempString str, TStringToNumFlags flags)

bool AStrEquiv(const Arg1 &x, const Arg2 &y, Pred pr)

Check equivalence of arguments using predicate.

static string & Replace(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.

virtual ~CStringPairs(void)

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.

CStringPairs< TStringPairsVector > CStringPairsParser

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.

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.

static CStringUTF8 SQLEncode(const CStringUTF8 &str)

virtual const CException * x_Clone(void) const override

Helper clone method.

static CStringUTF8 & x_AppendChar(CStringUTF8 &u8str, TUnicodeSymbol ch)

virtual void Append(const string &s)

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), CStringUTF8 & >::type AppendAsUTF8(CStringUTF8 &dest, TChar ch)

Convert Unicode symbol into UTF8 and append it to existing string.

static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)

Convert into UTF8 from a C/C++ string.

bool Equals(const T &s1, const T &s2) const

Return TRUE if s1 == s2.

basic_string< TCharUCS2 > TStringUCS2

Type for string in UCS-2 encoding.

EQuoted

Define that string is quoted or not.

IStringDecoder * GetDecoder(void)

Get decoder or NULL. Does not affect decoder ownership.

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.

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), CStringUTF8 & >::type AppendAsUTF8(CStringUTF8 &dest, const TChar *src, SIZE_TYPE tchar_count=NCBI_NS_STD::string::npos)

Convert Unicode character buffer into UTF8 and append it to existing string.

static string xx_Join(TIterator from, TIterator to, const CTempString &delim)

virtual void Append(const CTempString &s)=0

EStringType

Type of string to be decoded.

virtual string Decode(const CTempString src, EStringType stype) const =0

Decode the string.

static SIZE_TYPE x_GetValidSymbolCount(const CTempString &src, CTempString::const_iterator &err)

static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)

Convert UInt to string.

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

PNocase_Conditional_Generic(NStr::ECase case_sens=NStr::eCase)

Construction.

const TStrPairs & GetPairs(void) const

Read data.

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), basic_string< TChar > >::type AsBasicString(const CTempString &src)

bool IsEncoded(void) const

Check if the original string was encoded.

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)

EHtmlEncode

HTML-decode flags.

bool Equals(const T &s1, const T &s2) const

Return TRUE if s1 == s2.

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), CStringUTF8 >::type AsUTF8(const basic_string< TChar > &src)

Convert into UTF8 from a Unicode C++ string.

bool operator()(const T &s1, const T &s2) const

Return TRUE if s1 < s2.

static TUnicodeSymbol DecodeNext(TUnicodeSymbol chU, char ch)

Convert next character of UTF8 sequence into Unicode.

static SIZE_TYPE FindWord(const CTempString str, const CTempString word, EOccurrence which, ECase use_case=eCase)

Find given word in the string.

static enable_if< is_convertible< TValue, string >::value, string >::type x_Join(TValue *from, TValue *to, const CTempString &delim)

static CStringUTF8 & AppendAsUTF8(CStringUTF8 &dest, char ch, const locale &lcl)

Convert non-Unicode character into UTF8 and append it to existing string.

static bool x_StringToNumeric(const CTempString str, float *value, TStringToNumFlags flags, int)

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.

bool Less(const T &s1, const T &s2) const

Return TRUE if s1 < s2.

size_type length(void) const

Return the length of the represented array.

bool Equals(const T &s1, const T &s2) const

Return TRUE if s1 == s2.

static string ULongToString(unsigned long value, TNumToStringFlags flags=0, int base=10)

Convert unsigned long to string.

static bool x_StringToNumeric(const CTempString str, long *value, TStringToNumFlags flags, int base)

TContainer::value_type TStrPair

The container's value type must be pair<string, string> or a compatible type.

int TSS_Flags

Bitwise OR of ESS_Flags.

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.

static const wstring & Get(void)

Get string.

static string Sanitize(CTempString str, TSS_Flags flags=fSS_print)

Sanitize a string, allowing only specified classes of characters.

PNocase_Conditional_Generic< string > PNocase_Conditional

CTempString substr(size_type pos) const

Obtain a substring from this string, beginning at a given offset.

static CStringUTF8 & AppendAsUTF8(CStringUTF8 &dest, char ch, EEncoding encoding, EValidate validate=eNoValidate)

Convert non-Unicode character into UTF8 and append it to existing string.

bool operator()(const T &s1, const T &s2) const

Return TRUE if s1 < s2 ignoring case.

static CTempString TruncateSpaces(const char *str, ETrunc where=eTrunc_Both)

static void ToLower(const char *)

Privatized ToLower() with const char* parameter to prevent passing of constant strings.

static TUnicodeSymbol Decode(const char *&src)

Convert sequence of UTF8 code units into Unicode code point.

static CStringUTF8 & AppendAsUTF8(CStringUTF8 &dest, const CTempString &src, const locale &lcl)

Convert non-Unicode C++ string into UTF8 and append it to existing string.

static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive equality of a substring with another string.

EHtmlDecode

HTML-decode flags.

void SetCase(NStr::ECase case_sens)

Set comparison type.

ECase

Which type of string comparison.

static int strncmp(const char *s1, const char *s2, size_t n)

String compare up to specified number of characters.

TErrCode GetErrCode(void) const

Get error code.

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)

int TWrapFlags

Bitwise OR of "EWrapFlags".

int TStringToNumFlags

Bitwise OR of "EStringToNumFlags".

bool Less(const T &s1, const T &s2) const

Return TRUE if s1 < s2.

NStr::ECase GetCase() const

Get comparison type.

static SIZE_TYPE GetValidBytesCount(const CTempString &src)

Get the number of valid UTF-8 bytes (code units) in buffer.

static void Wrap(const string &str, SIZE_TYPE width, IWrapDest &dest, TWrapFlags flags, const string *prefix, const string *prefix1)

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.

int Compare(const T &s1, const T &s2) const

Return difference between "s1" and "s2".

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.

EValidate

How to verify character encoding of the source data.

static const string & Get(void)

Get string.

static string & ReplaceInPlace(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.

bool operator()(const T &s1, const T &s2) const

Return TRUE if s1 < s2 ignoring case.

static enable_if< is_integral< TChar >::value &&(1< sizeof(TChar)), CStringUTF8 & >::type AppendAsUTF8(CStringUTF8 &dest, const basic_string< TChar > &src)

Convert Unicode C++ string into UTF8 and append it to existing string.

const char *const kEmptyCStr

Empty "C" string (points to a '\0').

PNocase_Conditional_Generic< const char * > PNocase_Conditional_CStr

bool operator()(const T &s1, const T &s2) const

Return TRUE if s1 < s2 ignoring case.

static SIZE_TYPE Find(const CTempString str, const CTempString pattern, SIZE_TYPE start)

Wrapper for backward-compatibility.

size_type size(void) const

Return the length of the represented array.

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)

PCase_Generic< const char * > PCase_CStr

static int CompareCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-sensitive compare of a substring with another string.

static string UInt8ToString(Uint8 value, TNumToStringFlags flags=0, int base=10)

Convert UInt8 to string.

TStringToNumFlags TConvErrFlags

Formerly split out.

PEqualNocase_Conditional_Generic< const char * > PEqualNocase_Conditional_CStr

PEqualNocase_Conditional_Generic(NStr::ECase case_sens=NStr::eCase)

Construction.

EEscSeqRange

C-style escape sequences parsing mode.

static bool EvaluateFirst(char ch, SIZE_TYPE &more)

Check that the character is valid first byte of an UTF8 byte sequence.

static SIZE_TYPE CommonPrefixSize(const CTempString s1, const CTempString s2)

Determine the common prefix of two strings.

const_iterator begin() const

Return an iterator to the string's starting position.

virtual const char * GetErrCodeString(void) const override

Translate from the error code value to its string representation.

static int StringToNumeric(const string &str)

@ eEncoding_ISO8859_1

Note: From the point of view of the C++.

@ fDedent_SkipEmptyFirstLine

Ignore first line and skip it from the result, if it is empty only.

@ eSqlEnc_Plain

Always produce '...', with no tag.

@ eUrlEnc_ProcessMarkChars

Convert all non-alphanumeric chars, spaces are converted to '+'.

@ eUrlEnc_URIQueryValue

Encode query part of an URI, arg value.

@ eUrlEnc_PercentOnly

Convert all non-alphanumeric chars including space and '' to %## format.

@ eUrlEnc_URIHost

Encode host part of an URI.

@ eUrlEnc_URIQueryName

Encode query part of an URI, arg name.

@ eUrlEnc_URIPath

Encode path part of an URI.

@ eUrlEnc_Path

Same as ProcessMarkChars but preserves valid path characters ('/', '.')

@ eUrlEnc_URIScheme

Encode scheme part of an URI.

@ eUrlEnc_URIUserinfo

Encode userinfo part of an URI.

@ eUrlEnc_SkipMarkChars

Do not convert chars like '!', '(' etc.

@ eUrlEnc_Cookie

Same as SkipMarkChars with encoded ','.

@ eUrlEnc_URIFragment

Encode fragment part of an URI.

@ eFirst

First occurrence.

@ eUrlDec_All

Decode '+' to space.

@ eReverseSearch

Search in a backward direction.

@ eForwardSearch

Search in a forward direction.

@ eConvert

Failure to convert string.

@ eBadArgs

Bad arguments to string methods.

@ eTrunc_Both

Truncate whitespace at both begin and end of string.

@ eTrunc_End

Truncate trailing whitespace only.

@ eTrunc_Begin

Truncate leading whitespace only.

@ eQuoted

String is quoted.

@ eNocase

Case insensitive compare.

@ eCase

Case sensitive compare.

@ eEscSeqRange_Throw

Throw an exception.

@ eEscSeqRange_Errno

Set errno to ERANGE, return empty string.

enum ENcbiOwnership EOwnership

Ownership relations between objects.

#define NCBI_XNCBI_EXPORT

unsigned int

A callback function used to compare two keys in a database.

The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format

vector< CSeq_align const * >::const_iterator TIterator

const TYPE & Get(const CNamedParameterList *param)

constexpr int CompareNocase(const std::string_view &l, const std::string_view &r)

double value_type

The numeric datatype used by the parser.

const struct ncbi::grid::netcache::search::fields::SIZE size

const GenericPointer< typename T::ValueType > T2 value

int strncmp(const char *str1, const char *str2, size_t count)

int strcmp(const char *str1, const char *str2)

static const BitmapCharRec ch2

Defines NCBI C++ Toolkit portable error codes.

static bool IsWhiteSpace(char c)

static const char * locale

static const char delimiter[]

static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

Define Case-sensitive string comparison methods.

Define Case-insensitive string comparison methods.

PQuickStringLess implements an ordering of strings, that is more efficient than usual lexicographical...

void Encode(const CRawScoreVector< Key, Score > &, vector< char > &)

void Decode(const vector< char > &, CRawScoreVector< Key, Score > &)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4