NStr Class Reference
[String Manipulations]

Search Toolkit Book for NStr

#include <ncbistr.hpp>

List of all members.


Detailed Description

NStr --.

Encapuslates class-wide string processing functions.

Definition at line 110 of file ncbistr.hpp.

Public Types

typedef int TNumToStringFlags
 Bitwise OR of "ENumToStringFlags".
typedef int TStringToNumFlags
 Binary OR of "EStringToNumFlags".
typedef int TPrintableMode
 Bitwise OR of EPrintableMode flags.
typedef int TWrapFlags
 Binary OR of "EWrapFlags".
enum  ENumToStringFlags {
  fWithSign = (1 << 9), fWithCommas = (1 << 10), fDoubleFixed = (1 << 11), fDoubleScientific = (1 << 12),
  fDoubleGeneral = fDoubleFixed | fDoubleScientific
}
 Number to string conversion flags. More...
enum  EStringToNumFlags {
  fConvErr_NoThrow = (1 << 9), fMandatorySign = (1 << 10), fAllowCommas = (1 << 11), fAllowLeadingSpaces = (1 << 12),
  fAllowLeadingSymbols = (1 << 13) | fAllowLeadingSpaces, fAllowTrailingSpaces = (1 << 14), fAllowTrailingSymbols = (1 << 15) | fAllowTrailingSpaces, fAllStringToNumFlags = 0x7F00
}
 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  ETrunc { eTrunc_Begin, eTrunc_End, eTrunc_Both }
 Which end to truncate a string. More...
enum  EMergeDelims { eNoMergeDelims, eMergeDelims }
 Whether to merge adjacent delimiters in Split and Tokenize. More...
enum  EPrintableMode {
  fNewLine_Quote = 0, eNewLine_Quote = fNewLine_Quote, fNewLine_Passthru = 1, eNewLine_Passthru = fNewLine_Passthru,
  fPrintable_Full = 2
}
 How to display printable strings. 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  EUrlEncode {
  eUrlEnc_SkipMarkChars, eUrlEnc_ProcessMarkChars, eUrlEnc_PercentOnly, eUrlEnc_Path,
  eUrlEnc_URIScheme, eUrlEnc_URIUserinfo, eUrlEnc_URIHost, eUrlEnc_URIPath,
  eUrlEnc_URIQueryName, eUrlEnc_URIQueryValue, eUrlEnc_URIFragment, eUrlEnc_None
}
 URL-encode flags. More...
enum  EUrlDecode { eUrlDec_All, eUrlDec_Percent }
 URL decode flags. More...

Static Public Member Functions

static int StringToNumeric (const string &str)
 Convert string to numeric value.
static int StringToInt (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to int.
static unsigned int StringToUInt (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to unsigned int.
static long StringToLong (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to long.
static unsigned long StringToULong (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to unsigned long.
static double StringToDouble (const CTempStringEx &str, TStringToNumFlags flags=0)
 Convert string to double.
static double StringToDoubleEx (const char *str, size_t size, TStringToNumFlags flags=0)
 This version accepts zero-terminated string.
static Int8 StringToInt8 (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to Int8.
static Uint8 StringToUInt8 (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to Uint8.
static Uint8 StringToUInt8_DataSize (const CTempString &str, TStringToNumFlags flags=0, int base=10)
 Convert string to number of bytes.
static const void * StringToPtr (const string &str)
 Convert string to pointer.
static int HexChar (char ch)
 Convert character to integer.
static string IntToString (long value, TNumToStringFlags flags=0, int base=10)
 Convert Int to String.
static void IntToString (string &out_str, long value, TNumToStringFlags flags=0, int base=10)
 Convert Int to String.
static string UIntToString (unsigned long value, TNumToStringFlags flags=0, int base=10)
 Convert UInt to string.
static void UIntToString (string &out_str, unsigned long value, TNumToStringFlags flags=0, int base=10)
 Convert UInt to string.
static string Int8ToString (Int8 value, TNumToStringFlags flags=0, int base=10)
 Convert Int8 to string.
static void Int8ToString (string &out_str, Int8 value, TNumToStringFlags flags=0, int base=10)
 Convert Int8 to string.
static string UInt8ToString (Uint8 value, TNumToStringFlags flags=0, int base=10)
 Convert UInt8 to string.
static void UInt8ToString (string &out_str, Uint8 value, TNumToStringFlags flags=0, int base=10)
 Convert UInt8 to string.
static string DoubleToString (double value, int precision=-1, TNumToStringFlags flags=0)
 scientific notation.
static void DoubleToString (string &out_str, double value, int precision=-1, TNumToStringFlags flags=0)
 scientific notation.
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.
static void PtrToString (string &out_str, const void *ptr)
 Convert pointer to string.
static string PtrToString (const void *ptr)
 Convert pointer to string.
static const string BoolToString (bool value)
 Convert bool to string.
static bool StringToBool (const string &str)
 Convert string to bool.
static string FormatVarargs (const char *format, va_list args)
 Handle an arbitrary printf-style format string.
static int CompareCase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
 Case-sensitive compare of a substring with a pattern.
static int CompareCase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const string &pattern)
 Case-sensitive compare of a substring with a pattern.
static int CompareCase (const char *s1, const char *s2)
 Case-sensitive compare of two strings -- char* version.
static int CompareCase (const string &s1, const string &s2)
 Case-sensitive compare of two strings -- string& version.
static int CompareNocase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
 Case-insensitive compare of a substring with a pattern.
static int CompareNocase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const string &pattern)
 Case-insensitive compare of a substring with a pattern.
static int CompareNocase (const char *s1, const char *s2)
 Case-insensitive compare of two strings -- char* version.
static int CompareNocase (const string &s1, const string &s2)
 Case-insensitive compare of two strings -- string& version.
static int Compare (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern, ECase use_case=eCase)
 Compare of a substring with a pattern.
static int Compare (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const string &pattern, ECase use_case=eCase)
 Compare of a substring with a pattern.
static int Compare (const char *s1, const char *s2, ECase use_case=eCase)
 Compare two strings -- char* version.
static int Compare (const string &s1, const char *s2, ECase use_case=eCase)
 Compare two strings -- string&, char* version.
static int Compare (const char *s1, const string &s2, ECase use_case=eCase)
 Compare two strings -- char*, string& version.
static int Compare (const string &s1, const string &s2, ECase use_case=eCase)
 Compare two strings -- string& version.
static bool EqualCase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
 Case-sensitive equality of a substring with a pattern.
static bool EqualCase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const string &pattern)
 Case-sensitive equality of a substring with a pattern.
static bool EqualCase (const char *s1, const char *s2)
 Case-sensitive equality of two strings -- char* version.
static bool EqualCase (const string &s1, const string &s2)
 Case-sensitive equality of two strings -- string& version.
static bool EqualNocase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
 Case-insensitive equality of a substring with a pattern.
static bool EqualNocase (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const string &pattern)
 Case-insensitive equality of a substring with a pattern.
static bool EqualNocase (const char *s1, const char *s2)
 Case-insensitive equality of two strings -- char* version.
static bool EqualNocase (const string &s1, const string &s2)
 Case-insensitive equality of two strings -- string& version.
static bool Equal (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern, ECase use_case=eCase)
 Test for equality of a substring with a pattern.
static bool Equal (const string &str, SIZE_TYPE pos, SIZE_TYPE n, const string &pattern, ECase use_case=eCase)
 Test for equality of a substring with a pattern.
static bool Equal (const char *s1, const char *s2, ECase use_case=eCase)
 Test for equality of two strings -- char* version.
static bool Equal (const string &s1, const char *s2, ECase use_case=eCase)
 Test for equality of two strings -- string&, char* version.
static bool Equal (const char *s1, const string &s2, ECase use_case=eCase)
 Test for equality of two strings -- char*, string& version.
static bool Equal (const string &s1, const string &s2, ECase use_case=eCase)
 Test for equality of two strings -- string& version.
static int strcmp (const char *s1, const char *s2)
 String compare.
static int strncmp (const char *s1, const char *s2, size_t n)
 String compare upto specified number of characters.
static int strcasecmp (const char *s1, const char *s2)
 Case-insensitive string compare.
static int strncasecmp (const char *s1, const char *s2, size_t n)
 Case-insensitive string compare upto specfied number of characters.
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 bool MatchesMask (const char *str, const char *mask, ECase use_case=eCase)
 Match "str" against the "mask".
static bool MatchesMask (const string &str, const string &mask, ECase use_case=eCase)
 Match "str" against the "mask".
static string & ToLower (string &str)
 Convert string to lower case -- string& version.
static char * ToLower (char *str)
 Convert string to lower case -- char* version.
static string & ToUpper (string &str)
 Convert string to upper case -- string& version.
static char * ToUpper (char *str)
 Convert string to upper case -- char* version.
static bool StartsWith (const string &str, const string &start, ECase use_case=eCase)
 Check if a string starts with a specified prefix value.
static bool StartsWith (const string &str, const char *start, ECase use_case=eCase)
 Check if a string starts with a specified prefix value.
static bool StartsWith (const string &str, char start, ECase use_case=eCase)
 Check if a string starts with a specified character value.
static bool EndsWith (const string &str, const string &end, ECase use_case=eCase)
 Check if a string ends with a specified suffix value.
static bool EndsWith (const string &str, char end, ECase use_case=eCase)
 Check if a string ends with a specified character value.
static bool IsBlank (const string &str, SIZE_TYPE pos=0)
 Check if a string is blank (has no text).
static SIZE_TYPE Find (const string &str, const string &pattern, SIZE_TYPE start=0, SIZE_TYPE end=NPOS, EOccurrence which=eFirst, ECase use_case=eCase)
 Find the pattern in the specfied range of a string.
static SIZE_TYPE FindCase (const string &str, const string &pattern, SIZE_TYPE start=0, SIZE_TYPE end=NPOS, EOccurrence which=eFirst)
 Find the pattern in the specfied range of a string using a case sensitive search.
static SIZE_TYPE FindNoCase (const string &str, const string &pattern, SIZE_TYPE start=0, SIZE_TYPE end=NPOS, EOccurrence which=eFirst)
 Find the pattern in the specfied range of a string using a case insensitive search.
static const string * Find (const list< string > &lst, const string &val, ECase use_case=eCase)
 Test for presence of a given string in a list or vector of strings.
static const string * FindCase (const list< string > &lst, const string &val)
static const string * FindNoCase (const list< string > &lst, const string &val)
static const string * Find (const vector< string > &vec, const string &val, ECase use_case=eCase)
static const string * FindCase (const vector< string > &vec, const string &val)
static const string * FindNoCase (const vector< string > &vec, const string &val)
static string TruncateSpaces (const string &str, ETrunc where=eTrunc_Both)
 Truncate spaces in a string.
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 spaces in a string (in-place).
static string & Replace (const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0)
 Replace occurrences of a substring within a string.
static string Replace (const string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0)
 Replace occurrences of a substring within a string and returns the result as a new string.
static string & ReplaceInPlace (string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0)
 Replace occurrences of a substring within a string.
static list< string > & Split (const string &str, const string &delim, list< string > &arr, EMergeDelims merge=eMergeDelims, vector< SIZE_TYPE > *token_pos=NULL)
 Split a string using specified delimiters.
static vector< string > & Tokenize (const string &str, const string &delim, vector< string > &arr, EMergeDelims merge=eNoMergeDelims, vector< SIZE_TYPE > *token_pos=NULL)
 Tokenize a string using the specified set of char delimiters.
static vector< string > & TokenizePattern (const string &str, const string &delim, vector< string > &arr, EMergeDelims merge=eNoMergeDelims, vector< SIZE_TYPE > *token_pos=NULL)
 Tokenize a string using the specified delimiter (string).
static bool SplitInTwo (const string &str, const string &delim, string &str1, string &str2)
 Split a string into two pieces using the specified delimiters.
static string Join (const list< string > &arr, const string &delim)
 Join strings using the specified delimiter.
static string Join (const vector< string > &arr, const string &delim)
static string PrintableString (const string &str, TPrintableMode mode=eNewLine_Quote)
 Get a printable version of the specified string.
static string ParseEscapes (const string &str)
 Parse C-style escape sequences in the specified string, including all those produced by PrintableString.
static string CEncode (const string &str)
 Encode a string for C/C++.
static string JavaScriptEncode (const string &str)
 Encode a string for JavaScript.
static string XmlEncode (const string &str)
 Encode a string for XML.
static string JsonEncode (const string &str)
 Encode a string for JSON.
static string URLEncode (const string &str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
 URL-encode string.
static CStringUTF8 SQLEncode (const CStringUTF8 &str)
 SQL-encode string.
static string URLDecode (const string &str, EUrlDecode flag=eUrlDec_All)
 URL-decode string.
static void URLDecodeInPlace (string &str, EUrlDecode flag=eUrlDec_All)
 URL-decode string to itself.
static bool NeedsURLEncoding (const string &str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
 Check if the string needs the reqested URL-encoding.
static bool IsIPAddress (const string &ip)
 Check if the string contains a valid IP address.
static list< string > & Wrap (const string &str, SIZE_TYPE width, list< string > &arr, TWrapFlags flags=0, const string *prefix=0, const string *prefix1=0)
 Wrap the specified string into lines of a specified width -- prefix, prefix1 default version.
static list< string > & Wrap (const string &str, SIZE_TYPE width, list< string > &arr, TWrapFlags flags, const string &prefix, const string *prefix1=0)
 Wrap the specified string into lines of a specified width -- prefix1 default version.
static list< string > & Wrap (const string &str, SIZE_TYPE width, list< string > &arr, TWrapFlags flags, const string &prefix, const string &prefix1)
 Wrap the specified string into lines of a specified width.
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 -- default prefix, prefix1 version.
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)
 Wrap the list using the specified criteria -- default prefix1 version.
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)
 Wrap the list using the specified criteria.
static string GetField (const CTempString &str, size_t field_no, const CTempString &delimiters, EMergeDelims merge=eNoMergeDelims)
 Search for a field.
static string GetField (const CTempString &str, size_t field_no, char delimiter, EMergeDelims merge=eNoMergeDelims)
 Search for a field.
static CTempString GetField_Unsafe (const CTempString &str, size_t field_no, const CTempString &delimiters, EMergeDelims merge=eNoMergeDelims)
 Search for a field Avoid memory allocation at the expence of some usage safety.
static CTempString GetField_Unsafe (const CTempString &str, size_t field_no, char delimiter, EMergeDelims merge=eNoMergeDelims)
 Search for a field.

Static Private Member Functions

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


Member Typedef Documentation

typedef int NStr::TNumToStringFlags
 

Bitwise OR of "ENumToStringFlags".

Definition at line 137 of file ncbistr.hpp.

typedef int NStr::TPrintableMode
 

Bitwise OR of EPrintableMode flags.

Definition at line 1644 of file ncbistr.hpp.

typedef int NStr::TStringToNumFlags
 

Binary OR of "EStringToNumFlags".

Definition at line 154 of file ncbistr.hpp.

typedef int NStr::TWrapFlags
 

Binary OR of "EWrapFlags".

Definition at line 1681 of file ncbistr.hpp.


Member Enumeration Documentation

enum NStr::ECase
 

Which type of string comparison.

Enumerator:
eCase  Case sensitive compare.
eNocase  Case insensitive compare.

Definition at line 552 of file ncbistr.hpp.

enum NStr::EMergeDelims
 

Whether to merge adjacent delimiters in Split and Tokenize.

Enumerator:
eNoMergeDelims  No merging of delimiters -- default for Tokenize().
eMergeDelims  Merge the delimiters -- default for Split().

Definition at line 1510 of file ncbistr.hpp.

enum NStr::ENumToStringFlags
 

Number to string conversion flags.

NOTE: If specified base in the *ToString() methods is not default 10, that some flags like fWithSign and fWithCommas will be ignored.

Enumerator:
fWithSign  Prefix the output value with a sign.
fWithCommas  Use commas as thousands separator.
fDoubleFixed  Use n.nnnn format for double.
fDoubleScientific  Use scientific format for double.
fDoubleGeneral 

Definition at line 130 of file ncbistr.hpp.

enum NStr::EOccurrence
 

Whether it is the first or last occurrence.

Enumerator:
eFirst  First occurrence.
eLast  Last occurrence.

Definition at line 1290 of file ncbistr.hpp.

enum NStr::EPrintableMode
 

How to display printable strings.

Assists in making a printable version of "str".

Enumerator:
fNewLine_Quote  Display "\n" instead of actual linebreak.
eNewLine_Quote 
fNewLine_Passthru  Break the line at every "\n" occurrence.
eNewLine_Passthru 
fPrintable_Full  Show all octal digits at all times.

Definition at line 1637 of file ncbistr.hpp.

enum NStr::EStringToNumFlags
 

String to number conversion flags.

Enumerator:
fConvErr_NoThrow  Return "natural null".
fMandatorySign  See 'fWithSign'.
fAllowCommas  See 'fWithCommas'.
fAllowLeadingSpaces  Can have leading spaces.
fAllowLeadingSymbols  Can have leading non-nums.
fAllowTrailingSpaces  Can have trailing spaces.
fAllowTrailingSymbols  Can have trailing non-nums.
fAllStringToNumFlags 

Definition at line 140 of file ncbistr.hpp.

enum NStr::ETrunc
 

Which end to truncate a string.

Enumerator:
eTrunc_Begin  Truncate leading spaces only.
eTrunc_End  Truncate trailing spaces only.
eTrunc_Both  Truncate spaces at both begin and end of string.

Definition at line 1395 of file ncbistr.hpp.

enum NStr::EUrlDecode
 

URL decode flags.

Enumerator:
eUrlDec_All  Decode '+' to space.
eUrlDec_Percent  Decode only XX.

Definition at line 1724 of file ncbistr.hpp.

enum NStr::EUrlEncode
 

URL-encode flags.

Enumerator:
eUrlEnc_SkipMarkChars  Do not convert chars like '!', '(' etc.
eUrlEnc_ProcessMarkChars  Convert all non-alphanum chars, spaces are converted to '+'.
eUrlEnc_PercentOnly  Convert all non-alphanum chars including space and '' to %## format.
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_URIHost  Encode host part of an URI.
eUrlEnc_URIPath  Encode path part of an URI.
eUrlEnc_URIQueryName  Encode query part of an URI, arg name.
eUrlEnc_URIQueryValue  Encode query part of an URI, arg value.
eUrlEnc_URIFragment  Encode fragment part of an URI.
eUrlEnc_None  Do not encode.

Definition at line 1704 of file ncbistr.hpp.

enum NStr::EWrapFlags
 

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

Enumerator:
fWrap_Hyphenate  Add a hyphen when breaking words?
fWrap_HTMLPre  Wrap as preformatted HTML?
fWrap_FlatFile  Wrap for flat file use.

Definition at line 1676 of file ncbistr.hpp.


Member Function Documentation

const string NStr::BoolToString bool  value  )  [static]
 

Convert bool to string.

Parameters:
value Boolean value to be converted.
Returns:
One of: 'true, 'false'

Definition at line 1288 of file ncbistr.cpp.

Referenced by CPluginArgSet::AddDefaultFlag(), CGuiRegistry::CReadView::DumpAll(), SNSDBEnvironmentParams::GetParamValue(), SNS_Parameters::GetParamValue(), CVariant::GetString(), CDebugDumpContext::Log(), value_slice::CValueConvert< CP, bool >::operator string(), CQueryTreePrintFunc::operator()(), CDefaultTypeConverter::PrimitiveToString(), CRowSelector::Print(), COptArg< bool >::PrintValue(), CSampleBasicApplication::Run(), CTestSettings::SaveCurrentSettings(), CPluginValue::SetBoolean(), CNetworkOptionsPage::TransferDataFromWindow(), CGraphTrack::x_SaveSettings(), and CEpigenomicsTrack::x_SaveSettings().

string NStr::CEncode const string &  str  )  [inline, static]
 

Encode a string for C/C++.

Synonym for PrintableString().

See also:
PrintableString

Definition at line 3571 of file ncbistr.hpp.

References PrintableString().

int NStr::Compare const string &  s1,
const string &  s2,
ECase  use_case = eCase
[inline, static]
 

Compare two strings -- string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
CompareNocase(), Compare() versions with similar argument types.

Definition at line 3370 of file ncbistr.hpp.

References Compare().

int NStr::Compare const char *  s1,
const string &  s2,
ECase  use_case = eCase
[inline, static]
 

Compare two strings -- char*, string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
CompareNocase(), Compare() versions with similar argument types.

Definition at line 3364 of file ncbistr.hpp.

References Compare().

int NStr::Compare const string &  s1,
const char *  s2,
ECase  use_case = eCase
[inline, static]
 

Compare two strings -- string&, char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
CompareNocase(), Compare() versions with similar argument types.

Definition at line 3358 of file ncbistr.hpp.

References Compare().

int NStr::Compare const char *  s1,
const char *  s2,
ECase  use_case = eCase
[inline, static]
 

Compare two strings -- char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
CompareNocase(), Compare() versions with similar argument types.

Definition at line 3352 of file ncbistr.hpp.

References CompareCase(), CompareNocase(), and eCase.

int NStr::Compare const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const string &  pattern,
ECase  use_case = eCase
[inline, static]
 

Compare of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (string&) to be compared with substring.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if str[pos:pos+n) == pattern.
  • Negative integer, if str[pos:pos+n) < pattern.
  • Positive integer, if str[pos:pos+n) > pattern.
See also:
Other forms of overloaded Compare() with differences in argument types: char* vs. string&

Definition at line 3332 of file ncbistr.hpp.

References CompareCase(), CompareNocase(), and eCase.

int NStr::Compare const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const char *  pattern,
ECase  use_case = eCase
[inline, static]
 

Compare of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (char*) to be compared with substring.
use_case Whether to do a case sensitive compare(eCase -- default), or a case-insensitive compare (eNocase).
Returns:
  • 0, if str[pos:pos+n) == pattern.
  • Negative integer, if str[pos:pos+n) < pattern.
  • Positive integer, if str[pos:pos+n) > pattern.
See also:
Other forms of overloaded Compare() with differences in argument types: char* vs. string&

Definition at line 3324 of file ncbistr.hpp.

References CompareCase(), CompareNocase(), and eCase.

Referenced by impl::CConnection::CalculateServerType(), CGoTermSortStruct::Compare(), CAutoDefSourceDescription::Compare(), PNocase_Conditional_Generic< T >::Compare(), PNocase_Generic< T >::Compare(), PCase_Generic< T >::Compare(), Compare(), EndsWith(), CDllResolver::FindCandidates(), CResultSet::GetColNum(), impl::CDBConnParamsBase::GetProtocolVersion(), CNetScheduleAdmin::GetWorkerNodes(), CValidError_feat::IsCDDFeat(), CSpectrumSet::LoadMultDTA(), IsStandard::operator()(), CBDB_Cache::CacheKey::operator<(), s_GoTermPairCompare(), and StartsWith().

int NStr::CompareCase const string &  s1,
const string &  s2
[inline, static]
 

Case-sensitive compare of two strings -- string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
CompareNocase(), Compare() versions with same argument types.

Definition at line 3376 of file ncbistr.hpp.

References CompareCase().

int NStr::CompareCase const char *  s1,
const char *  s2
[inline, static]
 

Case-sensitive compare of two strings -- char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
CompareNocase(), Compare() versions with same argument types.

Definition at line 3340 of file ncbistr.hpp.

References strcmp().

int NStr::CompareCase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const string &  pattern
[static]
 

Case-sensitive compare of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (string&) to be compared with substring.
Returns:
  • 0, if str[pos:pos+n) == pattern.
  • Negative integer, if str[pos:pos+n) < pattern.
  • Positive integer, if str[pos:pos+n) > pattern.
See also:
Other forms of overloaded CompareCase() with differences in argument types: char* vs. string&

Definition at line 153 of file ncbistr.cpp.

References NPOS.

int NStr::CompareCase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const char *  pattern
[static]
 

Case-sensitive compare of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (char*) to be compared with substring.
Returns:
  • 0, if str[pos:pos+n) == pattern.
  • Negative integer, if str[pos:pos+n) < pattern.
  • Positive integer, if str[pos:pos+n) > pattern.
See also:
Other forms of overloaded CompareCase() with differences in argument types: char* vs. string&

Definition at line 97 of file ncbistr.cpp.

References NPOS.

Referenced by Compare(), CompareCase(), EqualCase(), CNcbiTestApplication::InitTestFramework(), s_ByAccVerLen(), and CStringOrBlobStorageReader::x_Init().

int NStr::CompareNocase const string &  s1,
const string &  s2
[inline, static]
 

Case-insensitive compare of two strings -- string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2 (case-insensitive compare).
  • Negative integer, if s1 < s2 (case-insensitive compare).
  • Positive integer, if s1 > s2 (case-insensitive compare).
See also:
CompareCase(), Compare() versions with same argument types.

Definition at line 3382 of file ncbistr.hpp.

References CompareNocase().

int NStr::CompareNocase const char *  s1,
const char *  s2
[inline, static]
 

Case-insensitive compare of two strings -- char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2 (case-insensitive compare).
  • Negative integer, if s1 < s2 (case-insensitive compare).
  • Positive integer, if s1 > s2 (case-insensitive compare).
See also:
CompareCase(), Compare() versions with same argument types.

Definition at line 3346 of file ncbistr.hpp.

References strcasecmp().

int NStr::CompareNocase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const string &  pattern
[static]
 

Case-insensitive compare of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (string&) to be compared with substring.
Returns:
  • 0, if str[pos:pos+n) == pattern (case-insensitive compare).
  • Negative integer, if str[pos:pos+n) < pattern (case-insensitive compare).
  • Positive integer, if str[pos:pos+n) > pattern (case-insensitive compare).
See also:
Other forms of overloaded CompareNocase() with differences in argument types: char* vs. string&

Definition at line 187 of file ncbistr.cpp.

References NPOS.

int NStr::CompareNocase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const char *  pattern
[static]
 

Case-insensitive compare of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (char*) to be compared with substring.
Returns:
  • 0, if str[pos:pos+n) == pattern (case-insensitive compare).
  • Negative integer, if str[pos:pos+n) < pattern (case-insensitive compare).
  • Positive integer, if str[pos:pos+n) > pattern (case-insensitive compare).
See also:
Other forms of overloaded CompareNocase() with differences in argument types: char* vs. string&

Definition at line 124 of file ncbistr.cpp.

References NPOS.

Referenced by Compare(), CBDB_FieldStringCase::Compare(), CompareNocase(), CSeqTextPaneConfig::ConfigStringToFeatureDisplayType(), CDBUniversalMapper::ConfigureFromRegistry(), CICacheCF< CNetICacheClient >::ConfigureTimeStamp(), CConfig::ConvertRegToTree(), CRmtBlastDb_DataLoaderCF::CreateAndRegister(), CBlastDb_DataLoaderCF::CreateAndRegister(), CSQLITE3_BlobCacheCF::CreateInstance(), CBlastOptionsFactory::CreateTask(), EnabledDelayBuffers(), EqualNocase(), FindNoCase(), FindSubNode(), SPluginParams::FindSubNode(), CUser_object::GetCategory(), CUser_object::GetExperimentType(), CBDB_BufferManager::GetFieldIndex(), CDataLoaderFactory::GetIsDefault(), CCgiApplication::GetLogOpt(), CSpectrumSet::GetMGFBlock(), CGBDataLoader::GetParamsSubnode(), CTestArguments::GetServerName(), CTestArguments::GetServerType(), CCPPToolkitConnParams::GetServerType(), SourceFile::GetType(), CBDB_FieldFactory::GetType(), CProjectsLstFileFilter::InitFromString(), CQueueClientInfoList::IsMatchingClient(), CValidError_bioseq::IsSynthetic(), CMatrixScoringMethod::Load(), CRemoteAppLauncher::LoadParams(), PssmMaker::makeDefaultPssm(), string_nocase_less::operator()(), SCaseInsensitiveCompare::operator()(), PRemoveSynAnamorph::operator()(), CSeq_id_General_Str_Info::PKeyLess::operator()(), CAnalysisFile::less_icase::operator()(), SNodeNameUpdater::operator()(), CSeq_id_Textseq_Info::TKey::operator<(), ParseLex(), CBDB_ConfigStructureParser::ParseStructureLine(), CGridCgiContext::PersistEntry(), CDbapiTest::Run(), CBDB_FileDumperApp::Run(), CGridWorkerNode::Run(), CNSRemoveJobControlApp::Run(), s_CompareDates(), s_FileName_less(), s_GetChrAccession(), CPackString::s_GetEnvFlag(), s_HasTpaUserObject(), s_Is_ISO_8859_1(), s_Is_UTF_8(), s_Is_Windows_1252(), s_IsSubNode(), s_OrgModCompareNameFirst(), s_OrgModCompareSubtypeFirst(), s_OrgModEqual(), s_PCRSetCompare(), s_SubsourceCompare(), s_SubsourceEqual(), s_SubsourceEquivalent(), CGBProjectHandle::Save(), CCdDbPriority::SeqIdTypeToSourceCode(), CObject::SetAllocFillMode(), impl::CDriverContext::SetClientCharset(), CBlastOptions::SetFilterString(), CNetSchedule_AccessList::SetHosts(), SourceFileExt(), CNetScheduleAPI::StringToStatus(), CNcbiDiag::StrToSeverityLevel(), sx_InitFillNewMemoryMode(), CValidError_feat::ValidateRptUnitVal(), CSnpFilterUI::x_AddSorted(), CBlastFormat::x_ComputeBlastTypePair(), CNetCacheServer::x_CreateStorages(), CAnalysisFile::x_GetDefaults(), CDiagSyntaxParser::x_GetDiagSeverity(), CObjectIStream::x_GetSkipUnknownDefault(), CSerialObject::x_GetVerifyData(), CObjectOStream::x_GetVerifyDataDefault(), CObjectIStream::x_GetVerifyDataDefault(), CCgiTunnel2Grid::x_Init(), CValidError_bioseq::x_IsActiveFin(), CGwasTrackLoadManager::x_IsValid(), CNCBlobStorage::x_ParseTimestampParam(), CSeqDBIsam::x_StringSearch(), CGBenchApplication::x_SyncRegistryAndEnvironment(), and CDeflineGenerator::x_TitleFromProtein().

SIZE_TYPE NStr::DoubleToString double  value,
unsigned int  precision,
char *  buf,
SIZE_TYPE  buf_size,
TNumToStringFlags  flags = 0
[static]
 

Convert double to string with specified precision and place the result in the specified buffer.

Parameters:
value Double value to be converted.
precision Precision value for conversion. If precision is more that maximum for current platform, then it will be truncated to this maximum.
buf Put result of the conversion into this buffer.
buf_size Size of buffer, "buf".
flags How to convert value to string. Default output format is fDoubleFixed.
Returns:
The number of bytes stored in "buf", not counting the terminating ''.

Definition at line 1226 of file ncbistr.cpp.

References buffer, fDoubleFixed, fDoubleGeneral, and fDoubleScientific.

void NStr::DoubleToString string &  out_str,
double  value,
int  precision = -1,
TNumToStringFlags  flags = 0
[static]
 

scientific notation.

Parameters:
flags How to convert value to string. If double format flags are not specified, that next output format will be used by default:
  • fDoubleFixed, if 'precision' >= 0.
  • fDoubleGeneral, if 'precision' < 0.

Definition at line 1197 of file ncbistr.cpp.

References buffer, DoubleToString(), fDoubleFixed, fDoubleGeneral, and fDoubleScientific.

string NStr::DoubleToString double  value,
int  precision = -1,
TNumToStringFlags  flags = 0
[static]
 

scientific notation.

Parameters:
flags How to convert value to string. If double format flags are not specified, that next output format will be used by default:
  • fDoubleFixed, if 'precision' >= 0.
  • fDoubleGeneral, if 'precision' < 0.
Returns:
Converted string value.

Definition at line 1188 of file ncbistr.cpp.

Referenced by CObjFingerprint::AddDouble(), CPepXML::ConvertDouble(), CHistConfigDlg::CreateControls(), CMatrixScoringPanel::CreateControls(), CColumnScoringPanel::CreateControls(), DoubleToString(), CGlUtils::DumpState(), CAlignmentRefiner::ExtractBEArgs(), CRealDataType::GetDefaultString(), CVariant::GetString(), CBDB_FieldDouble::GetString(), CBDB_FieldFloat::GetString(), CLDBlockGlyph::GetTooltip(), CGwasGlyph::GetTooltip(), CArgAllow_Doubles::GetUsage(), CArgAllowValuesBetween::GetUsage(), CArgAllowValuesLessThanOrEqual::GetUsage(), CArgAllowValuesGreaterThanOrEqual::GetUsage(), CDebugDumpContext::Log(), CRmOutReader::MakeFeature(), CNetBLASTUIDataSource::Open(), value_slice::CValueConvert< CP, double >::operator string(), value_slice::CValueConvert< CP, float >::operator string(), CQueryTreePrintFunc::operator()(), CQuickStrStream::operator<<(), CArgAllow_Doubles::PrintUsageXml(), CNetScheduleHandler::ProcessMsgBatchSubmit(), RestoreModelAttributes(), s_ToString(), s_ValToString(), CTimeout::Set(), CTimeSpan::Set(), CHspFilteringArgs::SetArgumentDescriptions(), CPssmEngineArgs::SetArgumentDescriptions(), CGapTriggerArgs::SetArgumentDescriptions(), CGenericSearchArgs::SetArgumentDescriptions(), CPluginValue::SetDouble(), CwxPhyloSettingsDlg::SetParams(), oligofar::CMappedAlignment::SetTagF(), CSplignArgUtil::SetupArgDescriptions(), CCompartOptions::SetupArgDescriptions(), CPhyTreeNode::Sync(), CLocMapper_Default::CGappedRange::ToString(), CGlRect< T >::ToString(), CBDB_FieldDouble::ToString(), CBDB_FieldFloat::ToString(), CCleanupAlignmentsParamsPanel::TransferDataToWindow(), CGridCgiSampleApplication::VectorToString(), CObjectOStreamJson::WriteDouble(), CObjectOStreamXml::WriteDouble2(), CObjectOStreamJson::WriteFloat(), CCleanup_imp::x_FixPIDDbtag(), CBinsGlyph::x_GetTooltipGAP(), CBinsGlyph::x_GetTooltipGCAT(), CBlastTabularInfo::x_PrintPercentIdentical(), and CBlastTabularInfo::x_PrintPercentPositives().

bool NStr::EndsWith const string &  str,
char  end,
ECase  use_case = eCase
[inline, static]
 

Check if a string ends with a specified character value.

Parameters:
str String to check.
end Character value to check for.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase) while checking.

Definition at line 3512 of file ncbistr.hpp.

References eCase.

bool NStr::EndsWith const string &  str,
const string &  end,
ECase  use_case = eCase
[inline, static]
 

Check if a string ends with a specified suffix value.

Parameters:
str String to check.
end Suffix value to check for.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase) while checking.

Definition at line 3505 of file ncbistr.hpp.

References Compare().

Referenced by CPCRSetList::AddFwdName(), CPCRSetList::AddFwdSeq(), CPCRSetList::AddRevName(), CPCRSetList::AddRevSeq(), CPepXML::ConvertDouble(), CProjectsLstFileFilter::ConvertToMask(), EndsWithBadCharacter(), CSimpleEnvRegMapper::EnvToReg(), CGBSeqFormatter::FormatDefline(), CDeflineGenerator::GenerateDefline(), GetIStream(), GetTitle(), CProjectsLstFileFilter::InitFromString(), SMakeProjectT::IsConfigurableDefine(), CSymResolver::IsDefine(), SMakeProjectT::IsMakeAppFile(), SMakeProjectT::IsMakeDllFile(), SMakeProjectT::IsMakeLibFile(), SMakeProjectT::IsUserProjFile(), CAutoDefFeatureClause_Base::PrintClause(), CDataTypeModule::PrintSampleDEF(), RemovePeriodFromEnd(), s_CheckValueForTID(), s_GetMiRNAProduct(), s_IsCompoundRptTypeValue(), s_IsProducedByDatatool(), s_IsValidPrimerSequence(), s_IsValidRpt_typeQual(), s_MatchesBoundary(), s_NoteFinalize(), s_ParseParentQual(), s_ParseTRnaFromAnticodonString(), s_QualVectorToNote(), s_ReadFasta_OLD(), s_RemovePeriod(), s_TitleFromSegment(), s_tRNAClauseFromNote(), s_WillContinue(), CValidError_feat::ValidateCharactersInField(), CCleanup_imp::x_AddReplaceQual(), CStreamLineReader::x_AdvanceEOLCRLF(), CAutoDefFeatureClause::x_FindNoncodingFeatureKeywordProduct(), CMasterContext::x_SetBaseName(), CCommentItem::x_SetCommentWithURLlinks(), CGBenchApplication::x_SyncRegistryAndEnvironment(), and CDeflineGenerator::x_TitleFromProtein().

bool NStr::Equal const string &  s1,
const string &  s2,
ECase  use_case = eCase
[inline, static]
 

Test for equality of two strings -- string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • true, if s1 equals s2.
  • false, otherwise.
See also:
EqualNocase(), Equal() versions with similar argument types.

Definition at line 3448 of file ncbistr.hpp.

References Equal().

bool NStr::Equal const char *  s1,
const string &  s2,
ECase  use_case = eCase
[inline, static]
 

Test for equality of two strings -- char*, string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • true, if s1 equals s2.
  • false, otherwise.
See also:
EqualNocase(), Equal() versions with similar argument types.

Definition at line 3442 of file ncbistr.hpp.

References Equal().

bool NStr::Equal const string &  s1,
const char *  s2,
ECase  use_case = eCase
[inline, static]
 

Test for equality of two strings -- string&, char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • true, if s1 equals s2.
  • false, otherwise.
See also:
EqualNocase(), Equal() versions with similar argument types.

Definition at line 3436 of file ncbistr.hpp.

References Equal().

bool NStr::Equal const char *  s1,
const char *  s2,
ECase  use_case = eCase
[inline, static]
 

Test for equality of two strings -- char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
EqualNocase(), Equal() versions with similar argument types.

Definition at line 3430 of file ncbistr.hpp.

References eCase, EqualCase(), and EqualNocase().

bool NStr::Equal const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const string &  pattern,
ECase  use_case = eCase
[inline, static]
 

Test for equality of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (string&) to be compared with substring.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase).
Returns:
  • 0, if str[pos:pos+n) == pattern.
  • Negative integer, if str[pos:pos+n) < pattern.
  • Positive integer, if str[pos:pos+n) > pattern.
See also:
Other forms of overloaded Equal() with differences in argument types: char* vs. string&

Definition at line 3396 of file ncbistr.hpp.

References eCase, EqualCase(), and EqualNocase().

bool NStr::Equal const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const char *  pattern,
ECase  use_case = eCase
[inline, static]
 

Test for equality of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (char*) to be compared with substring.
use_case Whether to do a case sensitive compare(eCase -- default), or a case-insensitive compare (eNocase).
Returns:
  • true, if str[pos:pos+n) equals pattern.
  • false, otherwise.
See also:
Other forms of overloaded Equal() with differences in argument types: char* vs. string&

Definition at line 3388 of file ncbistr.hpp.

References eCase, EqualCase(), and EqualNocase().

Referenced by CAutoDefSatelliteClause::CAutoDefSatelliteClause(), CAutoDefTransposonClause::CAutoDefTransposonClause(), CheckDate(), CSubSource::DateFromCollectionDate(), CAutoDefFeatureClause_Base::DisplayAlleleName(), Equal(), Find(), CComment_set::FindCommentRule(), CComment_rule::FindFieldRule(), CAutoDefSourceGroup::GetDefaultExcludeSp(), GetFeaturesWithLabel(), CPrintOptions::GetFormatFromName(), CSeqFeatData::GetQualifierType(), COrgMod::GetSubtypeValue(), CCountryLatLonMap::HaveLatLonForCountry(), CCountryLatLonMap::IsCountryInLatLon(), IsNCBIFILESeqId(), CAutoDefSourceDescription::IsTrickyHIV(), ParseLex(), CAutoDefFeatureClause_Base::PluralizeInterval(), RemoveSpaceBeforeAndAfterColon(), CMytestApplication::Run(), s_ExtractSatelliteFromComment(), s_HasNcRNAName(), s_IsTPAAssemblyOkForBioseq(), SetTaxon(), CValidError_feat::ValidateGoTerms(), CValidError_feat::ValidateImpGbquals(), CValidError_feat::ValidateInference(), CValidError_feat::ValidateNonImpFeatGbquals(), CValidError_bioseq::ValidateRepr(), CAutoDefAvailableModifier::ValueFound(), CAutoDefModifierCombo::x_AddHIVModifiers(), CCleanup_imp::x_CleanupExcept_text(), CAutoDefModifierCombo::x_CleanUpTaxName(), CCleanup_imp::x_Common(), CValidError_bioseq::x_CompareStrings(), CCgiArgs::x_Find(), CCleanup_imp::x_FixEtAl(), CAutoDefFeatureClause::x_GetDescription(), CAutoDefFeatureClause::x_GetExonDescription(), CAutoDefNcRNAClause::x_GetProductName(), CCleanup_imp::x_Identical(), CDB_ODBC_ConnParams::x_MapPairToParam(), CAutoDefFeatureClause::x_MatchGene(), CCleanup_imp::x_MoveDbxrefs(), CCleanup_imp::x_MoveGeneQuals(), CCleanup_imp::x_MoveMapQualsToGeneMaploc(), CAutoDefFeatureClause_Base::x_OkToConsolidate(), CCleanup_imp::x_OkToMerge(), CAutoDefFeatureClause::x_ShowTypewordFirst(), CCleanup_imp::x_SubtypeCleanup(), and CValidError_feat::x_ValidateCodeBreakNotOnCodon().

bool NStr::EqualCase const string &  s1,
const string &  s2
[inline, static]
 

Case-sensitive equality of two strings -- string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • true, if s1 equals s2
  • false, otherwise
See also:
EqualCase(), Equal() versions with same argument types.

Definition at line 3454 of file ncbistr.hpp.

bool NStr::EqualCase const char *  s1,
const char *  s2
[inline, static]
 

Case-sensitive equality of two strings -- char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • true, if s1 equals s2
  • false, otherwise
See also:
EqualCase(), Equal() versions with same argument types.

Definition at line 3404 of file ncbistr.hpp.

References strcmp().

bool NStr::EqualCase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const string &  pattern
[inline, static]
 

Case-sensitive equality of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (string&) to be compared with substring.
Returns:
  • true, if str[pos:pos+n) equals pattern.
  • false, otherwise
See also:
Other forms of overloaded EqualCase() with differences in argument types: char* vs. string&

Definition at line 3423 of file ncbistr.hpp.

References CompareCase().

bool NStr::EqualCase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const char *  pattern
[inline, static]
 

Case-sensitive equality of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (char*) to be compared with substring.
Returns:
  • true, if str[pos:pos+n) equals pattern.
  • false, otherwise
See also:
Other forms of overloaded EqualCase() with differences in argument types: char* vs. string&

Definition at line 3416 of file ncbistr.hpp.

References CompareCase().

Referenced by Equal(), CValidError_bioseq::IsFlybaseDbxrefs(), CCountries::IsValid(), s_GetGeneForFeature(), CValidError_feat::ValidateExtUserObject(), CValidError_feat::ValidateGene(), CValidError_imp::ValidateOrgModVoucher(), and CValidError_desc::ValidateStructuredComment().

bool NStr::EqualNocase const string &  s1,
const string &  s2
[inline, static]
 

Case-insensitive equality of two strings -- string& version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • true, if s1 equals s2 (case-insensitive compare).
  • false, otherwise.
See also:
EqualCase(), Equal() versions with same argument types.

Definition at line 3461 of file ncbistr.hpp.

References EqualNocase().

bool NStr::EqualNocase const char *  s1,
const char *  s2
[inline, static]
 

Case-insensitive equality of two strings -- char* version.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • true, if s1 equals s2 (case-insensitive compare).
  • false, otherwise.
See also:
EqualCase(), Equal() versions with same argument types.

Definition at line 3410 of file ncbistr.hpp.

References strcasecmp().

bool NStr::EqualNocase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const string &  pattern
[inline, static]
 

Case-insensitive equality of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (string&) to be compared with substring.
Returns:
  • true, if str[pos:pos+n) equals pattern (case-insensitive compare).
  • false, otherwise.
See also:
Other forms of overloaded EqualNocase() with differences in argument types: char* vs. string&

Definition at line 3474 of file ncbistr.hpp.

References CompareNocase().

bool NStr::EqualNocase const string &  str,
SIZE_TYPE  pos,
SIZE_TYPE  n,
const char *  pattern
[inline, static]
 

Case-insensitive equality of a substring with a pattern.

Parameters:
str String containing the substring to be compared.
pos Start position of substring to be compared.
n Number of characters in substring to be compared.
pattern String pattern (char*) to be compared with substring.
Returns:
  • true, if str[pos:pos+n) equals pattern (case-insensitive compare).
  • false, otherwise.
See also:
Other forms of overloaded EqualNocase() with differences in argument types: char* vs. string&

Definition at line 3467 of file ncbistr.hpp.

References CompareNocase().

Referenced by CCleanup_imp::BasicCleanup(), BDB_CreateEnv(), CGoTermSortStruct::Duplicates(), Equal(), CSeq_id_Textseq_Info::TKey::EqualAcc(), EqualNocase(), CSeqTextPane::FindFirst(), CSeqTextPane::FindNext(), CSeqTextPane::FindPrev(), CDbtag::GetDBFlags(), CFeatList::GetItemByDescription(), CBLASTParams::GetRepeatLib(), CT3Data::GetTaxFlags(), CDbtag::IsApprovedNoCase(), IsArtificialSyntheticConstruct(), CValidError_bioseq::IsHistAssemblyMissing(), IsRefGeneTrackingObject(), CCountries::IsValid(), SCaseInsensitiveStrComp::operator()(), CSeq_id_General_Str_Info::TKey::operator==(), CSeq_id_Textseq_Info::TKey::operator==(), ParseLex(), python::RetrieveStatementType(), s_BadCharsInAuthor(), s_FindMatchInOrgRef(), s_GetHtmlTaxname(), s_IsValidDirection(), s_IsValidnConsSplice(), s_IsValidRpt_typeQual(), s_OrgrefEquivalent(), s_RareConsensusNotExpected(), s_tRNAGeneFromProduct(), CEnumParser< TEnum >::StringToEnum(), CGeneModelConfig::UpdateSettings(), ValidAminoAcid(), CValidError_feat::ValidateCdregion(), CValidError_imp::ValidateDbxref(), CValidError_bioseq::ValidateDupOrOverlapFeats(), CValidError_feat::ValidateExceptText(), CValidError_feat::ValidateGapFeature(), CValidError_feat::ValidateGene(), CValidError_feat::ValidateImpGbquals(), CValidError_feat::ValidateInferenceAccession(), CValidError_feat::ValidateNonImpFeat(), CValidError_imp::ValidateOrgName(), CValidError_feat::ValidateRna(), CCgiApplication::VerifyCgiContext(), CKeywordsItem::x_AddKeyword(), CValidError_bioseq::x_CompareStrings(), CCleanup_imp::x_DbCleanup(), CSeq_id_Textseq_Tree::x_Erase(), CSeq_id_Textseq_Tree::x_FindStrInfo(), CSeq_id_Textseq_Tree::x_FindStrMatch(), CCleanup_imp::x_FixSuffix(), CAlignFilter::x_GetAlignmentScore(), CBioseqContext::x_GetEncode(), CSixFramesTransTrack::x_LoadSettings(), CGraphTrack::x_LoadSettings(), CFeatureTrack::x_LoadSettings(), CEpigenomicsTrack::x_LoadSettings(), CCleanup_imp::x_RemoveUnnecessaryGeneXrefs(), CValidError_bioseq::x_ReportDuplicatePubLabels(), CAutoDefFeatureClause::x_ShowTypewordFirst(), CCleanup_imp::x_SubtypeCleanup(), CGBenchApplication::x_TestGuiRegistry(), CValidError_align::x_ValidateAlignPercentIdentity(), CValidError_feat::x_ValidateCodeBreakNotOnCodon(), CValidError_bioseq::x_ValidatePubFeatures(), and CValidError_bioseq::x_ValidateSourceFeatures().

const string * NStr::Find const vector< string > &  vec,
const string &  val,
ECase  use_case = eCase
[static]
 

Definition at line 1408 of file ncbistr.cpp.

References Equal(), and ITERATE.

const string * NStr::Find const list< string > &  lst,
const string &  val,
ECase  use_case = eCase
[static]
 

Test for presence of a given string in a list or vector of strings.

Definition at line 1394 of file ncbistr.cpp.

References Equal(), and ITERATE.

SIZE_TYPE NStr::Find const string &  str,
const string &  pattern,
SIZE_TYPE  start = 0,
SIZE_TYPE  end = NPOS,
EOccurrence  which = eFirst,
ECase  use_case = eCase
[inline, static]
 

Find the pattern in the specfied range of a string.

Parameters:
str String to search.
pattern Pattern to search for in "str".
start Position in "str" to start search from -- default of 0 means start the search from the beginning of the string.
end Position in "str" to start search up to -- default of NPOS means to search to the end of the string.
which When set to eFirst, this means to find the first occurrence of "pattern" in "str". When set to eLast, this means to find the last occurrence of "pattern" in "str".
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase) while searching for the pattern.
Returns:
  • The start of the first or last (depending on "which" parameter) occurrence of "pattern" in "str", within the string interval ["start", "end"], or
  • NPOS if there is no occurrence of the pattern.

Definition at line 3524 of file ncbistr.hpp.

References eCase, FindCase(), and FindNoCase().

Referenced by AddDefaultSentinelFeats(), CPCRSetList::AddFwdName(), CPCRSetList::AddFwdSeq(), CAutoDefSourceDescription::AddQual(), CPCRSetList::AddRevName(), CPCRSetList::AddRevSeq(), BOOST_AUTO_TEST_CASE(), CAutoDefGeneClusterClause::CAutoDefGeneClusterClause(), CAutoDefIntergenicSpacerClause::CAutoDefIntergenicSpacerClause(), CAutoDefMiscCommentClause::CAutoDefMiscCommentClause(), CAutoDefSatelliteClause::CAutoDefSatelliteClause(), ContainsSgml(), CSubSource::DateFromCollectionDate(), CRemoteAppRequestSB_Impl::Deserialize(), CCountryLatLonMap::DoesStringContainBodyOfWater(), CPatternStats::ExpandPattern(), FindCase(), FindNoCase(), CAgpErr::FormatMessage(), CAgpRow::FromString(), GetIntergenicSpacerClauseList(), CFastaBioseqSource::GetNext(), GetParenLen(), CAutoDefModifierCombo::GetSourceDescriptionString(), CSGHapmapDS::GetTrackNames(), HasBadCharacter(), CAutoDefIntergenicSpacerClause::InitWithString(), CRefArgs::IsListedHost(), IsOldComplementedName(), IsSpName(), MakeLegalFlatFileString(), ParseLex(), CAutoDefFeatureClause_Base::PluralizeInterval(), CAgpErrEx::PrintLine(), CBlastInputReader::ReadOneSeq(), RemoteBlastDbLoader_ErrorHandler(), RemoveSpaceBeforeAndAfterColon(), CAutoDefFeatureClause_Base::RemoveTransSplicedLeaders(), CMytestApplication::Run(), CFixMsHdf5Application::Run(), CDbapiTestSpeedApp::RunSample(), s_CountBlastDbDataLoaders(), s_ExtractSatelliteFromComment(), s_FindParam(), s_FindWholeName(), s_GetProductFlagFromCDSProductNames(), s_IsValidPrimerSequence(), s_ParseTRnaFromAnticodonString(), s_ReplaceArg(), s_StringHasPMID(), s_tRNAClauseFromNote(), SeqIdToIdentifier(), CRemoteAppRequestSB_Impl::Serialize(), CRemoteAppRequestMB_Impl::Serialize(), CExpectedError::Test(), CFormatGuess::TestFormatFasta(), CFormatGuess::TestFormatWiggle(), TrimInternalSemicolons(), CValidError_feat::ValidateCompareVal(), CValidError_feat::ValidateExceptText(), CValidError_feat::ValidateGene(), CValidError_feat::ValidateInference(), CValidError_feat::ValidateInferenceAccession(), CValidError_imp::ValidateOrgModVoucher(), CValidError_imp::ValidateOrgName(), CValidError_imp::ValidateSpecificHost(), CAutoDefModifierCombo::x_AddOrgModString(), CAutoDefModifierCombo::x_AddSubsourceString(), CCleanup_imp::x_CleanupExcept_text(), CAutoDefModifierCombo::x_CleanUpTaxName(), CAutoDefFeatureClause::x_FindNoncodingFeatureKeywordProduct(), CAutoDef::x_GetFeatureClauseProductEnding(), CSequenceSearchJob::x_GetMatches(), CAutoDefNcRNAClause::x_GetProductName(), CAutoDefFeatureClause::x_GetProductName(), CValidError_bioseq::x_IsMicroRNA(), CRemoteBlast::x_IsUnknownRID(), CFeatureSearchJob::x_Match(), CCleanup_imp::x_MoveDbxrefs(), CCleanup_imp::x_ParseCodeBreak(), CMaskingFmtSpecHelper::x_ParseFilteringAlgorithmSpec(), x_SpaceToDash(), and CValidError_bioseq::x_ValidateTitle().

const string * NStr::FindCase const vector< string > &  vec,
const string &  val
[inline, static]
 

Definition at line 3558 of file ncbistr.hpp.

References eCase, and Find().

const string * NStr::FindCase const list< string > &  lst,
const string &  val
[inline, static]
 

Definition at line 3546 of file ncbistr.hpp.

References eCase, and Find().

SIZE_TYPE NStr::FindCase const string &  str,
const string &  pattern,
SIZE_TYPE  start = 0,
SIZE_TYPE  end = NPOS,
EOccurrence  which = eFirst
[inline, static]
 

Find the pattern in the specfied range of a string using a case sensitive search.

Parameters:
str String to search.
pattern Pattern to search for in "str".
start Position in "str" to start search from -- default of 0 means start the search from the beginning of the string.
end Position in "str" to start search up to -- default of NPOS means to search to the end of the string.
which When set to eFirst, this means to find the first occurrence of "pattern" in "str". When set to eLast, this means to find the last occurrence of "pattern" in "str".
Returns:
  • The start of the first or last (depending on "which" parameter) occurrence of "pattern" in "str", within the string interval ["start", "end"], or
  • NPOS if there is no occurrence of the pattern.

Definition at line 3533 of file ncbistr.hpp.

References eFirst, and NPOS.

Referenced by Find(), CRmOutReader::IsHeaderLine(), s_FlyCG_PtoR(), CValidError_imp::ValidatePubGen(), CDeflineGenerator::x_FlyCG_PtoR(), and CNcbiTestApplication::x_GetTrimmedTestName().

const string * NStr::FindNoCase const vector< string > &  vec,
const string &  val
[inline, static]
 

Definition at line 3564 of file ncbistr.hpp.

References eNocase, and Find().

const string * NStr::FindNoCase const list< string > &  lst,
const string &  val
[inline, static]
 

Definition at line 3552 of file ncbistr.hpp.

References eNocase, and Find().

SIZE_TYPE NStr::FindNoCase const string &  str,
const string &  pattern,
SIZE_TYPE  start = 0,
SIZE_TYPE  end = NPOS,
EOccurrence  which = eFirst
[static]
 

Find the pattern in the specfied range of a string using a case insensitive search.

Parameters:
str String to search.
pattern Pattern to search for in "str".
start Position in "str" to start search from -- default of 0 means start the search from the beginning of the string.
end Position in "str" to start search up to -- default of NPOS means to search to the end of the string.
which When set to eFirst, this means to find the first occurrence of "pattern" in "str". When set to eLast, this means to find the last occurrence of "pattern" in "str".
Returns:
  • The start of the first or last (depending on "which" parameter) occurrence of "pattern" in "str", within the string interval ["start", "end"], or
  • NPOS if there is no occurrence of the pattern.

Definition at line 1363 of file ncbistr.cpp.

References CompareNocase(), eFirst, NPOS, and pos.

Referenced by CBrowserUtils::AddBaseTag(), BOOST_AUTO_TEST_CASE(), Find(), CValidError_imp::FindEmbeddedScript(), CRefArgs::GetQueryString(), CRefArgs::IsListedHost(), CMzXML2hdf5Application::ProcessFiles(), s_FindParam(), s_NotPeptideException(), s_ParseTRnaFromAnticodonString(), CValidError_feat::SuppressCheck(), CValidError_feat::ValidateIntron(), CValidError_bioseq::ValidateMultiIntervalGene(), CValidError_feat::ValidateRptUnitVal(), COctetStringDataType::x_AsBitString(), CNetBLAST_DMSearchJob::x_DoSearch(), CBLAST_DB_Dialog::x_FilterItems(), CItemSelectionPanel::x_FilterItems(), CCgiEntry::x_GetCharset(), CId2ReaderBase::x_GetMessageError(), and SDataLoaderConfig::x_LoadDataLoadersConfig().

string NStr::FormatVarargs const char *  format,
va_list  args
[static]
 

Handle an arbitrary printf-style format string.

This method exists only to support third-party code that insists on representing messages in this format; please stick to type-checked means of formatting such as the above ToString methods and I/O streams whenever possible.

Definition at line 1313 of file ncbistr.cpp.

References buf, ERR_POST_X, free(), kEmptyStr, size, vasprintf(), and vsnprintf.

string NStr::GetField const CTempString str,
size_t  field_no,
char  delimiter,
EMergeDelims  merge = eNoMergeDelims
[static]
 

Search for a field.

Parameters:
str C or C++ string to search in.
field_no Zero based field number.
delimiter Single character delimiter.
merge Whether to merge or not adjacent delimiters. Default: not to merge.
Returns:
Found field; or empty string if the required field is not found.

Definition at line 3159 of file ncbistr.cpp.

string NStr::GetField const CTempString str,
size_t  field_no,
const CTempString delimiters,
EMergeDelims  merge = eNoMergeDelims
[static]
 

Search for a field.

Parameters:
str C or C++ string to search in.
field_no Zero based field number.
delimiters Single character delimiters.
merge Whether to merge or not adjacent delimiters. Default: not to merge.
Returns:
Found field; or empty string if the required field is not found.

Definition at line 3146 of file ncbistr.cpp.

CTempString NStr::GetField_Unsafe const CTempString str,
size_t  field_no,
char  delimiter,
EMergeDelims  merge = eNoMergeDelims
[static]
 

Search for a field.

Avoid memory allocation at the expence of some usage safety.

Parameters:
str C or C++ string to search in.
field_no Zero-based field number.
delimiters Single character delimiter.
merge Whether to merge or not adjacent delimiters. Default: not to merge.
Returns:
Found field; or empty string if the required field is not found.
Warning:
The return value stores a pointer to the input string 'str' so the return object validity time matches lifetime of the input 'str'

Definition at line 3185 of file ncbistr.cpp.

CTempString NStr::GetField_Unsafe const CTempString str,
size_t  field_no,
const CTempString delimiters,
EMergeDelims  merge = eNoMergeDelims
[static]
 

Search for a field Avoid memory allocation at the expence of some usage safety.

Parameters:
str C or C++ string to search in.
field_no Zero based field number.
delimiters Single character delimiters.
merge Whether to merge or not adjacent delimiters. Default: not to merge.
Returns:
Found field; or empty string if the required field is not found.
Warning:
The return value stores a pointer to the input string 'str' so the return object validity time matches lifetime of the input 'str'

Definition at line 3172 of file ncbistr.cpp.

int NStr::HexChar char  ch  )  [inline, static]
 

Convert character to integer.

Parameters:
ch Character to be converted.
Returns:
Integer (0..15) corresponding to the "ch" as a hex digit. Return -1 on error.

Definition at line 3224 of file ncbistr.hpp.

Referenced by HexToString().

void NStr::Int8ToString string &  out_str,
Int8  value,
TNumToStringFlags  flags = 0,
int  base = 10
[static]
 

Convert Int8 to string.

Parameters:
out_str Output string variable
value Integer value (Int8) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.

Definition at line 1119 of file ncbistr.cpp.

References _ASSERT, buffer, CHAR_BIT, fWithSign, pos, and s_PrintUint8().

string NStr::Int8ToString Int8  value,
TNumToStringFlags  flags = 0,
int  base = 10
[static]
 

Convert Int8 to string.

Parameters:
value Integer value (Int8) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.
Returns:
Converted string value.

Definition at line 1007 of file ncbistr.cpp.

Referenced by CWorkerNode::AsString(), BOOST_AUTO_TEST_CASE(), CMemoryFileSegment::CMemoryFileSegment(), CTimeSpan::CTimeSpan(), CTime::DiffTimeSpan(), CMemoryFile::Extend(), CQueueParamAccessor::GetParamValue(), CObjectOStream::GetPosition(), CObjectIStream::GetPosition(), CDiagContext::GetProperty(), CVariant::GetString(), CBDB_FieldInt8::GetString(), CArgAllow_Int8s::GetUsage(), CQueue::JobDelayExpiration(), CDebugDumpContext::Log(), CMemoryFileMap::Map(), value_slice::CValueConvert< CP, Int8 >::operator string(), CQuickStrStream::operator<<(), CDefaultTypeConverter::PrimitiveToString(), CArgAllow_Int8s::PrintUsageXml(), oligofar::CBatch::Purge(), CAsnElementPrimitive::RenderValue(), CPrimeNumbersJob::Run(), s_ValToString(), CFileIO::SetFilePos(), CSeqDBVol::TiToOid(), CBDB_FieldInt8::ToString(), CObjectOStreamJson::WriteInt8(), CDBL_CursorCmd::x_AssignParams(), CTL_CursorCmdExpl::x_AssignParams(), CNCBlobStorage::x_GetDataFileName(), CNCBlobStorage::x_GetMetaFileName(), CNCBlobStorage::x_GetVolumeName(), and CTrackContainer::x_UpdateMsg().

void NStr::IntToString string &  out_str,
long  value,
TNumToStringFlags  flags = 0,
int  base = 10
[static]
 

Convert Int to String.

Parameters:
out_str Output string variable.
value Integer value (long) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.

Definition at line 890 of file ncbistr.cpp.

References _ASSERT, buffer, CHAR_BIT, fWithCommas, fWithSign, pos, and s_Hex.

string NStr::IntToString long  value,
TNumToStringFlags  flags = 0,
int  base = 10
[inline, static]
 

Convert Int to String.

Parameters:
value Integer value (long) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.
Returns:
Converted string value.

Definition at line 3206 of file ncbistr.hpp.

Referenced by AccessionToKey(), CMaskInfoRegistry::Add(), CTL_BCPInCmd::AddHint(), CPagerView::AddImageString(), CPagerView::AddInactiveImageString(), CQueueWorkerNodeList::AddJob(), CTaxNRCriteria::Apply(), CBlastDBSeqId::AsString(), CObjectIStreamAsn::BadStringChar(), Blast_GetSeqLocInfoVector(), BlastXML_FormatReport(), BOOST_AUTO_TEST_CASE(), CDebugDumpViewer::Bpt(), BuildGFF3Gap(), CGuideTreeCalc::CalcBioTree(), CalculateFormattingParams(), CBioseq::CBioseq(), CBlastSeqVectorFromCSeq_data::CBlastSeqVectorFromCSeq_data(), CDbapiSampleApp::CDbapiSampleApp(), CGenBankLoadingJob::CGenBankLoadingJob(), CAgpRow::CheckComponentEnd(), CResultSet::CheckIdx(), CMC_NonCodingRegion< 5 >::class_id(), CMC3_CodingRegion< 5 >::class_id(), CWAM_Acceptor< 2 >::class_id(), CWAM_Donor< 2 >::class_id(), CMsvcPrjGeneralContext::CMsvcPrjGeneralContext(), CollectAttributes(), CCgiStatistics::Compose_Result(), ToStr< int >::Convert(), CPepXML::ConvertModifications(), CPepXML::ConvertScanID(), CRawSeqDBSource::CRawSeqDBSource(), CAnnotationASN1::CImplementationData::create_cdregion_feature(), CAnnotationASN1::CImplementationData::create_gene_feature(), CAnnotationASN1::CImplementationData::create_mrna_feature(), CEntrezDB::CreateAnnot_Genome(), CEntrezDB::CreateAnnot_Nuc_Prot(), CwxSeqMarkerSetDlg::CreateControls(), CAutodefParamsPanel::CreateControls(), CAboutDlg::CreateControls(), CEntrezDB::CreateGene_Gene(), CSetupFactory::CreateLookupTable(), CreateMsvcProjectMakefileName(), CProjectService::CreateNewWorkspace(), CServer::CreateRequest(), CSetupFactory::CreateScoreBlock(), CSparseAln::CreateSegmentIterator(), CPluginValueConstraint::CreateSeqLenRange(), CPagerViewJavaLess::CreateSubNodes(), CPagerViewButtons::CreateSubNodes(), CSmallPagerBox::CreateSubNodes(), CPagerBox::CreateSubNodes(), XSDParser::CreateTmpEmbeddedName(), CSeq_align::CreateTranslatedDensegFromNADenseg(), CBlastEffectiveLengthsOptions::DebugDump(), CBlastQueryInfo::DebugDump(), DebugDumpRangeCRef(), DebugDumpRangeObj(), DebugDumpRangePtr(), CQueue::DecorateJobId(), CHTML_area::DefineCircle(), CHTML_area::DefinePolygon(), CHTML_area::DefineRect(), DeltaBlockModelToString(), CIDs::Encode(), CQueue::EraseJob(), CTaxon1NodeConvertVisitor< TITaxon4Each, TITaxon1Node, TITreeIterator, TBioTreeContainer >::Execute(), CTaxIdExtractor::Extract(), CSeqLenExtractor::Extract(), CHashExtractor::Extract(), COidExtractor::Extract(), CPigExtractor::Extract(), CGiExtractor::Extract(), CDense_seg::ExtractRows(), CDense_seg::ExtractSlice(), find_unique_name(), CFindPattern::FindRepeatsOf(), CwxIntWithFlagsFormat::Format(), CFlatIntQVal::Format(), CZipCompression::FormatErrorMessage(), CBZip2Compression::FormatErrorMessage(), FormatNSId(), FormatRange(), CNetCacheKey::GenerateBlobKey(), GenerateWinItemPrefix(), GetAccessionAndDatabaseSource(), CSparseAln::GetAlnSeqString(), GetBioseqWithFootprintForNthRow(), SCacheInfo::GetBlobSubkey(), CTSE_Split_Info::GetChunk(), GetColumnSectionName(), CBigIntDataType::GetDefaultString(), CIntDataType::GetDefaultString(), CEnumDataType::GetDefaultString(), CPrimeNumbersJob::GetDescr(), CMapTypeStrings::GetDestructionCode(), CListTypeStrings::GetDestructionCode(), CSetTypeStrings::GetDestructionCode(), GetDirectLabel(), CJob::GetField(), CJobRun::GetField(), CPdfFontHandler::GetFontName(), CObjectStackFrame::GetFrameName(), CGBenchApplication::GetGuardFilepath(), CAlnVecRow::GetHTMLActiveAreas(), SCacheInfo::GetIdKey(), CNetScheduleExecuter::GetJob(), CQueue::GetJobDescr(), CPub::GetLabel(), CMedline_entry::GetLabel(), CInt_fuzz::GetLabel(), CDbtag::GetLabel(), CCit_gen::GetLabel(), CHitMatrixDataSource::GetLabel(), CBioTreeContainerHandler::GetLabel(), CValidErrorHandler::GetLabel(), CGBenchVersionInfo::GetLabel(), CBlastQuerySourceBioseqSet::GetLength(), GetNumberOfContexts(), CBlastDbMetadata::GetNumberOfSequences(), CPager::GetPageInfo(), CQueueParamAccessor::GetParamValue(), CMsHdf5::getPrecursorMzs(), CAgpErrEx::GetPrintableCode(), CDataLoaderFactory::GetPriority(), CNcbiArguments::GetProgramName(), CBuildSparseAlnJob::GetProgress(), CBuildAlnVecJob::GetProgress(), CDiagContext::GetProperty(), CQuerySplitter::GetQueryFactoryForChunk(), CEFetch_Sequence_Request::GetQueryString(), CAlnMap::GetResidueIndexMap(), CAlignFormatUtil::GetScoreString(), oligofar::CSnpDbBase::GetSeqId(), AlignmentUtility::GetSeqIdStringForRow(), CAlnMixSeq::GetSeqString(), GetSequenceNucleotideBothStrands(), GetSequenceProtein(), GetSequenceSingleNucleotideStrand(), CObjectStack::GetStackTraceASN(), CVariant::GetString(), CBDB_FieldUint2::GetString(), CBDB_FieldInt2::GetString(), CBDB_FieldInt4::GetString(), GetStructureViaHTTPAndAddToCache(), CTranslationGlyph::GetTooltip(), CFeatGlyph::GetTooltip(), CLDBlockGlyph::GetTooltip(), CGwasGlyph::GetTooltip(), CBuildType::GetTypeStr(), CAlignFormatUtil::GetURLDefault(), CIdHandler::GnomonMRNA(), CIdHandler::GnomonProtein(), CBaseClusterer::IdToString(), CImage::Init(), CDbapiDriverSampleApp::Init(), CThreadedApp::Init(), CSplitCacheApp::Init(), CDemoApp::Init(), CAppNWA::Init(), CBlastDbCheckApplication::Init(), COMSSABase::Init(), CCompartApp::Init(), CBlastSearchTask::Init_Monitoring(), CBlastSearchTask::Init_RetrieveRID(), CBlastSearchTask::Init_SubmitSearch(), CAlnMixSequences::InitExtraRowsStartIts(), SNetCacheAPIImpl::InitiatePutCmd(), CAlnMixSequences::InitRowsStartIts(), oligofar::CSnpDbCreator::Insert(), CGenBankLoadOptionPanel::IsInputValid(), IsLocalID(), CQueue::JobDelayExpiration(), AbstractLexer::LexerError(), CTraceDataProxy::LoadData(), AbstractParser::Location(), CDataValue::LocationString(), CDataType::LocationString(), CDebugDumpContext::Log(), CAsn2AsnThread::Main(), RowSourceTable::makeCDRowKey(), CRmOutReader::MakeFeature(), MakeLeftHeader(), CMSHits::MakeModString(), CSearch< LEGACY, NHITS >::MakeModString(), MakeRID(), CCdAnnotationInfo::MakeRowInfoString(), CUniqueLabelGenerator::MakeUniqueLabel(), CDiagMatcher::MatchErrCode(), CBDB_Env::MempTrickle(), CFilterDialog::ModelToView(), CTime::MonthNumToName(), CDistMethods::NjTree(), CDDRefDialog::OnButton(), CTracingHandler::OnCommand_Range(), CAgpRenumber::OnGapOrComponent(), CCgiTunnel2Grid::OnJobSubmitted(), CCgi2RCgiApp::OnJobSubmitted(), CLDBlockGlyph::OnLeftDblClick(), CAgpValidateReader::OnObjectChange(), CwxMainFrame::OnPostEventsClick(), CDataMiningPanel::OnSearchFinished(), CTracingHandler::OnUpdateCommand_Range(), ctlib::Connection::Open(), SQueueDbBlock::Open(), CNetScheduleKey::operator string(), value_slice::CValueConvert< CP, Int4 >::operator string(), value_slice::CValueConvert< CP, Int2 >::operator string(), value_slice::CValueConvert< CP, Int1 >::operator string(), CQueryTreePrintFunc::operator()(), PConvertToString< TBlastDbId >::operator()(), CPhyloTreeCGIMap::operator()(), PConvertToString< int >::operator()(), CQuickStrStream::operator<<(), AbstractParser::ParseError(), CwxLogDiagHandler::Post(), CValidError_imp::PostErr(), printGFF3(), CRowSelector::PrintSequence(), CArgDescMandatory::ProcessArgument(), CNetScheduleHandler::ProcessFastStatusS(), CNetScheduleHandler::ProcessFastStatusW(), CNetScheduleHandler::ProcessGetParam(), CNetScheduleHandler::ProcessJobRunTimeout(), CNetScheduleHandler::ProcessQueueInfo(), CNetScheduleHandler::ProcessStatus(), CDBAPI_Cache::Purge(), CQueue::PutProgressMessage(), CGeneFileUtils::ReadGeneInfo(), ReadString(), CNetScheduleExecuter::RegisterClient(), CWriteDB_Impl::RegisterMaskAlgorithm(), CQueueWorkerNodeList::RemoveJob(), CCgiFontTestApp::Render(), CNSInfoRenderer::RenderJob(), CGridCgiApplication::RenderRefresh(), CNSInfoRenderer::RenderWNode(), ReplaceVisibleChar(), CValidError_feat::ReportCdTransErrors(), CDB_SQLEx::ReportExtra(), CDB_RPCEx::ReportExtra(), CValidError_bioseq::ReportModifInconsistentError(), CSeqDB::TSequenceRanges::reserve(), RetrievePartsOfLargeChromosome(), CQueue::ReturnJob(), CCgiApplication::Run(), CDemoSeqQaApp::Run(), CUpdateOmssaModApplication::Run(), CSeqAlignCmp::Run(), s_AddZeroPadInt(), s_ChrName(), s_CreateTreeLeaf(), python::s_FillDescription(), s_FillModuleListPSAPI(), s_FormatAA(), s_FormatCBlastDBSeqID(), s_GetAlignmentTooltip(), s_GetElapsedTime(), s_GetItems_Feat(), s_GetRoundNumber(), s_GetSeq_TotalRangeLabel(), s_GetSeqIdListString(), s_InitTestData(), s_MakeKeyCondition(), s_MakeNewMasterSeq(), s_MakeOverflowFileName(), s_MakeTwoLeafTree(), s_MakeValueList(), s_ReportError(), s_SetLeafIds(), s_StackWalker(), s_TableRowHook(), s_ToString(), s_ValToString(), s_WindowMaskerTaxidToDb(), CGBProjectHandle::Save(), SBlastSequence::SBlastSequence(), SeqDB_FileIntegrityAssert(), oligofar::CBitmaskBuilder::SequenceBuffer(), SequenceIdToString(), SSnpFilter::SerializeTo(), CTextseq_id::Set(), CSeq_id::Set(), CBDB_FieldLString::Set(), CTimeout::Set(), CBDB_FieldString::Set(), CMTArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CPssmEngineArgs::SetArgumentDescriptions(), CGeneticCodeArgs::SetArgumentDescriptions(), CLargestIntronSizeArgs::SetArgumentDescriptions(), COffDiagonalRangeArg::SetArgumentDescriptions(), CGenericSearchArgs::SetArgumentDescriptions(), CNCBINode::SetAttribute(), CTime::SetDay(), CFileIO::SetFilePos(), CSeqLocInfo::SetFrame(), CPluginValue::SetInteger(), CTime::SetMonth(), CDataMiningPanel::SetRange(), CHTML_font::SetRelativeSize(), CBDB_FieldLString::SetStdString(), python::CStmtStr::SetStr(), oligofar::CMappedAlignment::SetTagI(), CSplignArgUtil::SetupArgDescriptions(), CProSplignOutputOptions::SetupArgDescriptions(), CProSplignScoring::SetupArgDescriptions(), CCompartOptions::SetupArgDescriptions(), CSQLITE_Connection::SetupNewConnection(), CTime::SetYear(), CGlBitmapFont::SizeFromInt(), CAlnMixSegment::StartItsConsistencyCheck(), StringToInt8(), StringToUInt8(), StringToUInt8_DataSize(), CSeqTextPanel::STWH_ReportMouseOverPos(), CDUpdater::submitBlast(), CQueue::TimeLineExchange(), CQueue::TimeLineRemove(), CCdAnnotationInfo::ToFtpDumpString(), CCdAnnotationInfo::ToLongString(), CMemberId::ToString(), CAgpRow::ToString(), CSeqDB_AliasMask::ToString(), CGeneInfo::ToString(), ToString(), CCompVal::ToString(), CCdAnnotationInfo::ToString(), CCompareSeq_locs::SIntervalComparisonResultGroup::ToString(), CGlRect< T >::ToString(), CBDB_FieldUint2::ToString(), CBDB_FieldInt2::ToString(), CBDB_FieldInt4::ToString(), CNetworkOptionsPage::TransferDataToWindow(), CObjectIStreamAsnBinary::UnexpectedByte(), CObjectIStreamAsnBinary::UnexpectedMember(), CObjectIStreamAsnBinary::UnexpectedSysTagByte(), CNetScheduleExecuter::UnRegisterClient(), CSearchFormBase::UpdateContextCombo(), CDense_seg::Validate(), CValidError_feat::ValidateGapFeature(), CValidError_bioseq::ValidateGraphOnDeltaBioseq(), CValidError_bioseq::ValidateMaxValues(), CValidError_bioseq::ValidateMinValues(), CValidError_bioseq::ValidateModifDescriptors(), CValidError_bioseq::ValidateMoltypeDescriptors(), CValidError_bioseq::ValidateMultipleGeneOverlap(), CValidError_imp::ValidateOrgName(), CValidError_bioseq::ValidateRawConst(), CValidError_bioseq::ValidateSegRef(), CObjectOStreamJson::WriteEnum(), CGeneFileUtils::WriteGeneInfo(), CObjectOStreamJson::WriteInt4(), CPdfFontHandler::x_AddFont(), CFeatureItem::x_AddFTableDbxref(), CPageList::x_AddImageString(), CPageList::x_AddInactiveImageString(), CDataLoadingAppJob::x_AddToExistingProject(), CCpgSearchJob::x_AddToResults(), CMultiAligner::x_AttachClusterTrees(), CAlnGraphic::x_BuildHtmlTable(), COpenViewlDlgTask::x_CheckDataStatus(), CSQLITE_Connection::x_CheckFlagsValidity(), CSequenceDataTester::x_CompareSequenceData(), CGuideTreeCalc::x_ComputeTree(), CFeaturePanel::x_ConfigureTracks(), CWriteDB_Impl::x_CookSequence(), CwxMainFrame::x_CreateNextItem(), CDataLoadingAppJob::x_CreateOneProject(), CPageHandler::x_CreatePrintersMarks(), CDataLoadingAppJob::x_CreateSeparateProjects(), CShowBlastDefline::x_DisplayDefline(), CShowBlastDefline::x_DisplayDeflineTable(), CNCMessageHandler::x_DoCmd_HasBlob(), CNCMessageHandler::x_DoCmd_IC_GetAccessTime(), CNCMessageHandler::x_DoCmd_IC_GetBlobsTTL(), CCpgSearchJob::x_DoSearch(), CLDBlockGlyph::x_Draw(), CPageHandler::x_DrawPanelLink(), CPssmEngine::x_ErrorCodeToString(), CProjectLoadOptionPanel::x_FileMRUList(), CGuideTreeCGIMap::x_FillNodeMapData(), CDisplaySeqalign::x_FillSeqid(), CAlnMap::x_FindClosestSeqPos(), CDBSourceItem::x_FormatDBSourceID(), CGsdbComment::x_GatherInfo(), CGeneFileWriter::x_GeneInfo_ParseLine(), CPhyloTreeLabel::x_GenerateAutoLabel(), CAlnVecRow::x_GetAlignmentTooltip_General(), CAlnVecRow::x_GetAlignmentTooltip_Insert(), CAlnVecRow::x_GetAlignmentTooltip_Unaligned(), CGBenchApplication::x_GetArgs(), CFileDBEngine::x_GetCmdFileName(), CHG_Gene::x_GetGeneidLabel(), CTracingHandler::x_GetMethodTrace(), CTaxTreeBrowser::x_GetName(), CGuideTree::x_GetNode(), CDisplaySeqalign::x_GetSegs(), CAlnMap::x_GetSeqLeftSeg(), CAlnMap::x_GetSeqRightSeg(), CSeqDBVol::x_GetSequence(), CPrimaryItem::x_GetStrForPrimary(), CAltValidator::x_GetTaxonSpecies(), CAlignedFeatureGraph::x_GetTooltip(), CBinsGlyph::x_GetTooltipCITED(), CBinsGlyph::x_GetTooltipCLIN(), CBinsGlyph::x_GetTooltipGAP(), CBinsGlyph::x_GetTooltipGCAT(), CTTWindow::x_HitTest(), CElementaryMatching::x_InitBasic(), CShowBlastDefline::x_InitDefline(), CShowBlastDefline::x_InitDeflineTable(), CWNJobsWatcher::x_KillNode(), CNetScheduleHandler::x_MakeLogMessage(), CGenbankFormatter::x_Medline(), CProjectServiceTestJob::x_ModifyItems(), CNetScheduleHandler::x_MonitorJob(), CSegmentMapTrack::x_OnIconClicked(), CSegmentMapTrack::x_OnJobCompleted(), CPhyloTreeNodeGroupper::x_OnStepDown(), CPhyloTreeNodeGroupper::x_OnStepLeft(), CPhyloTreeNodeGroupper::x_OnStepRight(), CSeqDBVol::x_OpenAllColumns(), CGFFReader::x_ParseAndPlace(), CBlastDBCmdApp::x_PrintBlastDatabaseInformation(), CQueue::x_PrintJobStat(), CDiagContext::x_PrintMessage(), CAgpValidateReader::x_PrintPatterns(), CAgpValidateReader::x_PrintTotals(), CGenbankFormatter::x_Pubmed(), CSeqDBAliasSets::x_ReadAliasSetFile(), CPhyloTreeCGIApplication::x_RenderPage(), CTTWindow::x_RenderThirdRow(), CXmlValueItem::x_RenderXml(), CBlastSearchTask::x_ReportErrors(), CMultiAligner::x_Run(), CFeaturePanel::x_SaveSettings(), CPrintOptionsDlg::x_SelectPaper(), CTSE_Info::x_SetBioseq_setId(), CAlignmentTrack::x_SetMsg(), CId1Reader::x_SetParams(), CGBenchApplication::x_StartMonitor(), CDB_Exception::x_StartOfWhat(), CAppTaskServiceSlot::x_StatusText(), CSplitQueryTestFixture::x_TestCContextTranslator(), CSequenceDataTester::x_TestSingleNucleotide_Remote(), CSequenceDataTester::x_TestSingleProtein_Remote(), CDeflineGenerator::x_TitleFromPatent(), CDBAPI_Cache::x_UpdateAccessTime(), CQueue::x_UpdateDB_GetJobNoLock(), CBLAST_DB_Dialog::x_UpdateFilterStatusText(), CSeq_annot_Info::x_UpdateName(), CFeatTableView::x_UpdateStatusMessage(), CAlignSpanView::x_UpdateStatusMessage(), CValidError_feat::x_ValidateCodeBreakNotOnCodon(), CValidError_align::x_ValidateDendiag(), CValidError_align::x_ValidateDim(), ILocalQueryData::x_ValidateIndex(), CValidError_align::x_ValidateSegmentGap(), CValidError_align::x_ValidateSeqLength(), CValidError_align::x_ValidateStd(), CValidError_align::x_ValidateStrand(), CElementaryMatching::x_WriteIndexFile(), and CTime::YearWeekNumber().

bool NStr::IsBlank const string &  str,
SIZE_TYPE  pos = 0
[static]
 

Check if a string is blank (has no text).

Parameters:
str String to check.
pos starting position (default 0)

Definition at line 85 of file ncbistr.cpp.

References len.

Referenced by CPCRSetList::AddFwdName(), CPCRSetList::AddFwdSeq(), CSeqSearch::AddNucleotidePattern(), CPCRSetList::AddRevName(), CPCRSetList::AddRevSeq(), CAutoDefFeatureClause_Base::AssignGeneProductNames(), CCleanup_imp::BasicCleanup(), CAutoDefParsedIntergenicSpacerClause::CAutoDefParsedIntergenicSpacerClause(), CAutoDefParsedtRNAClause::CAutoDefParsedtRNAClause(), CAutoDefTransposonClause::CAutoDefTransposonClause(), CFlatInferenceQVal::CFlatInferenceQVal(), CheckDate(), CleanStringContainer(), CSubSource::DateFromCollectionDate(), CAutoDefFeatureClause_Base::DisplayAlleleName(), CAutoDefFeatureClause_Base::FindGeneProductName(), CFlatNumberQVal::Format(), GenomeByOrganelle(), CAutoDefFeatureClause_Base::GroupSegmentedCDSs(), CValidError_imp::HasName(), CAutoDefIntergenicSpacerClause::InitWithString(), IsBlankStringList(), IsEmpty(), CAutoDefFeatureClause::IsInsertionSequence(), CAutoDefFeatureClause::IsSatelliteClause(), CAutoDefFeatureClause::IsTransposon(), ParseLex(), COrgMod::ParseStructuredVoucher(), CAutoDefFeatureClause_Base::PluralizeDescription(), CAutoDefFeatureClause_Base::PluralizeInterval(), CAutoDefFeatureClause_Base::PrintClause(), s_BadCharsInAuthorName(), s_CheckQuals_bind(), s_CheckQuals_conflict(), s_CheckQuals_mod_base(), s_DoSup(), s_ExtractSatelliteFromComment(), s_FindMatchInOrgRef(), s_FindWholeName(), s_FormatCitBook(), s_FormatPatent(), s_GetInitialsFromFirst(), s_HasCompareOrCitation(), s_HasNcRNAName(), s_IsCorrectLatLonFormat(), s_IsEmpty(), s_IsValidECNumberFormat(), s_IsValidPrimerSequence(), s_ListChanges(), s_OutputFeature(), s_ParseParentQual(), s_ParseTRnaFromAnticodonString(), s_ParseTRnaString(), s_SeqLocHasAccession(), s_StringHasPMID(), s_StringToSubSource(), s_tRNAClauseFromNote(), s_UnbalancedParentheses(), SetChromosome(), SetCommon(), SetCountryOnSrc(), SetLineage(), SetOrgMod(), SetSubSource(), SetTaxname(), SplitQuery_GetChunkSize(), SplitQuery_GetOverlapChunkSize(), ValidateAccessionString(), CValidError_imp::ValidateCitSub(), CValidError_imp::ValidateDbxref(), CValidError_feat::ValidateExcept(), CValidError_feat::ValidateGene(), CValidError_feat::ValidateImpGbquals(), CValidError_feat::ValidateNonImpFeatGbquals(), CValidError_imp::ValidateOrgModVoucher(), CValidError_imp::ValidateOrgName(), CValidError_imp::ValidatePubHasAuthor(), CValidError_imp::ValidateSourceQualTags(), CAutoDef::x_AddMiscRNAFeatures(), CFeatureItem::x_AddQualsBond(), CCleanup_imp::x_ChangeGenBankBlocks(), CCleanup_imp::x_CleanupRptUnit(), CCleanup_imp::x_CleanupUserString(), CValidError_bioseq::x_CompareStrings(), CGenbankFormatter::x_Consortium(), CReferenceItem::x_CreateUniqueStr(), CAutoDefFeatureClause::x_FindNoncodingFeatureKeywordProduct(), CCleanup_imp::x_FixEtAl(), CCommentItem::x_GatherDescInfo(), CCommentItem::x_GatherFeatInfo(), CDBSourceItem::x_GatherInfo(), CAutoDefFeatureClause::x_GetDescription(), CAutoDefFeatureClause::x_GetFeatureTypeWord(), CAutoDefModifierCombo::x_GetOrgModLabel(), CAutoDefNcRNAClause::x_GetProductName(), CAutoDefFeatureClause::x_GetProductName(), CAutoDefModifierCombo::x_GetSubSourceLabel(), CFlatGatherer::x_IdComments(), CCleanup_imp::x_Identical(), CCleanup_imp::x_IsMergeableBioSource(), CGenbankFormatter::x_Journal(), CAutoDefFeatureClause::x_MatchGene(), CCleanup_imp::x_MergeAdjacentAnnots(), CCleanup_imp::x_OkToMerge(), CGenbankFormatter::x_Remark(), CCleanup_imp::x_RemoveEmptyFeatureAnnots(), CCleanup_imp::x_RemoveEmptyTitles(), CCleanup_imp::x_RemovePseudoProducts(), CCleanup_imp::x_RemoveUnnecessaryGeneXrefs(), CValidError_bioseq::x_ReportDupOverlapFeaturePair(), CCommentItem::x_SetCommentWithURLlinks(), CLocusItem::x_SetName(), CGenbankFormatter::x_Title(), and CValidError_bioseq::x_ValidatePubFeatures().

bool NStr::IsIPAddress const string &  ip  )  [static]
 

Check if the string contains a valid IP address.

Definition at line 3031 of file ncbistr.cpp.

References errno.

Referenced by CRequestContext::SetClientIP(), and CDiagContext::SetHostIP().

string NStr::JavaScriptEncode const string &  str  )  [static]
 

Encode a string for JavaScript.

Like to CEncode(), but process some symbols in different way.

See also:
PrintableString, CEncode

Definition at line 1982 of file ncbistr.cpp.

References eNewLine_Quote, and s_PrintableString().

Referenced by CHTMLHelper::HTMLJavaScriptEncode(), and CAlnGraphic::x_BuildHtmlTable().

string NStr::Join const vector< string > &  arr,
const string &  delim
[static]
 

Definition at line 1857 of file ncbistr.cpp.

References s_NStr_Join().

string NStr::Join const list< string > &  arr,
const string &  delim
[static]
 

Join strings using the specified delimiter.

Parameters:
arr Array of strings to be joined.
delim Delimiter used to join the string.
Returns:
The strings in "arr" are joined into a single string, separated with "delim".

Definition at line 1851 of file ncbistr.cpp.

References s_NStr_Join().

Referenced by CProjectsLstFileFilter::CheckProject(), CHTML_area::DefineCircle(), CHTML_area::DefineRect(), SMakeProjectT::DoResolveDefs(), CMsvcSite::GetLibInclude(), NcbiMessageBox(), CArgs::Print(), s_GBSeqStringCleanup(), CDBSourceItem::x_AddPDBBlock(), CFlatItemFormatter::x_GetKeywords(), CRegexpUtil::x_Join(), and CGBenchApplication::x_SyncRegistryAndEnvironment().

string NStr::JsonEncode const string &  str  )  [static]
 

Encode a string for JSON.

Definition at line 2030 of file ncbistr.cpp.

bool NStr::MatchesMask const string &  str,
const string &  mask,
ECase  use_case = eCase
[inline, static]
 

Match "str" against the "mask".

This function do not use regular expressions.

Parameters:
str String to match.
mask Mask used to match string "str". And can contains next wildcard characters: ? - matches to any one symbol in the string.
  • matches to any number of symbols in the string.
use_case Whether to do a case sensitive compare(eCase -- default), or a case-insensitive compare (eNocase).
Returns:
Return TRUE if "str" matches "mask", and FALSE otherwise.
See also:
CRegexp, CRegexpUtil

Definition at line 3236 of file ncbistr.hpp.

References MatchesMask().

bool NStr::MatchesMask const char *  str,
const char *  mask,
ECase  use_case = eCase
[static]
 

Match "str" against the "mask".

This function do not use regular expressions.

Parameters:
str String to match.
mask Mask used to match string "str". And can contains next wildcard characters: ? - matches to any one symbol in the string.
  • matches to any number of symbols in the string.
use_case Whether to do a case sensitive compare(eCase -- default), or a case-insensitive compare (eNocase).
Returns:
Return TRUE if "str" matches "mask", and FALSE otherwise.
See also:
CRegexp, CRegexpUtil

Definition at line 224 of file ncbistr.cpp.

References eNocase.

Referenced by CMaskFileName::Match(), MatchesMask(), CDirEntry::MatchesMask(), CFeatureSearchJob::x_Match(), and CGFFReader::x_ParseV3Attributes().

bool NStr::NeedsURLEncoding const string &  str,
EUrlEncode  flag = eUrlEnc_SkipMarkChars
[static]
 

Check if the string needs the reqested URL-encoding.

Definition at line 2990 of file ncbistr.cpp.

References _TROUBLE, eUrlEnc_None, eUrlEnc_Path, eUrlEnc_PercentOnly, eUrlEnc_ProcessMarkChars, eUrlEnc_SkipMarkChars, and len.

Referenced by CEncodedString::SetString().

string NStr::ParseEscapes const string &  str  )  [static]
 

Parse C-style escape sequences in the specified string, including all those produced by PrintableString.

Definition at line 2063 of file ncbistr.cpp.

References NCBI_THROW2, NPOS, and out().

Referenced by CNetScheduleAPI::GetJobDetails(), CNetScheduleAPI::GetProgressMsg(), CNetScheduleHandler::ProcessCreateQueue(), CNetScheduleHandler::ProcessGetJob(), CNetScheduleHandler::ProcessJobExchange(), CNetScheduleHandler::ProcessMsgBatchJob(), CNetScheduleHandler::ProcessPut(), CNetScheduleHandler::ProcessPutFailure(), CNetScheduleHandler::ProcessQuery(), CNetScheduleHandler::ProcessSelectQuery(), CNetScheduleHandler::ProcessStatusSnapshot(), CNetScheduleHandler::ProcessSubmit(), CNetScheduleHandler::ProcessWaitGet(), SNetServerConnectionImpl::ReadCmdOutputLine(), s_FindParam(), CNetCacheWriter::x_IsStreamOk(), CNetScheduleHandler::x_ParseTags(), CJob::x_ParseTags(), and CGFFReader::x_ParseV2Attributes().

string NStr::PrintableString const string &  str,
TPrintableMode  mode = eNewLine_Quote
[static]
 

Get a printable version of the specified string.

All non-printable characters will be represented as "\r", "\n", "\v", "\t", "\"", "\", etc, or "" where 'ooo' is the octal code of the character. The resultant string is a well-formed C string literal, which, without alterations, can be compiled by a C/C++ compiler. In many instances, octal representations of non-printable characters can be reduced to take less than all 3 digits, if there is no ambiguity in the interpretation. fPrintable_Full cancels the reduction, and forces to produce full 3-digit octal codes throughout.

Parameters:
str The string whose printable version is wanted.
mode How to display the string. The default setting of fNewLine_Quote displays the new lines as "\n", and uses the octal code reduction. When set to fNewLine_Passthru, line breaks are actually produced on output but preceded with trailing backslashes.
Returns:
Return a printable version of "str".
See also:
ParseEscapes

Definition at line 1975 of file ncbistr.cpp.

References eLanguage_C, and s_PrintableString().

Referenced by CCgiCookies::Add(), CEncode(), ToStr< string >::Convert(), CNetScheduleAdmin::Count(), IRegistry::EnumerateEntries(), IRegistry::Get(), IRegistry::GetComment(), CSpectrumSet::GetMGFBlock(), IRegistry::HasEntry(), CSpectrumSet::LoadMultDTA(), CNetScheduleHandler::ProcessQueueInfo(), CNetScheduleHandler::ProcessStatus(), CNetScheduleAdmin::Query(), CNetScheduleAdmin::RetrieveKeys(), CSampleObjmgrApplication::Run(), s_DumpHeader(), s_GetUsageSymbol(), s_HandleError(), s_LOG_Handler(), s_Printable(), s_SerializeJob(), CNetScheduleAdmin::Select(), IRWRegistry::Set(), IRWRegistry::SetComment(), CCgiResponse::SetFilename(), CNetScheduleAdmin::StatusSnapshot(), CCgiCookie::Write(), CCgiCookie::x_CheckField(), CGFFFormatter::x_FormatAttr(), and CNetScheduleHandler::x_MakeGetAnswer().

string NStr::PtrToString const void *  ptr  )  [static]
 

Convert pointer to string.

Parameters:
str Pointer to be converted.
Returns:
String value representing the pointer.

Definition at line 1254 of file ncbistr.cpp.

References buffer.

void NStr::PtrToString string &  out_str,
const void *  ptr
[static]
 

Convert pointer to string.

Parameters:
out_str Output string variable
str Pointer to be converted.

Definition at line 1262 of file ncbistr.cpp.

References buffer.

Referenced by CDataLoader::CDataLoader(), DebugDumpPairsCRefCRef(), DebugDumpPairsPtrCRef(), DebugDumpPairsPtrPtr(), CProjectViewBase::GetFingerprint(), CDebugDumpContext::Log(), PConvertToString< const void * >::operator()(), CObjectIStream::ReadExternalObject(), CWriteObjectList::RegisterObject(), CPluginObject::SetDataHandle(), CPluginObject::SetObject(), CPluginObject::SetProject(), CObjectOStream::WriteExternalObject(), and CObjectOStream::WritePointer().

string NStr::Replace const string &  src,
const string &  search,
const string &  replace,
SIZE_TYPE  start_pos = 0,
SIZE_TYPE  max_replace = 0
[static]
 

Replace occurrences of a substring within a string and returns the result as a new string.

Parameters:
src Source string from which specified substring occurrences are replaced.
search Substring value in "src" that is replaced.
replace Replace "search" substring with this value.
start_pos Position to start search from.
max_replace Replace no more than "max_replace" occurrences of substring "search" If "max_replace" is zero(default), then replace all occurrences with "replace".
Returns:
A new string containing the result of replacing the "search" string with "replace" in "src"
See also:
Versioning of Replace() that has a destination parameter to accept result.

Definition at line 1555 of file ncbistr.cpp.

References Replace().

string & NStr::Replace const string &  src,
const string &  search,
const string &  replace,
string &  dst,
SIZE_TYPE  start_pos = 0,
SIZE_TYPE  max_replace = 0
[static]
 

Replace occurrences of a substring within a string.

Parameters:
src Source string from which specified substring occurrences are replaced.
search Substring value in "src" that is replaced.
replace Replace "search" substring with this value.
dst Result of replacing the "search" string with "replace" in "src". This value is also returned by the function.
start_pos Position to start search from.
max_replace Replace no more than "max_replace" occurrences of substring "search" If "max_replace" is zero(default), then replace all occurrences with "replace".
Returns:
Result of replacing the "search" string with "replace" in "src". This value is placed in "dst" as well.
See also:
Versioning of Replace() that returns a new string.

Definition at line 1528 of file ncbistr.cpp.

References NCBI_THROW2, and NPOS.

Referenced by CHTMLPopupMenu::AddItem(), CMsvcConfigure::AnalyzeDefines(), CCleanup_imp::BasicCleanup(), CProjectsLstFileFilter::CheckProject(), CMemoryFileMap::CMemoryFileMap(), CProjectsLstFileFilter::ConvertToMask(), SBDB_CacheUnitStatistics::ConvertToRegistry(), CMSResponse::CSVString(), CRemoteAppRequestSB_Impl::Deserialize(), SMakeProjectT::DoResolveDefs(), CSimpleMakeFileContents::Dump(), CTypeStrings::GetDoxygenModuleName(), CProjectsLstFileFilter::InitFromString(), DTDParser::Modules(), ParseAttributes(), CProjBulderApp::ProcessLocationMacros(), CMsvcSite::ProcessMacros(), Replace(), CSymResolver::Resolve(), CFixMsHdf5Application::Run(), s_CollectRelPathes(), s_GBSeqQualCleanup(), s_GBSeqStringCleanup(), s_ReplaceArg(), s_TitleFromChromosome(), SDubiousShortSequence::SDubiousShortSequence(), sPrepareDBDescr(), strftime(), CDllResolver::TryCandidate(), SDiagMessage::Write(), CFileCode::WriteUserCopyright(), CNetBLASTUIDataSource::x_AddCategorizedDBs(), CGridWorkerNode::x_AreMastersBusy(), CGFFFormatter::x_FormatAttr(), CFtableFormatter::x_FormatQuals(), CMsvcProjectMakefile::x_GetHeaders(), CGBenchApplication::x_StartMonitor(), CCleanup_imp::x_SubtypeCleanup(), and CGBenchApplication::x_SyncRegistryAndEnvironment().

string & NStr::ReplaceInPlace string &  src,
const string &  search,
const string &  replace,
SIZE_TYPE  start_pos = 0,
SIZE_TYPE  max_replace = 0
[static]
 

Replace occurrences of a substring within a string.

On some platforms this function is much faster than Replace() if sizes of "search" and "replace" strings are equal. Otherwise, the performance is mainly the same.

Parameters:
src String whre specified substring occurrences are replaced. This value is also returned by the function.
search Substring value in "src" that is replaced.
replace Replace "search" substring with this value.
start_pos Position to start search from.
max_replace Replace no more than "max_replace" occurrences of substring "search" If "max_replace" is zero(default), then replace all occurrences with "replace".
Returns:
Result of replacing the "search" string with "replace" in "src".
See also:
Replace

Definition at line 1565 of file ncbistr.cpp.

References NPOS.

Referenced by CMsvcConfigure::AnalyzeDefines(), CField_rule::DoesStringMatchRuleExpression(), CDependent_field_rule::DoesStringMatchRuleExpression(), CTempTrackProxy::GetChildTempTrack(), CObjMemberSelector::GetMember(), CSpectrumSet::GetMGFBlock(), CSimpleMakeFileContents::GetPathValue(), CSequenceGotoData::GetRange(), CProjectsLstFileFilter::InitFromFile(), CProjectsLstFileFilter::InitFromString(), CProjBulderApp::ReportGeneratedFiles(), s_FindPathToGeneInfoFiles(), s_FindPathToWM(), s_IsTokenDouble(), s_ReadLine(), s_ReplaceCtrlAsInTitle(), SeqIdToIdentifier(), CTar::SetBaseDir(), strftime(), CValidError_imp::ValidateAuthorList(), CObjectOStreamJson::WriteKey(), CMsvcConfigure::WriteNcbiconfMsvcSite(), CEditObjectDlg::x_GetSubObject(), CCleanup_imp::x_RemoveAsn2ffGeneratedComments(), and CTar::x_ToArchiveName().

list< string > & NStr::Split const string &  str,
const string &  delim,
list< string > &  arr,
EMergeDelims  merge = eMergeDelims,
vector< SIZE_TYPE > *  token_pos = NULL
[static]
 

Split a string using specified delimiters.

Parameters:
str String to be split.
delim Delimiters used to split string "str".
arr The split tokens are added to the list "arr" and also returned by the function.
merge Whether to merge the delimiters or not. The default setting of eMergeDelims means that delimiters that immediately follow each other are treated as one delimiter.
token_pos Optional array for the tokens' positions in "str".
Returns:
The list "arr" is also returned.
See also:
Tokenize()

Definition at line 1591 of file ncbistr.cpp.

References kEmptyStr.

Referenced by CQueueClientInfoList::AddClientInfo(), CRefArgs::AddDefinitions(), CSimpleMakeFileContents::AddReadyKV(), CDebugDumpViewer::Bpt(), CProjectsLstFileFilter::CheckProject(), CMsvcSite::CMsvcSite(), CCgiStatistics::Compose_Entries(), CICacheCF< CNetICacheClient >::ConfigureTimeStamp(), SMakeProjectT::ConvertLibDepends(), CConfig::ConvertRegToTree(), CDriverManager::CreateDsFrom(), CPluginManager< TClass >::CreateInstanceFromList(), CProjectTreeFolders::CreatePath(), CUser_field::DeleteField(), SMakeProjectT::DoResolveDefs(), FindFiles(), CSampleLibraryObject::FindInPath(), CCodeGenerator::GenerateClientCode(), CFileCode::GenerateHPP(), CMsvcProjectMakefile::GetAdditionalIncludeDirs(), CMsvcProjectMakefile::GetAdditionalLIB(), CMsvcProjectMakefile::GetAdditionalSourceFiles(), CProjBulderApp::GetBuildConfigs(), CMsvcSite::GetComponents(), CMsvcSite::GetConfigureDefines(), CMsvcProjectMakefile::GetCustomBuildInfo(), GetDllsList(), CMsvcProjectMakefile::GetExcludedLIB(), CMsvcProjectMakefile::GetExcludedSourceFiles(), CUser_object::GetFieldRef(), CUser_field::GetFieldRef(), GetHostedLibs(), CMsvcSite::GetLibChoiceIncludes(), CMsvcSite::GetLibInfo(), CObjMemberSelector::GetMember(), CProjBulderApp::GetMetaDataFiles(), CMsvcMetaMakefile::GetPchInfo(), CMsvcSite::GetPlatformInfo(), CNetScheduleAdmin::GetQueueList(), CSequenceGotoData::GetRange(), CMsvcProjectMakefile::GetResourceFiles(), SNetScheduleAPIImpl::GetServerParams(), CMsvcSite::GetStandardFeatures(), CMsvcSite::GetThirdPartyLibsToInstall(), InsertList(), InsertListString(), CCgiUserAgent::IsBot(), CSmallDNS::IsValidIP(), CCompoundRWRegistry::LoadBaseRegistries(), CDataTool::LoadDefinitions(), CTemplateScoringMethod::LoadInfo(), CProjBulderApp::LoadProjectTags(), CCgiSession_NetCache::LoadSession(), NS_DecodeBitVector(), CStringPairs< TContainer >::Parse(), CPkl2hdf5Application::parse_pkl(), CRmOutReader::ParseRecord(), CBDB_ConfigStructureParser::ParseStructureLine(), CAlignFormatUtil::PrintTildeSepLines(), CNetScheduleHandler::ProcessGetJob(), CNetScheduleHandler::ProcessJobExchange(), CMsvcSite::ProcessMacros(), CNetScheduleHandler::ProcessWaitGet(), CPhrap_Read::ReadDS(), CPhrap_Contig::ReadTag(), CSearchHelper::ReadTaxFile(), CCgiRedirectApplication::RemapEntries(), CExec::ResolvePath(), CSystemPath::ResolvePathExisting(), CNSSubmitRemoteJobApp::Run(), CDemoContigAssemblyApp::Run(), s_CheckIdLookup(), s_ExtractKeys(), s_FindSubNode(), s_GBSeqStringCleanup(), s_ParseErrCodeInfoStr(), s_ParseParentQual(), s_ParseSubNodes(), SCmdLineArgListImpl::SCmdLineArgListImpl(), CUser_object::SetFieldRef(), CUser_field::SetFieldRef(), CEUtils_IdGroupSet::SetGroups(), CEUtils_IdGroup::SetIds(), CSelectionVisitor::SetSelectedObjectSig(), sReadAA_I(), sReadAA_M(), CFeatureTypesParser::StringToFeatTypes(), CFormatGuess::TestFormatDistanceMatrix(), CProjBulderApp::VerifyArguments(), CFindOverlapJob::x_CreateProjectItems(), CComponentSearchJob::x_DoSearch(), CMsvcProjectMakefile::x_GetHeaders(), CEditObjectDlg::x_GetSubObject(), CFeaturePanel::x_LoadSettings(), CDiagStrErrCodeMatcher::x_Parse(), CNetScheduleHandler::x_ParseTags(), CJob::x_ParseTags(), CNCBlobStorage::x_ParseTimestampParam(), and CGBSeqFormatter::x_StrOStreamToTextOStream().

bool NStr::SplitInTwo const string &  str,
const string &  delim,
string &  str1,
string &  str2
[static]
 

Split a string into two pieces using the specified delimiters.

Parameters:
str String to be split.
delim Delimiters used to split string "str".
str1 The sub-string of "str" before the first character of "delim". It will not contain any characters in "delim". Will be empty if "str" begin with a "delim" character.
str2 The sub-string of "str" after the first character of "delim" found. May contain "delim" characters. Will be empty if "str" had no "delim" characters or ended with the first "delim" charcter.
Returns:
true if a symbol from "delim" was found in "str", false if not. This lets you distinguish when there were no delimiters and when the very last character was the first delimiter.
See also:
Split, Tokenoze, TokenizePattern

Definition at line 1810 of file ncbistr.cpp.

References kEmptyStr, and NPOS.

Referenced by CRefArgs::AddDefinitions(), CMsvcConfigure::AnalyzeDefines(), CGetLoadProcessor::Authenticate(), CDB_ODBC_ConnParams::CDB_ODBC_ConnParams(), CDiagStrErrCodeMatcher::CDiagStrErrCodeMatcher(), CMsvcSite::CMsvcSite(), CReadCmdExecutor::Consider(), CRegistryFile::DeleteField(), CNetScheduleControl::FinalizeRead(), CGlBitmapFont::FromString(), NSnp::GetLength(), XSDParser::GetNextToken(), CMsvcSite::GetPlatformInfo(), SNetScheduleAPIImpl::GetServerParams(), CMsHdf5::getSpectrum(), CNetScheduleAdmin::GetWorkerNodes(), CProjBulderApp::Gui_ConfirmConfiguration(), CMsvc7RegSettings::IdentifyPlatform(), CCgiSession_NetCache::LoadSession(), CDiagStrErrCodeMatcher::Match(), NS_DecodeBitVector(), SNetScheduleAPIImpl::CNetScheduleServerListener::OnError(), operator>>(), CStringPairs< TContainer >::Parse(), CMaskFromFasta::ParseDataLine(), CDBUriConnParams::ParseParamPairs(), CRemoteAppDispatcher::ProcessRequest(), ReadMap(), CFeature_table_reader::ReadSequinFeatureTable(), CSystemPath::ResolvePath(), CGridWorkerNode::Run(), CNSSubmitRemoteJobApp::Run(), s_CheckValueForTID(), s_GetFallbackServer(), s_SplitKV(), s_SplitVersion(), CNetScheduleAdmin::StatusSnapshot(), StringToRange(), CNSInfoCollector::TraverseJobs(), CNetCacheServer::x_CreateStorages(), CDB_ODBC_ConnParams::x_MapPairToParam(), CDiagStrErrCodeMatcher::x_Parse(), CFeature_table_reader_imp::x_ParseTrnaString(), CReaderBase::x_SetBrowserRegion(), CGFFReader::x_SplitKeyValuePair(), and CSoapMessage::x_VerifyFaultObj().

CStringUTF8 NStr::SQLEncode const CStringUTF8 str  )  [static]
 

SQL-encode string.

There are some assumptions/notes about the function: 1. Only for MS SQL and Sybase. 2. Only for string values in WHERE and LIKE clauses. 3. The ' symbol must not be used as an escape symbol in LIKE clause. 4. It must not be used for non-string values. 5. It expects a string without any outer quotes, and it adds single quotes to the returned string. 6. It expects UTF-8 (including its subsets, ASCII and Latin1) or Win1252 string, and the input encoding is preserved.

Parameters:
str The string to encode
Returns:
Encoded string with added outer single quotes

Definition at line 2910 of file ncbistr.cpp.

bool NStr::StartsWith const string &  str,
char  start,
ECase  use_case = eCase
[inline, static]
 

Check if a string starts with a specified character value.

Parameters:
str String to check.
start Character value to check for.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase) while checking.

Definition at line 3496 of file ncbistr.hpp.

References eCase.

bool NStr::StartsWith const string &  str,
const char *  start,
ECase  use_case = eCase
[inline, static]
 

Check if a string starts with a specified prefix value.

Parameters:
str String to check.
start Prefix value to check for.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase) while checking.

Definition at line 3488 of file ncbistr.hpp.

References Compare().

bool NStr::StartsWith const string &  str,
const string &  start,
ECase  use_case = eCase
[inline, static]
 

Check if a string starts with a specified prefix value.

Parameters:
str String to check.
start Prefix value to check for.
use_case Whether to do a case sensitive compare(default is eCase), or a case-insensitive compare (eNocase) while checking.

Definition at line 3481 of file ncbistr.hpp.

References Compare().

Referenced by CPCRSetList::AddFwdName(), CPCRSetList::AddFwdSeq(), CPCRSetList::AddRevName(), CPCRSetList::AddRevSeq(), CTempTrackProxy::AddTempTrack(), BOOST_AUTO_TEST_CASE(), CAutoDefSatelliteClause::CAutoDefSatelliteClause(), CAutoDefTransposonClause::CAutoDefTransposonClause(), CCgiEntryReaderContext::CCgiEntryReaderContext(), CDBUriConnParams::CDBUriConnParams(), CNamespace::CNamespace(), CCgiTunnel2Grid::CollectParams(), CReaderServiceConnector::Connect(), ContainsSgml(), CPager::CPager(), SMakeProjectT::CreateDefines(), CNcbiEnvironment::Enumerate(), CNcbiEnvRegMapper::EnvToReg(), CSimpleEnvRegMapper::EnvToReg(), CValidError_CI::Filter(), GBenchBrowserConfig(), CReadBlastApp::getCoreDataType(), GetIntergenicSpacerClauseList(), GetParenLen(), CInferencePrefixList::GetPrefixAndRemainder(), CTestArguments::GetServerType(), CDbapiSampleApp::GetServerType(), CDbapiDriverSampleApp::GetServerType(), CAutoDefModifierCombo::GetSourceDescriptionString(), GetStdPath(), CNetScheduleAdmin::GetWorkerNodes(), CProjBulderApp::Gui_ConfirmConfiguration(), CSysLog::HonorRegistrySettings(), CProjectsLstFileFilter::InitFromFile(), CIdMapperConfig::Initialize(), CAutoDefIntergenicSpacerClause::InitWithString(), SMakeProjectT::IsConfigurableDefine(), CAutoDefFeatureClause::IsControlRegion(), CSymResolver::IsDefine(), SMakeProjectT::IsMakeAppFile(), SMakeProjectT::IsMakeDllFile(), SMakeProjectT::IsMakeLibFile(), CValidError_imp::IsNoncuratedRefSeq(), IsOnlinePub(), CPager::IsPagerCommand(), IsSpName(), IsSubdir(), SMakeProjectT::IsUserProjFile(), CGBProjectHandle::Load(), CWorkerNodeControlServer::MakeProcessor(), IsStandard::operator()(), operator>>(), ParseAttributes(), CQueue::PrepareFields(), CAutoDefFeatureClause_Base::PrintClause(), ProgramNameToEnum(), CDiagErrCodeInfo::Read(), SNetServerConnectionImpl::ReadCmdOutputLine(), CFeature_table_reader::ReadSequinFeatureTable(), CNcbiEnvRegMapper::RegToEnv(), s_AfterPrefix(), s_BadCharsInAuthorName(), s_ExtractSatelliteFromComment(), s_FilterPubdesc(), s_FindPathToGeneInfoFiles(), s_FindPathToWM(), s_FormatCBlastDBSeqID(), s_FormatCitGen(), s_GetCgiTunnel2GridUrl(), s_GetMakefileIncludes(), s_GetMiRNAProduct(), s_HasPrefix(), s_IsCommented(), s_IsCompoundRptTypeValue(), s_IsNcOrNt(), s_IsNoncuratedRefSeq(), s_IsValidPrimerSequence(), s_IsValidRpt_typeQual(), s_LocIsNmAccession(), s_MatchesBoundary(), s_ParseParentQual(), s_ParseTRnaFromAnticodonString(), s_RareConsensusNotExpected(), s_SpecialFlybaseIDs(), s_tRNAClauseFromNote(), s_tRNAGeneFromProduct(), SeqIdToIdentifier(), CGraphTrack::SetAnnot(), CGeneModelTrack::SetAnnot(), CFeatureTrack::SetAnnot(), CAlignmentTrack::SetAnnot(), CSeqUtils::SetAnnot(), CMultiReaderApp::SetFormat(), CFormatGuess::TestFormatBed(), CFormatGuess::TestFormatBed15(), CFormatGuess::TestFormatWiggle(), CFormatGuess::TestFormatXml(), CValidError_feat::ValidateCompareVal(), CValidError_feat::ValidateInference(), CValidError_bioseq::ValidateNsAndGaps(), CValidError_imp::ValidatePubGen(), CValidError_bioseq::ValidateSeqFeatContext(), CValidError_imp::ValidateSpecificHost(), CProjBulderApp::VerifyArguments(), CAutoDefModifierCombo::x_AddOrgModString(), CGridWorkerNode::x_AreMastersBusy(), CCleanup_imp::x_CleanupConsSplice(), CAutoDefFeatureClause::x_FindNoncodingFeatureKeywordProduct(), CCleanup_imp::x_FixPIDDbtag(), CDBSourceItem::x_GatherInfo(), CGeneFileWriter::x_Gene2Accn_ParseLine(), CGeneFileWriter::x_Gene2PM_ParseLine(), CGeneFileWriter::x_GeneInfo_ParseLine(), CAutoDefFeatureClause::x_GetFeatureTypeWord(), CNcbiTestApplication::x_GetTrimmedTestName(), CWinMaskConfig::x_GetWriter(), SegMaskerApplication::x_GetWriter(), CDustMaskApplication::x_GetWriter(), CReferenceItem::x_Init(), CGFFReader::x_IsLineUcscMetaInformation(), CTrackContainer::x_NeedToShow(), CReaderBase::x_ParseBrowserLine(), CGff3Reader::x_ParseBrowserLineToSeqEntry(), CFeature_table_reader_imp::x_ParseFeatureTableLine(), CReaderBase::x_ParseTrackLine(), CGff3Reader::x_ParseTrackLineToSeqEntry(), CFeature_table_reader_imp::x_ParseTrnaString(), CCgiRequest::x_ProcessInputStream(), CCleanup_imp::x_RemoveMarkedGeneXref(), CCleanup_imp::x_RemovePIDXrefs(), CGFFReader::x_ResolveNewSeqName(), CMasterContext::x_SetBaseName(), and CTar::x_ToArchiveName().

int NStr::strcasecmp const char *  s1,
const char *  s2
[inline, static]
 

Case-insensitive string compare.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
strcmp(), strncmp(), strncasecmp()

Definition at line 3254 of file ncbistr.hpp.

References strcasecmp.

Referenced by BDB_StringCaseCompare(), CompareNocase(), EqualNocase(), CNetScheduleHandler::ProcessLog(), and CAutoDefSourceGroup::x_SortDescriptions().

int NStr::strcmp const char *  s1,
const char *  s2
[inline, static]
 

String compare.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
strncmp(), strcasecmp(), strncasecmp()

Definition at line 3242 of file ncbistr.hpp.

References util::strcmp().

Referenced by CompareCase(), EqualCase(), XSDParser::IsAttribute(), XSDParser::IsValue(), SConstCharCompare::operator()(), CCgiApplication::PreparseArgs(), and CNCServerStat::x_GetSpanFigure().

size_t NStr::strftime char *  s,
size_t  maxsize,
const char *  format,
const struct tm *  timeptr
[inline, static]
 

Wrapper for the function strftime() that corrects handling D and T time formats on MS Windows.

Definition at line 3310 of file ncbistr.hpp.

References Replace(), and ReplaceInPlace().

Referenced by SDiagMessage::x_OldWrite().

bool NStr::StringToBool const string &  str  )  [static]
 

Convert string to bool.

Parameters:
str Boolean string value to be converted. Can recognize case-insensitive version as one of: 'true, 't', 'yes', 'y' for TRUE; and 'false', 'f', 'no', 'n' for FALSE.
Returns:
TRUE or FALSE.

Definition at line 1294 of file ncbistr.cpp.

References AStrEquiv(), and NCBI_THROW2.

Referenced by CPluginArgSet::AddDefaultArgument(), CArg_Boolean::CArg_Boolean(), CLDS_DataLoaderCF::CreateAndRegister(), CRegistryFile::FromConfigFile(), CMsvcMetaMakefile::GetPchInfo(), COptArg< bool >::Handle(), CCacheWriter::InitializeCache(), CCacheReader::InitializeCache(), CTestSettings::LoadCurrentSettings(), value_slice::CValueConvert< CP, const char * >::operator bool(), value_slice::CValueConvert< CP, string >::operator bool(), oligofar::COligoFarApp::ParseArg(), impl::CDriverContext::ResetEnvSybase(), CGeneModelConfig::UpdateSettings(), DTDParser::x_AttribValue(), CGraphTrack::x_LoadSettings(), and CEpigenomicsTrack::x_LoadSettings().

double NStr::StringToDouble const CTempStringEx str,
TStringToNumFlags  flags = 0
[static]
 

Convert string to double.

Parameters:
str String to be converted.
flags How to convert string to value. Do not support fAllowCommas flag.
Returns:
  • Convert "str" to "double" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 744 of file ncbistr.cpp.

References CTempString::data(), CTempStringEx::HasZeroAtEnd(), CTempString::size(), size, and StringToDoubleEx().

Referenced by CMsHdf5::addAttribute(), CPluginArgSet::AddDefaultArgument(), CUser_object::AddField(), CRunOfDigits::AddString(), CPluginValue::AsDouble(), CArg_Double::CArg_Double(), CGridCgiSampleApplication::CollectParams(), ASNParser::Double(), CFilteringArgs::ExtractAlgorithmOptions(), CRegistryFile::FromConfigFile(), CMsHdf5::getPrecursorMzs(), oligofar::CMappedAlignment::GetTagF(), CPhyTreeNode::Init(), NCBITEST_INIT_VARIABLES(), CHistConfigDlg::OnHeightUpdated(), CwxPhyloSettingsDlg::OnOkClick(), value_slice::CValueConvert< CP, const char * >::operator double(), value_slice::CValueConvert< CP, string >::operator double(), value_slice::CValueConvert< CP, const char * >::operator float(), value_slice::CValueConvert< CP, string >::operator float(), value_slice::CValueConvert< CP, const char * >::operator long double(), value_slice::CValueConvert< CP, string >::operator long double(), operator>>(), CPkl2hdf5Application::parse_pkl(), oligofar::COligoFarApp::ParseArg(), oligofar::CFaDiceApp::ParseArg(), CRmOutReader::ParseRecord(), CObjectIStreamAsn::ReadDouble(), CGlTestApplication::Render(), s_GetGeneDocsumWeight(), s_GetItem(), CCleanupAlignmentsParamsPanel::TransferDataFromWindow(), CFloatTextValidator::TransferFromWindow(), CFloatTextValidator::Validate(), CArgAllow_Doubles::Verify(), CArgAllowValuesBetween::Verify(), CArgAllowValuesLessThanOrEqual::Verify(), CArgAllowValuesGreaterThanOrEqual::Verify(), DTDParser::x_AttribValue(), CFindOverlapJob::x_CreateProjectItems(), CGl3dDemoUI::x_OnXRotChanged(), CGl3dDemoUI::x_OnYRotChanged(), CGl3dDemoUI::x_OnZRotChanged(), and CAnalysisFile::x_ReadDataLine().

double NStr::StringToDoubleEx const char *  str,
size_t  size,
TStringToNumFlags  flags = 0
[static]
 

This version accepts zero-terminated string.

Definition at line 681 of file ncbistr.cpp.

References _ASSERT, CHECK_ENDPTR, errno, eSkipAll, eSkipAllAllowed, eSkipSpacesOnly, fAllowLeadingSpaces, fAllowLeadingSymbols, fAllowTrailingSpaces, fAllowTrailingSymbols, fMandatorySign, kEmptyStr, pos, S2N_CONVERT_ERROR, S2N_CONVERT_ERROR_INVAL, s_DiffPtr(), and s_SkipAllowedSymbols().

Referenced by StringToDouble().

int NStr::StringToInt const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to int.

Parameters:
str String to be converted.
flags How to convert string to value.
base Radix base. Default is 10. Allowed values are 0, 2..32.
Returns:
  • Convert "str" to "int" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 407 of file ncbistr.cpp.

References CHECK_RANGE, errno, kMax_Int, kMin_Int, and StringToInt8().

Referenced by CSeqDB::AccessionToOids(), CMsHdf5::addAttribute(), CPluginArgSet::AddDefaultArgument(), CUser_object::AddField(), CPluginValue::AsInteger(), BOOST_AUTO_TEST_CASE(), CBlastDBSeqId::CBlastDBSeqId(), CPager::CPager(), CSubSource::DateFromCollectionDate(), CFormattingArgs::ExtractAlgorithmOptions(), CFilteringArgs::ExtractAlgorithmOptions(), find_unique_name(), CSeq_id_Giim_Tree::FindMatchStr(), CSeq_id_General_Tree::FindMatchStr(), CSeq_id_Gi_Tree::FindMatchStr(), CSeq_id_int_Tree::FindMatchStr(), CRegistryFile::FromConfigFile(), g_GetConfigInt(), CNetICacheClient::GetAccessTime(), CObjectIStreamAsn::GetChoiceIndex(), CPager::GetDisplayedPage(), NSnp::GetLength(), GetLocalID(), CObjectIStreamAsn::GetMemberIndex(), CIDs::GetNumber(), CPager::GetPageSize(), CDataLoaderFactory::GetPriority(), GetQueryBatchSize(), CMsvcProjectRuleMakefile::GetRulePriority(), SNetScheduleAPIImpl::GetServerParams(), CMsHdf5::getSpectrum(), oligofar::CMappedAlignment::GetTagI(), CNetScheduleAdmin::GetWorkerNodes(), CPhyTreeNode::Init(), InsertList(), CPager::IsPagerCommand(), CSpectrumSet::LoadMultDTA(), CId1FetchApp::LookUpFlatSeqID(), CDiagStrErrCodeMatcher::Match(), oligofar::CGuideFile::NextHit(), ASNParser::Number(), CCgiTunnel2Grid::OnEndProcessRequest(), CCgi2RCgiApp::OnEndProcessRequest(), CwxSeqMarkerSetDlg::OnOkClick(), CProjectLoadOptionPanel::OnRecentListLinkClicked(), value_slice::CValueConvert< CP, const char * >::operator Int1(), value_slice::CValueConvert< CP, string >::operator Int1(), value_slice::CValueConvert< CP, const char * >::operator Int2(), value_slice::CValueConvert< CP, string >::operator Int2(), value_slice::CValueConvert< CP, const char * >::operator Int4(), value_slice::CValueConvert< CP, string >::operator Int4(), operator>>(), CPkl2hdf5Application::parse_pkl(), oligofar::COligoFarApp::ParseArg(), oligofar::CFaDiceApp::ParseArg(), ParseAttributes(), XSDParser::ParseEnumeration(), ParseLex(), XSDParser::ParseMaxOccurs(), XSDParser::ParseMinOccurs(), oligofar::CSamSource::ParseSamLine(), CDBUriConnParams::ParseServer(), CNetScheduleHandler::ProcessMsgBatchHeader(), CConversionApp::Read(), readGFF3Gap(), CSearchHelper::ReadTaxFile(), CGBenchMonitorApp::Run(), CGi2TaxIdApp::Run(), CXcompareAnnotsApplication::Run(), CUpdateOmssaModApplication::Run(), s_AddFastMeSubtree(), s_ChrName(), s_ConvertFastMeTree(), s_ExtractFilteringAlgorithmIds(), s_GetChrAccession(), s_GetDetails(), s_GetFallbackServer(), s_GetRoundNumber(), s_ParseErrCodeInfoStr(), s_URLDecode(), SCigarAlignment::SCigarAlignment(), CMultiReaderApp::SetFlags(), CSGConfigUtils::SetFont(), CTaxIdSet::SetMappingFromFile(), CDiagContext::SetProperty(), sParseVersion(), SplitQuery_GetChunkSize(), SplitQuery_GetOverlapChunkSize(), StringToBool(), StringToRange(), CValidError_feat::ValidateGapFeature(), CFilterDialog::ViewToModel(), CFeature_table_reader_imp::x_AddQualifierToBioSrc(), CFeature_table_reader_imp::x_AddQualifierToCdregion(), CGridWorkerNode::x_AreMastersBusy(), DTDParser::x_AttribValue(), CSeqDBVol::x_CheckVersions(), oligofar::CGuideFile::x_CountMismatches(), CFindOverlapJob::x_CreateProjectItems(), CShowBlastDefline::x_DisplayDeflineTable(), CCpgSearchJob::x_DoSearch(), CSnpTableJob::x_FetchAll(), CGuideTreeCGIMap::x_FillNodeMapData(), CBlastHitMatrixCGIApplication::x_GetCGIContextParams(), CEntrez2ClientApp::x_GetLinkCounts(), CGlTexture::x_InitTexObj(), CFeaturePanel::x_LoadSettings(), CDB_ODBC_ConnParams::x_MapPairToParam(), CDiagStrErrCodeMatcher::x_Parse(), CSplitQueryTestFixture::x_ParseConfigLine(), CGlCgiImageApplication::x_PreProcess(), CCgiFontTestApp::x_PreProcess(), CReaderBase::x_SetBrowserRegion(), CMicroArrayReader::x_SetFeatureDisplayData(), CMicroArrayReader::x_SetFeatureLocation(), CUrl::x_SetPort(), CMicroArrayReader::x_SetTrackData(), and ASNParser::x_Type().

Int8 NStr::StringToInt8 const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to Int8.

Parameters:
str String to be converted.
flags How to convert string to value.
base Radix base. Default is 10. Allowed values are 0, 2..32.
Returns:
  • Convert "str" to "Int8" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 528 of file ncbistr.cpp.

References _ASSERT, CHECK_COMMAS, CHECK_ENDPTR, errno, eSkipAll, eSkipAllAllowed, eSkipSpacesOnly, fAllowLeadingSpaces, fAllowLeadingSymbols, fAllowTrailingSpaces, fAllowTrailingSymbols, fMandatorySign, IntToString(), kMax_I8, pos, S2N_CONVERT_ERROR_INVAL, S2N_CONVERT_ERROR_OVERFLOW, S2N_CONVERT_ERROR_RADIX, s_CheckRadix(), s_IsGoodCharForRadix(), and s_SkipAllowedSymbols().

Referenced by CSeqDB_NSeqsWalker::AddString(), CArg_Int8::CArg_Int8(), CBlastDBAliasApp::ConvertGiFile(), CSeqDBGiList::FindId(), CSeqDBNegativeList::FindId(), value_slice::CValueConvert< CP, const char * >::operator Int8(), value_slice::CValueConvert< CP, string >::operator Int8(), StringToInt(), StringToLong(), CArgAllow_Int8s::Verify(), and CWriteDB_IsamIndex::x_AddTraceIds().

long NStr::StringToLong const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to long.

Parameters:
str String to be converted.
flags How to convert string to value.
base Radix base. Default is 10. Allowed values are 0, 2..32.
Returns:
  • Convert "str" to "long" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 426 of file ncbistr.cpp.

References CHECK_RANGE, errno, and StringToInt8().

Referenced by BOOST_AUTO_TEST_CASE(), CSequenceGotoData::GetRange(), s_GetItem(), and CFeature_table_reader_imp::x_ParseFeatureTableLine().

int NStr::StringToNumeric const string &  str  )  [static]
 

Convert string to numeric value.

Parameters:
str String containing digits.
Returns:
  • Convert "str" to a (non-negative) "int" value and return this value.
  • -1 if "str" contains any symbols other than [0-9], or if it represents a number that does not fit into "int".

Definition at line 316 of file ncbistr.cpp.

References errno.

Referenced by CCleanup_imp::BasicCleanup(), CAgpRow::ParseComponentCols(), CAgpRow::ParseGapCols(), s_IsTokenPosInt(), and CNcbiDiag::StrToSeverityLevel().

const void * NStr::StringToPtr const string &  str  )  [static]
 

Convert string to pointer.

Parameters:
str String to be converted.
Returns:
Pointer value corresponding to its string representation.

Definition at line 1270 of file ncbistr.cpp.

Referenced by CPluginObject::PostRead(), and CDataLoaderFactory::x_GetObjectManager().

unsigned int NStr::StringToUInt const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to unsigned int.

Parameters:
str String to be converted.
flags How to convert string to value.
base Radix base. Default is 10. Allowed values are 0, 2..32.
Returns:
  • Convert "str" to "unsigned int" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 417 of file ncbistr.cpp.

References CHECK_RANGE_U, errno, kMax_UInt, and StringToUInt8().

Referenced by CSeqDB_MembBitWalker::AddString(), CSeqDB_MaxLengthWalker::AddString(), CDebugDumpViewer::Bpt(), CNetScheduleAdmin::CountActiveJobs(), CSQLITE3_BlobCacheCF::CreateInstance(), CSeqMaskerIstatAscii::CSeqMaskerIstatAscii(), FormatHostName(), CContElemConverter< CCgiEntry >::FromString(), CSpanTableSettingsDialog::GetThreshold(), CNetICacheClient::GetTimeout(), CAutoDefFeatureClause_Base::GroupConsecutiveExons(), CCleanupApp::HandleSeqID(), CAsn2FlatApp::HandleSeqID(), CAsn2FastaApp::HandleSeqID(), CNetICacheClient::IsOpen(), make_server(), NS_DecodeBitVector(), value_slice::CValueConvert< CP, const char * >::operator Uint1(), value_slice::CValueConvert< CP, string >::operator Uint1(), value_slice::CValueConvert< CP, const char * >::operator Uint2(), value_slice::CValueConvert< CP, string >::operator Uint2(), value_slice::CValueConvert< CP, const char * >::operator Uint4(), value_slice::CValueConvert< CP, string >::operator Uint4(), operator>>(), CArgs::operator[](), CMaskFromFasta::ParseDataLine(), CRmOutReader::ParseRecord(), CDistanceMatrix::Read(), CWig2tableApplication::ReadFixedStep(), CWig2tableApplication::ReadVariableStep(), CGridWorkerNode::Run(), CNSSubmitRemoteJobApp::Run(), CDemoContigAssemblyApp::Run(), MzXmlReader::start_element(), CNetScheduleAdmin::StatusSnapshot(), CNCMessageHandler::x_AssignCmdParams(), CFindOverlapJob::x_CreateProjectItems(), and CAnalysisFileLoader::x_ReadData().

Uint8 NStr::StringToUInt8 const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to Uint8.

Parameters:
str String to be converted.
flags How to convert string to value.
base Radix base. Default is 10. Allowed values are 0, 2..32.
Returns:
  • Convert "str" to "UInt8" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 609 of file ncbistr.cpp.

References _ASSERT, CHECK_COMMAS, CHECK_ENDPTR, errno, eSkipAll, eSkipAllAllowed, eSkipSpacesOnly, fAllowLeadingSpaces, fAllowLeadingSymbols, fAllowTrailingSpaces, fAllowTrailingSymbols, fMandatorySign, IntToString(), kMax_UI8, pos, S2N_CONVERT_ERROR_INVAL, S2N_CONVERT_ERROR_OVERFLOW, S2N_CONVERT_ERROR_RADIX, s_CheckRadix(), s_IsGoodCharForRadix(), and s_SkipAllowedSymbols().

Referenced by CSeqDB_TotalLengthWalker::AddString(), value_slice::CValueConvert< CP, const char * >::operator Uint8(), value_slice::CValueConvert< CP, string >::operator Uint8(), SDiagMessage::ParseMessage(), StringToUInt(), StringToUInt8_DataSize(), StringToULong(), and CDebugDumpViewer::x_StrToPtr().

Uint8 NStr::StringToUInt8_DataSize const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to number of bytes.

String can contain "software" qualifiers: MB(megabyte), KB (kilobyte).. Example: 100MB, 1024KB Note the qualifiers are power-of-2 based, aka kibi-, mebi- etc, so that 1KB = 1024B (not 1000B), 1MB = 1024KB = 1048576B, etc.

Parameters:
str String to be converted.
flags How to convert string to value.
base Numeric base of the number (before the qualifier). Default is 10. Allowed values are 0, 2..20.
Returns:
  • Convert "str" to "Uint8" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 816 of file ncbistr.cpp.

References _ASSERT, CHECK_ENDPTR, CTempString::data(), errno, eSkipAll, eSkipAllAllowed, eSkipSpacesOnly, fAllowCommas, fAllowLeadingSpaces, fAllowLeadingSymbols, fAllowTrailingSpaces, fAllowTrailingSymbols, fMandatorySign, IntToString(), CTempString::length(), pos, S2N_CONVERT_ERROR_INVAL, S2N_CONVERT_ERROR_RADIX, s_CheckRadix(), s_DataSizeConvertQual(), s_IsGoodCharForRadix(), s_SkipAllowedSymbols(), and StringToUInt8().

Referenced by CNetCacheServer::CNetCacheServer(), and SQueueParameters::Read().

unsigned long NStr::StringToULong const CTempString str,
TStringToNumFlags  flags = 0,
int  base = 10
[static]
 

Convert string to unsigned long.

Parameters:
str String to be converted.
flags How to convert string to value.
base Numeric base of the number symbols (default = 10).
Returns:
  • Convert "str" to "unsigned long" value and return it.
  • 0 if "str" contains illegal symbols, or if it represents a number that does not fit into range, and flag fConvErr_NoThrow is set.
  • Throw an exception otherwise.

Definition at line 437 of file ncbistr.cpp.

References CHECK_RANGE_U, errno, and StringToUInt8().

Referenced by CNetScheduleAdmin::Count(), CNetCacheAPI::GetBlobSize(), CNetICacheClient::GetSize(), and CDebugDumpViewer::x_StrToPtr().

int NStr::strncasecmp const char *  s1,
const char *  s2,
size_t  n
[inline, static]
 

Case-insensitive string compare upto specfied number of characters.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
strcmp(), strcasecmp(), strcasecmp()

Definition at line 3281 of file ncbistr.hpp.

References strncasecmp.

Referenced by s_DumpHeader(), and s_NoCaseEqual().

int NStr::strncmp const char *  s1,
const char *  s2,
size_t  n
[inline, static]
 

String compare upto specified number of characters.

Parameters:
s1 String to be compared -- operand 1.
s2 String to be compared -- operand 2.
n Number of characters in string
Returns:
  • 0, if s1 == s2.
  • Negative integer, if s1 < s2.
  • Positive integer, if s1 > s2.
See also:
strcmp(), strcasecmp(), strncasecmp()

Definition at line 3248 of file ncbistr.hpp.

References util::strncmp().

Referenced by CNetCacheServerListener::OnError(), and CNetCacheKey::x_ParseBlobKey().

vector< string > & NStr::Tokenize const string &  str,
const string &  delim,
vector< string > &  arr,
EMergeDelims  merge = eNoMergeDelims,
vector< SIZE_TYPE > *  token_pos = NULL
[static]
 

Tokenize a string using the specified set of char delimiters.

Parameters:
str String to be tokenized.
delim Set of char delimiters used to tokenize string "str". If delimiter is empty, then input string is appended to "arr" as is.
arr The tokens defined in "str" by using symbols from "delim" are added to the list "arr" and also returned by the function.
merge Whether to merge the delimiters or not. The default setting of eNoMergeDelims means that delimiters that immediately follow each other are treated as separate delimiters.
token_pos Optional array for the tokens' positions in "str".
Returns:
The list "arr" is also returned.
See also:
Split, TokenizePattern, TokenizeInTwo

Definition at line 1652 of file ncbistr.cpp.

References kEmptyStr.

Referenced by CPCRSetList::AddFwdName(), CPCRSetList::AddFwdSeq(), CPCRSetList::AddRevName(), CPCRSetList::AddRevSeq(), SAccGuide::AddRule(), AgpRead(), BOOST_AUTO_TEST_CASE(), CDB_ODBC_ConnParams::CDB_ODBC_ConnParams(), CGridCgiSampleApplication::CollectParams(), CDBUniversalMapper::ConfigureFromRegistry(), CDBUDPriorityMapper::ConfigureFromRegistry(), CDBUDRandomMapper::ConfigureFromRegistry(), CBlastDBAliasApp::CreateAliasFile(), CAgpRow::FromString(), GetIntergenicSpacerClauseList(), NSnp::GetLength(), CNetBLASTLoadOptionPanel::GetRIDs(), CShowBlastDefline::GetSeqIdList(), CGenBankLoadOptionPanel::GetSeqIds(), impl::CRowInfo_SP_SQL_Server::Initialize(), CId1FetchApp::LookUpFlatSeqID(), operator>>(), ParseAttributes(), CDBUriConnParams::ParseParamPairs(), CSGConfigUtils::ParseProfileString(), ParseSequenceRange(), STrackSettings::ParseSettings(), CNamedPipeDefClient::Process(), ReadContainer(), readGFF3Gap(), ReadMap(), CGridWorkerNode::Run(), CXcompareAnnotsApplication::Run(), s_ChoiceType(), s_ExpandThisQual(), s_IsValidRpt_typeQual(), s_ProcessInstitutionCollectionCodeLine(), s_SeqDB_TryPaths(), SSnpFilter::SerializeFrom(), CGridDebugContext::SetExecuteList(), CNetSchedule_AccessList::SetHosts(), CDbTest::Test(), CFormatGuess::TestFormatBed(), CFormatGuess::TestFormatBed15(), CFormatGuess::TestFormatTextAsn(), CGeneInfo::ToString(), CValidError_feat::ValidateExceptText(), CValidError_feat::ValidateInference(), CBlastTabularInfo::x_AddDefaultFieldsToShow(), CMakeBlastDBApp::x_BuildDatabase(), CCleanup_imp::x_CleanupExcept_text(), CBLAST_DB_Dialog::x_CreateItems(), CGBDataLoader::x_CreateReaders(), CGBDataLoader::x_CreateWriters(), CGeneFileWriter::x_Gene2Accn_ParseLine(), CGeneFileWriter::x_Gene2PM_ParseLine(), CGeneFileWriter::x_GeneInfo_ParseLine(), CODBC_Connection::x_GetDriverName(), CBlastDBCmdApp::x_GetQueries(), CCgiTunnel2Grid::x_Init(), CCgi2RCgiApp::x_Init(), CGlTexture::x_InitTexObj(), CFeaturePanel::x_LoadTrackSettingsRecursive(), CGFFReader::x_ParseAlignRecord(), CReaderBase::x_ParseBrowserLine(), CGff3Reader::x_ParseBrowserLineToSeqEntry(), CSplitQueryTestFixture::x_ParseConfigLine(), CMicroArrayReader::x_ParseFeature(), CFeature_table_reader_imp::x_ParseFeatureTableLine(), CGFFReader::x_ParseV3Attributes(), CAnalysisFile::x_ReadColumnHeaders(), CAnalysisFile::x_ReadDataLine(), CString2Args::x_TokenizeCmdLine(), CFilteringArgs::x_TokenizeFilteringArgs(), and CGenBankLoadOptionPanel::x_ValidateInput().

vector< string > & NStr::TokenizePattern const string &  str,
const string &  delim,
vector< string > &  arr,
EMergeDelims  merge = eNoMergeDelims,
vector< SIZE_TYPE > *  token_pos = NULL
[static]
 

Tokenize a string using the specified delimiter (string).

Parameters:
str String to be tokenized.
delim Delimiter used to tokenize string "str". If delimiter is empty, then input string is appended to "arr" as is.
arr The tokens defined in "str" by using delimeter "delim" are added to the list "arr" and also returned by the function.
merge Whether to merge the delimiters or not. The default setting of eNoMergeDelims means that delimiters that immediately follow each other are treated as separate delimiters.
token_pos Optional array for the tokens' positions in "str".
Returns:
The list "arr" is also returned.
See also:
Split, Tokenize

Definition at line 1739 of file ncbistr.cpp.

static void NStr::ToLower const char *   )  [static, private]
 

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

char * NStr::ToLower char *  str  )  [static]
 

Convert string to lower case -- char* version.

Parameters:
str String to be converted.
Returns:
Lower cased string.

Definition at line 278 of file ncbistr.cpp.

string & NStr::ToLower string &  str  )  [static]
 

Convert string to lower case -- string& version.

Parameters:
str String to be converted.
Returns:
Lower cased string.

Definition at line 288 of file ncbistr.cpp.

References NON_CONST_ITERATE.

Referenced by CCleanup_imp::BasicCleanup(), BDB_CreateEnv(), CAlignFormatUtil::BuildFormatQueryString(), CFlatSubSourcePrimer::CFlatSubSourcePrimer(), CTextUtil::CleanJournalTitle(), CBlastOptionsBuilder::ComputeProgram(), CBlastOptionsFactory::CreateTask(), CShowBlastDefline::Display(), CBlastOptionsFactory::GetDocumentation(), CSubSource::GetSubtypeValue(), COrgMod::GetSubtypeValue(), CImageIO::GetTypeFromFileName(), CShowBlastDefline::Init(), CNamedPipeDefClient::Process(), ProgramNameToEnum(), CGridWorkerNode::Run(), s_IsValidSexQualifierValue(), s_PolicyFromMeta(), s_ResetLibInstallKey(), s_UnpackUserField(), impl::CDBConnParamsBase::SetParam(), CReadInSkipObjectHook< Object >::SkipObject(), CCleanup_imp::x_CleanupRptUnit(), CNetCacheServer::x_CreateStorages(), CConvert2BlastMaskApplication::x_GetWriter(), CDll::x_Init(), CCleanup_imp::x_SubtypeCleanup(), and CDeflineGenerator::x_TitleFromNC().

static void NStr::ToUpper const char *   )  [static, private]
 

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

char * NStr::ToUpper char *  str  )  [static]
 

Convert string to upper case -- char* version.

Parameters:
str String to be converted.
Returns:
Upper cased string.

Definition at line 297 of file ncbistr.cpp.

string & NStr::ToUpper string &  str  )  [static]
 

Convert string to upper case -- string& version.

Parameters:
str String to be converted.
Returns:
Upper cased string.

Definition at line 307 of file ncbistr.cpp.

References NON_CONST_ITERATE.

Referenced by CBoyerMooreMatcher::AddDelimiters(), CSeqSearch::AddNucleotidePattern(), CTextFsm< MatchType >::AddWord(), BlastFindMatrixPath(), CBlastFormatUtil::BlastGetVersion(), CAlignFormatUtil::BuildFormatQueryString(), python::CConnection::CConnection(), CSubstMatrix::CSubstMatrix(), DateToString(), CPkgManager::DependsOn(), CLDS_Object::GetAnnotInfo(), CPkgManager::GetBasePkgs(), CPkgManager::GetDependentPkgs(), GetEnvVarName(), CLDS_DataLoader::GetRecords(), CMSHits::MakePepString(), CPhrap_Seq::ReadData(), s_FormatCitBook(), s_GetDescription(), CLDS_Object::SaveObject(), CPkgManager::SetAppPkg(), CBoyerMooreMatcher::SetWordDelimiters(), CEnvironmentRegistry::x_Get(), CPkgManager::x_GetBasePkgs(), SDiagMessage::x_GetModule(), CGFFFormatter::x_GetSourceName(), CBoyerMooreMatcher::x_InitPattern(), CPkgManager::x_LoadPackage(), CBlastFormat::x_PrintTabularReport(), CPssmEngine::x_PSIMatrix2Asn1(), CAppNWA::x_ReadFastaFile(), CEnvironmentRegistry::x_Set(), and CPkgManager::x_ValidatePackage().

CTempString NStr::TruncateSpaces const char *  str,
ETrunc  where = eTrunc_Both
[static]
 

Definition at line 1475 of file ncbistr.cpp.

References s_TruncateSpaces().

CTempString NStr::TruncateSpaces const CTempString str,
ETrunc  where = eTrunc_Both
[static]
 

Definition at line 1470 of file ncbistr.cpp.

References s_TruncateSpaces().

string NStr::TruncateSpaces const string &  str,
ETrunc  where = eTrunc_Both
[static]
 

Truncate spaces in a string.

Parameters:
str String to truncate spaces from.
where Which end of the string to truncate space from. Default is to truncate space from both ends (eTrunc_Both).

Definition at line 1465 of file ncbistr.cpp.

References kEmptyStr, and s_TruncateSpaces().

Referenced by CSimpleMakeFileContents::SParser::AcceptLine(), CRefArgs::AddDefinitions(), CSeqSearch::AddNucleotidePattern(), CNcbiResourceInfoFile::AddResourceInfo(), CAlignFormatUtil::BuildFormatQueryString(), CDirEntry::ConcatPath(), CDirEntry::ConcatPathEx(), IRegistry::EnumerateEntries(), CFormattingArgs::ExtractAlgorithmOptions(), CGlBitmapFont::FromString(), CCodeGenerator::GenerateCvsignore(), IRegistry::Get(), IRegistry::GetComment(), CFeedbackWizard::GetReport(), CSubSource::GetSubtypeValue(), COrgMod::GetSubtypeValue(), IRegistry::HasEntry(), CRmOutReader::IsIgnoredLine(), CFormatGuess::IsInputRepeatMaskerWithoutHeader(), CColumnScoringMethod::Load(), CColorTableMethod::Load(), oligofar::CSolexaFileReader::NextRead(), oligofar::CColFileReader::NextRead(), CCgiTunnel2Grid::OnBeginProcessRequest(), CCgi2RCgiApp::OnBeginProcessRequest(), CSeqTextPanel::OnFindBwdClick(), CSeqTextPanel::OnFindFwdClick(), WizardPage2::OnProblemPageChanging(), CPkl2hdf5Application::parse_pkl(), CMaskFromFasta::ParseDataLine(), CSeq_id::ParseFastaIds(), CRmOutReader::ParseRecord(), CQueue::PrepareFields(), CDistanceMatrix::Read(), oligofar::CFeatMap::ReadFile(), CBlastInputReader::ReadOneSeq(), CMicroArrayReader::ReadSeqAnnot(), CGridWorkerNode::Run(), CGi2TaxIdApp::Run(), s_GeneCommentaryToLocations(), s_GetMakefileIncludes(), s_ParseErrCodeInfoStr(), s_SplitKV(), CTextseq_id::Set(), CSeq_id::Set(), IRWRegistry::Set(), IRWRegistry::SetComment(), CGridDebugContext::SetExecuteList(), CTaxIdSet::SetMappingFromFile(), CFeatureTypesParser::StringToFeatTypes(), CFormatGuess::TestFormatBed(), CFormatGuess::TestFormatBed15(), MzXmlReader::text(), CNetworkOptionsPage::TransferDataFromWindow(), CValidError_feat::ValidateExceptText(), CCompartApp::x_DoWithExternalHits(), CCgiUserAgent::x_Parse(), CSplitQueryTestFixture::x_ParseConfigLine(), IRWRegistry::x_Read(), x_ResolveExisting(), CPhrapReader::x_SkipTag(), and CPkgManager::x_ValidatePackage().

void NStr::TruncateSpacesInPlace string &  str,
ETrunc  where = eTrunc_Both
[static]
 

Truncate spaces in a string (in-place).

Parameters:
str String to truncate spaces from.
where Which end of the string to truncate space from. Default is to truncate space from both ends (eTrunc_Both).

Definition at line 1481 of file ncbistr.cpp.

References _ASSERT, eTrunc_Begin, eTrunc_Both, eTrunc_End, and kEmptyStr.

Referenced by CQueueClientInfoList::AddClientInfo(), CAutoDefGeneClusterClause::CAutoDefGeneClusterClause(), CAutoDefTransposonClause::CAutoDefTransposonClause(), CDB_ODBC_ConnParams::CDB_ODBC_ConnParams(), CFlatStringQVal::CFlatStringQVal(), CFormatQual::CFormatQual(), CleanString(), GenomeByOrganelle(), CDataType::GetBoolVar(), CNetScheduleAdmin::GetWorkerNodes(), CProjBulderApp::Gui_ConfirmConfiguration(), CProjectsLstFileFilter::InitFromFile(), CIdMapperConfig::Initialize(), CAutoDefIntergenicSpacerClause::InitWithString(), CFormatGuess::IsInputRepeatMaskerWithHeader(), CAnalysisFile::Load(), CSeqGraphicWidget::OnAddTrack(), CSnpFilterUI::OnButtonImportClick(), CSeqGraphicWidget::OnCloneTrack(), XSDParser::ParseEnumeration(), CDBUriConnParams::ParseParamPairs(), CValidError_imp::PostBadDateError(), CObjectIStreamXml::ReadBool(), CNSRemoveJobControlApp::Run(), s_GBSeqStringCleanup(), s_ParseTRnaFromAnticodonString(), s_SplitMLAuthorName(), s_StringToOrgMod(), s_StringToSubSource(), s_tRNAClauseFromNote(), CSelectionVisitor::SetSelectedObjectSig(), CFormatGuess::TestFormatXml(), CSerialStringListValidator::TransferFromWindow(), CSerialTextValidator::TransferFromWindow(), CValidError_imp::ValidateAuthorList(), CValidError_feat::ValidateInference(), CValidError_feat::ValidateInferenceAccession(), CReferenceItem::x_CleanData(), CCleanup_imp::x_CleanupExcept_text(), CAutoDefModifierCombo::x_CleanUpTaxName(), CCleanup_imp::x_CleanupUserString(), CAutoDefFeatureClause::x_FindNoncodingFeatureKeywordProduct(), CSeq_id::x_Init(), CFeaturePanel::x_LoadSettings(), CDB_ODBC_ConnParams::x_MapPairToParam(), CAnalysisFile::x_ReadColumnHeaders(), CWiggleReader::x_ReadLine(), CGff3Reader::x_ReadLine(), and CCleanup_imp::x_RemoveAsn2ffGeneratedComments().

void NStr::UInt8ToString string &  out_str,
Uint8  value,
TNumToStringFlags  flags = 0,
int  base = 10
[static]
 

Convert UInt8 to string.

Parameters:
out_str Output string variable
value Integer value (UInt8) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.

Definition at line 1157 of file ncbistr.cpp.

References _ASSERT, buffer, CHAR_BIT, fWithSign, pos, and s_PrintUint8().

string NStr::UInt8ToString Uint8  value,
TNumToStringFlags  flags = 0,
int  base = 10
[static]
 

Convert UInt8 to string.

Parameters:
value Integer value (UInt8) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.
Returns:
Converted string value.

Definition at line 1149 of file ncbistr.cpp.

Referenced by CObjFingerprint::AddInteger(), CSQLITE_Connection::CreateVacuumStmt(), CBZip2Compression::FormatErrorMessage(), CBlastDbMetadata::GetDbLength(), CBDB_FieldUint8::GetString(), CDebugDumpContext::Log(), CRegionMap::MapMmap(), value_slice::CValueConvert< CP, Uint8 >::operator string(), CQuickStrStream::operator<<(), CAsnElementPrimitive::RenderValue(), CDB_MultiEx::ReportErrorStack(), s_ComposeNameExtra(), s_Dump(), s_DumpHeader(), s_ParseErrCodeInfoStr(), s_ValToString(), CFileIO::SetFileSize(), CSeqDBAtlas::ShowLayout(), CLocMapper_Default::CGappedRange::ToString(), CBDB_FieldUint8::ToString(), CStackTrace::Write(), CNCBlob::Write(), CObjectOStreamJson::WriteUint8(), CNCMessageHandler::x_FinishReadingBlob(), and CBlastDBCmdApp::x_PrintBlastDatabaseInformation().

void NStr::UIntToString string &  out_str,
unsigned long  value,
TNumToStringFlags  flags = 0,
int  base = 10
[static]
 

Convert UInt to string.

Parameters:
out_str Output string variable
value Integer value (unsigned long) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.

Definition at line 951 of file ncbistr.cpp.

References _ASSERT, buffer, CHAR_BIT, fWithCommas, fWithSign, pos, and s_Hex.

string NStr::UIntToString unsigned long  value,
TNumToStringFlags  flags = 0,
int  base = 10
[inline, static]
 

Convert UInt to string.

Parameters:
value Integer value (unsigned long) to be converted.
flags How to convert value to string.
base Radix base. Default is 10. Allowed values are 2..32. Bases 8 and 16 do not add leading '0' and '0x' accordingly. If necessary you should add it yourself.
Returns:
Converted string value.

Definition at line 3215 of file ncbistr.hpp.

Referenced by CBDB_ExtBlobMap::Add(), SNetICacheClientImpl::AddKVS(), CTaxNRCriteria::Apply(), CWorkerNode::AsString(), SServerAddress::AsString(), CObjectIStreamAsn::BadStringChar(), CArgDescMandatory::CArgDescMandatory(), CGridDebugContext::CGridDebugContext(), ToStr< unsigned int >::Convert(), SBDB_CacheUnitStatistics::ConvertToRegistry(), CParseTemplException< CSeqsetException >::CParseTemplException(), CTrackCreatorUI::Create(), CBDB_Volumes::Delete(), CGridDebugContext::DumpInput(), CGridDebugContext::DumpOutput(), CGridDebugContext::DumpProgressMessage(), CBDB_Cache::EvaluateTimeLine(), CRemoteAppLauncher::ExecRemoteApp(), CObjectIStreamAsnBinary::ExpectShortLength(), CAlignmentRefiner::ExtractBEArgs(), CAlignmentRefiner::ExtractLOOArgs(), CBDB_Volumes::FetchVolumeRec(), CBitVectorEncoder::FlushRange(), CZipCompression::FormatErrorMessage(), CGenbankFormatter::FormatGap(), CNetCacheKey::GenerateBlobKey(), CTimeout::GetAsMilliSeconds(), CTimeout::GetAsTimeSpan(), CBDB_ExtBlobMap::GetBlobLoc(), CPrimitiveTypeInfo::GetIntegerTypeInfo(), CDirEntry::GetOwner(), SNSDBEnvironmentParams::GetParamValue(), SNS_Parameters::GetParamValue(), CObjectOStreamXml::GetPosition(), CObjectOStreamJson::GetPosition(), CObjectOStreamAsn::GetPosition(), CObjectIStreamXml::GetPosition(), CObjectIStreamAsn::GetPosition(), CBDB_FieldUint4::GetString(), CBDB_FieldUint1::GetString(), CBDB_FieldInt1::GetString(), CAlignGlyph::GetTitle(), CTranslationGlyph::GetTooltip(), CFeatGlyph::GetTooltip(), CSeqDBIsam::HashToOids(), CDiscreteDistribution::InitFromParameter(), SNetICacheClientImpl::InitiateStoreCmd(), CBDB_Volumes::LockVolume(), CDebugDumpContext::Log(), CBDB_BlobSplitStore< TBV, TObjDeMux, TL >::MakeDbFileName(), CCdAnnotationInfo::MakeRowInfoString(), SNetScheduleAPIImpl::CNetScheduleServerListener::MakeWorkerNodeInitCmd(), CCdAnnotationInfo::MappedToSlaveString(), NS_EncodeBitVector(), CBDB_Cache::Open(), value_slice::CValueConvert< CP, Uint4 >::operator string(), value_slice::CValueConvert< CP, Uint2 >::operator string(), value_slice::CValueConvert< CP, Uint1 >::operator string(), CWNodeShutdownAction::operator()(), operator<<(), CQuickStrStream::operator<<(), CObjectIStreamAsnBinary::PeekTag(), CRowSelector::Print(), CCdFromFasta::Fasta2CdParams::Print(), CRowSelector::PrintSequence(), CArgDesc::PrintXml(), CNetScheduleHandler::ProcessActiveCount(), CNetScheduleHandler::ProcessMsgBatchSubmit(), CNetScheduleHandler::ProcessReading(), CNetScheduleHandler::ProcessStatusSnapshot(), CBDB_Cache::Purge(), CNetScheduleSubmitter::Read(), CObjectIStreamAsnBinary::ReadDouble(), CObjectIStreamAsn::ReadDouble(), CObjectIStreamXml::ReadName(), SNetICacheClientImpl::RegisterUnregisterSession(), CNSInfoRenderer::RenderQueueList(), ReplaceVisibleChar(), s_AddressAsString(), s_AgpWrite(), s_LOCK_Handler(), s_LogSubmit(), s_MajorMinor(), s_MakeUniqueLocalId(), s_UserGroupAsString(), s_ValToString(), CBDB_Volumes::SetBackupLocation(), CBDB_Volumes::SetDateRange(), CBlobStoreBase::SetTextSizeServerSide(), CSpanTableSettingsDialog::SetThreshold(), CSeqDBIsam::SimplifySeqid(), CObjectIStreamAsnBinary::SkipFNumber(), CObjectIStreamAsn::SkipSNumber(), CObjectIStreamAsn::SkipUNumber(), CBDB_Volumes::SortVolumes(), CBDB_ExtBlobStore< TBV >::StoreBlob(), CQueue::SubmitBatch(), CNetScheduleSubmitter::SubmitJobBatch(), CContElemConverter< CCgiEntry >::ToString(), CBDB_FieldUint4::ToString(), CObjectIStreamAsn::UnendedString(), CObjectIStreamAsnBinary::UnexpectedTagClassByte(), CLockVectorGuard< TLockVect >::Unlock(), CBDB_Volumes::UnLockVolume(), CNetScheduleExecuter::WaitJob(), CDB_MultiEx::WhatThis(), CObjectOStreamJson::WriteCustomBytes(), CObjectOStreamJson::WriteUint4(), CSegmentMapTrack::x_AddSegmentMapLayout(), CBDB_Volumes::x_ChangeCurrentStatus(), IRemoteAppRequest_Impl::x_CreateWDir(), CCdsGlyph::x_GetExtraInfo(), CSeqMarkHandler::x_GetText(), CBinsGlyph::x_GetTooltipCITED(), CBinsGlyph::x_GetTooltipCLIN(), CNCBlobStorage::x_LockInstanceGuard(), CNetScheduleHandler::x_MakeGetAnswer(), CSettingsSet::x_MakeUniqueStyleKey(), CSettingsSet::x_MakeUniqueStyleName(), CGraphTrack::x_OnJobCompleted(), CTransmissionReader::x_ReadStart(), CNetScheduleHandler::x_StatisticsNew(), CBDB_Cache::x_Store(), CValidError_align::x_ValidateDendiag(), CValidError_align::x_ValidateSeqLength(), and CValidError_align::x_ValidateStd().

string NStr::URLDecode const string &  str,
EUrlDecode  flag = eUrlDec_All
[static]
 

URL-decode string.

Definition at line 2976 of file ncbistr.cpp.

References s_URLDecode().

Referenced by CCgiCookies::Add(), CStringDecoder_Url::Decode(), CDefaultUrlEncoder::DecodeArgName(), CDefaultUrlEncoder::DecodeArgValue(), CDefaultUrlEncoder::DecodeFragment(), CDefaultUrlEncoder::DecodePath(), ReadContainer(), ReadMap(), URL_DecodeString(), and CNCMessageHandler::x_AssignCmdParams().

void NStr::URLDecodeInPlace string &  str,
EUrlDecode  flag = eUrlDec_All
[static]
 

URL-decode string to itself.

Definition at line 2984 of file ncbistr.cpp.

References s_URLDecode().

Referenced by CGenBankUILoadManager::LoadSettings(), and URL_DecodeInPlace().

string NStr::URLEncode const string &  str,
EUrlEncode  flag = eUrlEnc_SkipMarkChars
[static]
 

URL-encode string.

Definition at line 2831 of file ncbistr.cpp.

References _TROUBLE, eUrlEnc_None, eUrlEnc_Path, eUrlEnc_PercentOnly, eUrlEnc_ProcessMarkChars, eUrlEnc_SkipMarkChars, eUrlEnc_URIFragment, eUrlEnc_URIHost, eUrlEnc_URIPath, eUrlEnc_URIQueryName, eUrlEnc_URIQueryValue, eUrlEnc_URIScheme, eUrlEnc_URIUserinfo, kEmptyStr, and len.

Referenced by CEUtils_IdGroup::AsQueryString(), CAlignFormatUtil::BuildFormatQueryString(), CGI2GRID_ComposeHtmlPage(), CStringEncoder_Url::Encode(), CDefaultUrlEncoder::EncodeArgName(), CDefaultUrlEncoder::EncodeArgValue(), CDefaultUrlEncoder::EncodeFragment(), CDefaultUrlEncoder::EncodePath(), CESpell_Request::GetQueryString(), CESearch_Request::GetQueryString(), CELink_Request::GetQueryString(), CEGQuery_Request::GetQueryString(), CGridCgiContext::GetSelfURL(), s_AssignEntryValue(), CGenBankUILoadManager::SaveSettings(), CEncodedString::SetString(), URL_EncodeString(), CCgiCookie::Write(), WriteContainer(), WriteMap(), and CNcbiResourceInfo::x_GetEncoded().

list< string > & NStr::Wrap const string &  str,
SIZE_TYPE  width,
list< string > &  arr,
TWrapFlags  flags,
const string &  prefix,
const string &  prefix1
[inline, static]
 

Wrap the specified string into lines of a specified width.

Split string "str" into lines of width "width" and add the resulting lines to the list "arr". Normally, all lines will begin with "prefix" (counted against "width"), but the first line will instead begin with "prefix1" if you supply it.

Parameters:
str String to be split into wrapped lines.
width Width of each wrapped line.
arr List of strings containing wrapped lines.
flags How to wrap the words to a new line. See EWrapFlags documentation.
prefix The prefix string added to each wrapped line, except the first line, unless "prefix1" is set. If "prefix" is set to 0, do not add a prefix string to the wrapped lines.
prefix1 The prefix string for the first line. Use this for the first line instead of "prefix". If "prefix1" is set to 0, do not add a prefix string to the first line.
Returns:
Return "arr", the list of wrapped lines.

Definition at line 3587 of file ncbistr.hpp.

References Wrap().

list< string > & NStr::Wrap const string &  str,
SIZE_TYPE  width,
list< string > &  arr,
TWrapFlags  flags,
const string &  prefix,
const string *  prefix1 = 0
[inline, static]
 

Wrap the specified string into lines of a specified width -- prefix1 default version.

Split string "str" into lines of width "width" and add the resulting lines to the list "arr". Normally, all lines will begin with "prefix" (counted against "width"), but the first line will instead begin with "prefix1" if you supply it.

Parameters:
str String to be split into wrapped lines.
width Width of each wrapped line.
arr List of strings containing wrapped lines.
flags How to wrap the words to a new line. See EWrapFlags documentation.
prefix The prefix string added to each wrapped line, except the first line, unless "prefix1" is set. If "prefix" is set to 0, do not add a prefix string to the wrapped lines.
prefix1 The prefix string for the first line. Use this for the first line instead of "prefix". If "prefix1" is set to 0(default), do not add a prefix string to the first line.
Returns:
Return "arr", the list of wrapped lines.

Definition at line 3578 of file ncbistr.hpp.

References Wrap().

list< string > & NStr::Wrap const string &  str,
SIZE_TYPE  width,
list< string > &  arr,
TWrapFlags  flags = 0,
const string *  prefix = 0,
const string *  prefix1 = 0
[static]
 

Wrap the specified string into lines of a specified width -- prefix, prefix1 default version.

Split string "str" into lines of width "width" and add the resulting lines to the list "arr". Normally, all lines will begin with "prefix" (counted against "width"), but the first line will instead begin with "prefix1" if you supply it.

Parameters:
str String to be split into wrapped lines.
width Width of each wrapped line.
arr List of strings containing wrapped lines.
flags How to wrap the words to a new line. See EWrapFlags documentation.
prefix The prefix string added to each wrapped line, except the first line, unless "prefix1" is set. If "prefix" is set to 0(default), do not add a prefix string to the wrapped lines.
prefix1 The prefix string for the first line. Use this for the first line instead of "prefix". If "prefix1" is set to 0(default), do not add a prefix string to the first line.
Returns:
Return "arr", the list of wrapped lines.

Definition at line 2219 of file ncbistr.cpp.

References eSpace, fWrap_FlatFile, fWrap_HTMLPre, kEmptyStr, len, NPOS, and s_VisibleWidth().

Referenced by NcbiMessageBox(), s_PrintCommentBody(), CFlatItemFormatter::Wrap(), Wrap(), and CAlignFormatUtil::x_WrapOutputLine().

list< string > & NStr::WrapList const list< string > &  l,
SIZE_TYPE  width,
const string &  delim,
list< string > &  arr,
TWrapFlags  flags,
const string &  prefix,
const string &  prefix1
[inline, static]
 

Wrap the list using the specified criteria.

WrapList() is similar to Wrap(), but tries to avoid splitting any elements of the list to be wrapped. Also, the "delim" only applies between elements on the same line; if you want everything to end with commas or such, you should add them first.

Parameters:
l The list to be wrapped.
width Width of each wrapped line.
delim Delimiters used to split elements on the same line.
arr List containing the wrapped list result.
flags How to wrap the words to a new line. See EWrapFlags documentation.
prefix The prefix string added to each wrapped line, except the first line, unless "prefix1" is set. If "prefix" is set to 0, do not add a prefix string to the wrapped lines.
prefix1 The prefix string for the first line. Use this for the first line instead of "prefix". If "prefix1" is set to 0, do not add a prefix string to the first line.
Returns:
Return "arr", the wrapped list.

Definition at line 3606 of file ncbistr.hpp.

References WrapList().

list< string > & NStr::WrapList const list< string > &  l,
SIZE_TYPE  width,
const string &  delim,
list< string > &  arr,
TWrapFlags  flags,
const string &  prefix,
const string *  prefix1 = 0
[inline, static]
 

Wrap the list using the specified criteria -- default prefix1 version.

WrapList() is similar to Wrap(), but tries to avoid splitting any elements of the list to be wrapped. Also, the "delim" only applies between elements on the same line; if you want everything to end with commas or such, you should add them first.

Parameters:
l The list to be wrapped.
width Width of each wrapped line.
delim Delimiters used to split elements on the same line.
arr List containing the wrapped list result.
flags How to wrap the words to a new line. See EWrapFlags documentation.
prefix The prefix string added to each wrapped line, except the first line, unless "prefix1" is set. If "prefix" is set to 0, do not add a prefix string to the wrapped lines.
prefix1 The prefix string for the first line. Use this for the first line instead of "prefix". If "prefix1" is set to 0(default), do not add a prefix string to the first line.
Returns:
Return "arr", the wrappe list.

Definition at line 3596 of file ncbistr.hpp.

References WrapList().

list< string > & NStr::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
[static]
 

Wrap the list using the specified criteria -- default prefix, prefix1 version.

WrapList() is similar to Wrap(), but tries to avoid splitting any elements of the list to be wrapped. Also, the "delim" only applies between elements on the same line; if you want everything to end with commas or such, you should add them first.

Parameters:
l The list to be wrapped.
width Width of each wrapped line.
delim Delimiters used to split elements on the same line.
arr List containing the wrapped list result.
flags How to wrap the words to a new line. See EWrapFlags documentation.
prefix The prefix string added to each wrapped line, except the first line, unless "prefix1" is set. If "prefix" is set to 0(default), do not add a prefix string to the wrapped lines.
prefix1 The prefix string for the first line. Use this for the first line instead of "prefix". If "prefix1" is set to 0(default), do not add a prefix string to the first line.
Returns:
Return "arr", the wrapped list.

Definition at line 2381 of file ncbistr.cpp.

Referenced by WrapList().

string NStr::XmlEncode const string &  str  )  [static]
 

Encode a string for XML.

Replace relevant characters by predefined entities.

Definition at line 1987 of file ncbistr.cpp.

Referenced by s_WriteEscapedStr().


The documentation for this class was generated from the following files:
Generated on Wed Dec 9 08:12:57 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:20:14 2009 by modify_doxy.py rev. 173732