Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

SymbolTable Class Reference

An interface that maps strings to objects. More...

#include <symtable.h>

List of all members.

Public Types

enum  { SYMBOL_REF = 0x0024 }
 The character preceding a symbol reference name. More...


Public Methods

virtual const UnicodeStringlookup (const UnicodeString& s) const = 0
 Lookup the characters associated with this string and return it. More...

virtual const UnicodeSetlookupSet (UChar ch) const = 0
 Lookup the UnicodeSet associated with the given character, and return it. More...

virtual UnicodeString parseReference (const UnicodeString& text, ParsePosition& pos, int32_t limit) const = 0
 Parse a symbol reference name from the given string, starting at the given position. More...


Detailed Description

An interface that maps strings to objects.

This interface defines both lookup protocol and parsing. This allows different components to share a symbol table and to handle name parsing uniformly. It is expected that client parse code look for the SYMBOL_REF character and, when seen, attempt to parse the characters after it using parseReference().

Currently, RuleBasedTransliterator and UnicodeSet use this interface to share variable definitions.

Definition at line 28 of file symtable.h.


Member Enumeration Documentation

anonymous enum
 

The character preceding a symbol reference name.

Enumeration values:
SYMBOL_REF  

Definition at line 34 of file symtable.h.


Member Function Documentation

const UnicodeString * SymbolTable::lookup ( const UnicodeString & s ) const [pure virtual]
 

Lookup the characters associated with this string and return it.

Return NULL if no such name exists. The resultant string may have length zero.

const UnicodeSet * SymbolTable::lookupSet ( UChar ch ) const [pure virtual]
 

Lookup the UnicodeSet associated with the given character, and return it.

Return null if not found.

UnicodeString SymbolTable::parseReference ( const UnicodeString & text,
ParsePosition & pos,
int32_t limit ) const [pure virtual]
 

Parse a symbol reference name from the given string, starting at the given position.

If no valid symbol reference name is found, return an empty string.

Parameters:
text   the text to parse for the name
pos   on entry, the index of the first character to parse. This is the character following the SYMBOL_REF character. On exit, the index after the last parsed character.
limit   the index after the last character to be parsed.
Returns:
the parsed name or an empty string.


The documentation for this class was generated from the following file:
Generated at Tue Dec 5 17:56:23 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000