NxsToken Class Reference

#include <nxstoken.h>

List of all members.

Public Member Functions

virtual ~NxsToken ()
bool AtEOF ()
bool AtEOL ()
bool Abbreviation (NxsString s)
bool Begins (NxsString s, bool respect_case=false)
void BlanksToUnderscores ()
bool Equals (NxsString s, bool respect_case=false) const
long GetFileColumn () const
file_pos GetFilePosition () const
long GetFileLine () const
void GetNextToken ()
NxsString GetToken (bool respect_case=true)
const char * GetTokenAsCStr (bool respect_case=true)
const NxsStringGetTokenReference () const
int GetTokenLength () const
bool IsPlusMinusToken ()
bool IsPunctuationToken ()
bool IsWhitespaceToken ()
bool IsPlusMinusToken (const std::string &t)
bool IsPunctuationToken (const std::string &t)
bool IsWhitespaceToken (const std::string &t)
void ProcessAsCommand (ProcessedNxsCommand *tokenVec)
void ReplaceToken (const NxsString s)
void ResetToken ()
void SetSpecialPunctuationCharacter (char c)
void SetLabileFlagBit (int bit)
bool StoppedOn (char ch)
void StripWhitespace ()
void ToUpper ()
void Write (std::ostream &out)
void Writeln (std::ostream &out)
virtual void OutputComment (const NxsString &msg)
void SetBlockName (const char *)
std::string GetBlockName ()

Static Public Member Functions

static std::string EscapeString (const std::string &)
static bool NeedsQuotes (const std::string &)
static std::string GetQuoted (const std::string &)
static void DemandEndSemicolon (NxsToken &token, NxsString &errormsg, const char *contextString)
static unsigned DemandPositiveInt (NxsToken &token, NxsString &errormsg, const char *contextString)

Protected Member Functions

void AppendToComment (char ch)
void AppendToToken (char ch)
bool GetComment ()
void GetCurlyBracketedToken ()
void GetDoubleQuotedToken ()
void GetQuoted ()
void GetParentheticalToken ()
bool IsPunctuation (char ch)
bool IsWhitespace (char ch)

Detailed Description

--------------------------------------------------------------------------------------------------------------------- NxsToken objects are used by NxsReader to extract words (tokens) from a NEXUS data file. NxsToken objects know to correctly skip NEXUS comments and understand NEXUS punctuation, making reading a NEXUS file as simple as repeatedly calling the GetNextToken() function and then interpreting the token returned. If the token object is not attached to an input stream, calls to GetNextToken() will have no effect. If the token object is not attached to an output stream, output comments will be discarded (i.e., not output anywhere) and calls to Write or Writeln will be ineffective. If input and output streams have been attached to the token object, however, tokens are read one at a time from the input stream, and comments are correctly read and either written to the output stream (if an output comment) or ignored (if not an output comment). Sequences of characters surrounded by single quotes are read in as single tokens. A pair of adjacent single quotes are stored as a single quote, and underscore characters are stored as blanks.

Definition at line 353 of file nxstoken.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