A string class for use with the Nexus Class Library. More...
#include <nxsstring.h>
Public Types | |
enum | NxsQuotingRequirements { , kSingleQuotesNeededForNexus, kUnderscoresSufficeForNexus } |
Public Member Functions | |
NxsString () | |
NxsString (const char *s) | |
NxsString (const NxsString &s) | |
bool | Abbreviates (const NxsString &s, NxsString::CmpEnum mode=NxsString::no_respect_case) const |
unsigned | ConvertToUnsigned () const |
int | ConvertToInt () const |
long | ConvertToLong () const |
double | ConvertToDouble () const |
bool | Equals (const NxsString &s, NxsString::CmpEnum mode=respect_case) const |
bool | EqualsCaseInsensitive (const NxsString &s) const |
NxsString | GetQuoted () const |
bool | IsADouble () const |
bool | IsALong () const |
bool | IsCapAbbreviation (const NxsString &s) const |
bool | IsInVector (const NxsStringVector &s, NxsString::CmpEnum mode=respect_case) const |
bool | IsStdAbbreviation (const NxsString &s, bool respectCase) const |
bool | QuotesNeeded () const |
NxsString | UpperCasePrefix () const |
NxsString & | operator= (char) |
NxsString & | operator= (const char *s) |
NxsString & | operator+= (const char *s) |
NxsString & | operator+= (const std::string &s) |
NxsString & | operator+= (const char c) |
NxsString & | operator+= (const int i) |
NxsString & | operator+= (unsigned i) |
NxsString & | operator+= (unsigned long i) |
NxsString & | operator+= (const long l) |
NxsString & | operator+= (const double d) |
NxsString & | operator<< (int i) |
NxsString & | operator<< (unsigned i) |
NxsString & | operator<< (long l) |
NxsString & | operator<< (unsigned long l) |
NxsString & | operator<< (double d) |
NxsString & | operator<< (const char *c) |
NxsString & | operator<< (char c) |
NxsString & | operator<< (const std::string &s) |
NxsString & | operator<< (NxsString &(*funcPtr)(NxsString &)) |
void | clear () |
int | PrintF (const char *formatStr,...) |
unsigned char * | p_str (unsigned char *) const |
NxsString & | AddQuotes () |
NxsString & | AddTail (char c, unsigned n) |
NxsString & | NumberThenWord (unsigned i, NxsString s) |
NxsString & | ShortenTo (unsigned n) |
NxsString & | Capitalize () |
NxsString & | RightJustifyString (const NxsString &s, unsigned w, bool clear_first=false) |
NxsString & | RightJustifyDbl (double x, unsigned w, unsigned p, bool clear_first=false) |
NxsString & | BlanksToUnderscores () |
NxsString & | UnderscoresToBlanks () |
Static Public Member Functions | |
static bool | to_long (const char *c, long *n) |
static bool | to_double (const char *c, double *n) |
static std::string | strip_surrounding_whitespace (const std::string &s) |
static std::string | strip_whitespace (const std::string &s) |
static std::string & | to_lower (std::string &s) |
static std::string & | to_upper (std::string &s) |
static bool | IsNexusPunctuation (const char c) |
static NxsString | ToHex (long p, unsigned nFours) |
Friends | |
std::ostream & | operator<< (std::ostream &out, const NxsString &s) |
A string class for use with the Nexus Class Library.
NxsString inherits most of its functionality from the standard template library class string, adding certain abilities needed for use in NCL, such as the ability to discern whether a short string represents an abbreviation for the string currently stored. Another important addition is the member function PrintF, which accepts a format string and an arbitrary number of arguments, allowing a string to be built in a manner similar to the standard C function printf. Many operators are also provided for appending numbers to the ends of strings, an ability which is very useful for producing default labels (e.g. taxon1, taxon2, etc.).
Definition at line 42 of file nxsstring.h.