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

MergeCollation Class Reference

Utility class for normalizing and merging patterns for collation. More...

#include <mergecol.h>

List of all members.

Public Methods

 MergeCollation ( const UnicodeString& pattern, Normalizer::EMode decompMode, UErrorCode& success)
 Creates a merged collation table from a pattern string. More...

 MergeCollation ( const MergeCollation& other)
 Copy constructor.

 ~MergeCollation ()
 Destructor.

const MergeCollation& operator= (const MergeCollation& other)
 Assignment operator.

UnicodeStringgetPattern (UnicodeString& pattern) const
 Recovers current pattern from this merged collation object. More...

UnicodeStringgetPattern (UnicodeString& pattern, UBool withWhiteSpace) const
 Recovers current pattern with white spaces. More...

UnicodeStringemitPattern (UnicodeString& pattern) const
 Emits the pattern for collation builder. More...

UnicodeStringemitPattern (UnicodeString& pattern, UBool withWhiteSpace) const
 Emits the pattern for collation builder. More...

void setPattern (const UnicodeString& pattern, Normalizer::EMode decompMode, UErrorCode& status)
 Sets the pattern. More...

void addPattern (const UnicodeString& pattern, Normalizer::EMode decompMode, UErrorCode& status)
 Adds a pattern to the current merge collation object. More...

int32_t getCount (void) const
 Gets count of separate entries in the merge collation object. More...

const PatternEntrygetItemAt (UTextOffset index) const
 Gets the specified pattern entry out of the merge collation object. More...


Detailed Description

Utility class for normalizing and merging patterns for collation.

Patterns are strings of the form <entry>*, where <entry> has the form:

 <pattern> := <entry>*
 <entry> := <separator><chars>{"/"<extension>}
 <separator> := "=", ",", ";", "<", "&"
 <chars>, and <extension> are both arbitrary strings.
 

Unquoted whitespaces are ignored. 'xxx' can be used to quote characters.

One difference from Collation is that & is used to reset to a current point. Or, in other words, it introduces a new sequence which is to be added to the old.

That is: "a < b < c < d" is the same as "a < b & b < c & c < d" OR "a < b < d & b < c" XXX: make '' be a single quote.

See also:
PatternEntry
Version:
1.4 1/7/97
Author(s):
Mark Davis, Helena Shih

Definition at line 61 of file mergecol.h.


Constructor & Destructor Documentation

MergeCollation::MergeCollation ( const UnicodeString & pattern,
Normalizer::EMode decompMode,
UErrorCode & success )
 

Creates a merged collation table from a pattern string.

Parameters:
pattern   the pattern string.
status   the error code status. If the input pattern is incorrect, this will be set to U_INVALID_FORMAT_ERROR.

MergeCollation::MergeCollation ( const MergeCollation & other )
 

Copy constructor.

MergeCollation::~MergeCollation ( )
 

Destructor.


Member Function Documentation

void MergeCollation::addPattern ( const UnicodeString & pattern,
Normalizer::EMode decompMode,
UErrorCode & status )
 

Adds a pattern to the current merge collation object.

Parameters:
pattern   the new pattern to be added.
status   the error code status, it will be set to U_INVALID_FORMAT_ERROR if the pattern is incorrect.

UnicodeString & MergeCollation::emitPattern ( UnicodeString & pattern,
UBool withWhiteSpace ) const
 

Emits the pattern for collation builder.

Parameters:
pattern   the result buffer.
withWhiteSpace   puts spacing around the entries, and
before & and <
Returns:
Emits the string in the format understable to the collation builder.

UnicodeString & MergeCollation::emitPattern ( UnicodeString & result ) const [inline]
 

Emits the pattern for collation builder.

Parameters:
pattern   the result buffer.
Returns:
Emits the string in the format understable to the collation builder.

Definition at line 212 of file mergecol.h.

int32_t MergeCollation::getCount ( void ) const
 

Gets count of separate entries in the merge collation object.

Returns:
the number of pattern entries

const PatternEntry * MergeCollation::getItemAt ( UTextOffset index ) const
 

Gets the specified pattern entry out of the merge collation object.

Parameters:
index   the offset of the desired pattern entry
Returns:
the requested pattern entry

UnicodeString & MergeCollation::getPattern ( UnicodeString & pattern,
UBool withWhiteSpace ) const
 

Recovers current pattern with white spaces.

Parameters:
pattern   the result buffer.
withWhiteSpace   puts spacing around the entries, and
before & and <
Returns:
the recovered result.

UnicodeString & MergeCollation::getPattern ( UnicodeString & result ) const [inline]
 

Recovers current pattern from this merged collation object.

Parameters:
pattern   the result buffer.
Returns:
the recovered result.

Definition at line 207 of file mergecol.h.

const MergeCollation & MergeCollation::operator= ( const MergeCollation & other )
 

Assignment operator.

void MergeCollation::setPattern ( const UnicodeString & pattern,
Normalizer::EMode decompMode,
UErrorCode & status )
 

Sets the pattern.

Parameters:
pattern   string.
status   the error code status, it will be set to U_INVALID_FORMAT_ERROR if the pattern is incorrect.


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