NxsString Class Reference

A string class for use with the Nexus Class Library. More...

#include <nxsstring.h>

List of all members.

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
NxsStringoperator= (char)
NxsStringoperator= (const char *s)
NxsStringoperator+= (const char *s)
NxsStringoperator+= (const std::string &s)
NxsStringoperator+= (const char c)
NxsStringoperator+= (const int i)
NxsStringoperator+= (unsigned i)
NxsStringoperator+= (unsigned long i)
NxsStringoperator+= (const long l)
NxsStringoperator+= (const double d)
NxsStringoperator<< (int i)
NxsStringoperator<< (unsigned i)
NxsStringoperator<< (long l)
NxsStringoperator<< (unsigned long l)
NxsStringoperator<< (double d)
NxsStringoperator<< (const char *c)
NxsStringoperator<< (char c)
NxsStringoperator<< (const std::string &s)
NxsStringoperator<< (NxsString &(*funcPtr)(NxsString &))
void clear ()
int PrintF (const char *formatStr,...)
unsigned char * p_str (unsigned char *) const
NxsStringAddQuotes ()
NxsStringAddTail (char c, unsigned n)
NxsStringNumberThenWord (unsigned i, NxsString s)
NxsStringShortenTo (unsigned n)
NxsStringCapitalize ()
NxsStringRightJustifyString (const NxsString &s, unsigned w, bool clear_first=false)
NxsStringRightJustifyDbl (double x, unsigned w, unsigned p, bool clear_first=false)
NxsStringBlanksToUnderscores ()
NxsStringUnderscoresToBlanks ()

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)

Detailed Description

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.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Enumerator Friends
Generated on Mon Mar 29 16:37:13 2010 for NCL by  doxygen 1.6.3