Copyright © 1996 by the Regents of the University of California.
Symbol Class Reference
The Symbol
class provides a method for uniquely storing strings
and quickly comparing them for identity.
Symbol's are small enough
that they should never be passed by pointer nor by reference.
Comparison operators for Symbol's
and String's are predefined as well.
Symbol Member Functions
-
Symbol()
Symbol(const char *cp)
Symbol(const String &orig)
Symbol(Symbol s)
-
Constructors.
-
int operator==(Symbol s) const
int operator<(Symbol s) const
-
Return result of relational operator.
Testing for equality and inequality is fast,
all other comparisons use the
String
class's operators.
-
bool empty() const
-
Returns true if the symbol is empty (i.e.,
constructed with the default constructor
or from an empty string).
-
const char *chars() const
-
Return the character string associated with the symbol.
Example
#include <mol/Symbol.h>
Symbol name("name");
Greg Couch, UCSF Computer Graphics Laboratory