ICU-1533 Removed private classes and moved them into the implementation directory. Deprecated transliterator subclasses that are supposed to be private.

X-SVN-Rev: 6963
This commit is contained in:
Helena Chapman 2001-11-16 23:50:18 +00:00
parent a590767769
commit a4b3d2abd2
15 changed files with 74 additions and 667 deletions

View file

@ -37,8 +37,8 @@ class TransliteratorRegistry;
* <p>Copyright &copy; IBM Corporation 1999. All rights reserved.
*
* @author Alan Liu
* @version $RCSfile: cpdtrans.h,v $ $Revision: 1.22 $ $Date: 2001/11/14 00:21:56 $
* @stable
* @version $RCSfile: cpdtrans.h,v $ $Revision: 1.23 $ $Date: 2001/11/16 23:50:17 $
* @deprecated To be removed after 2002-sep-30.
*/
class U_I18N_API CompoundTransliterator : public Transliterator {
@ -69,19 +69,18 @@ public:
* <tt>filter.contains()</tt> returns <tt>false</tt> will not be
* altered by this transliterator. If <tt>filter</tt> is
* <tt>null</tt> then no filtering is applied.
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createInstance factory method.
*/
CompoundTransliterator(Transliterator* const transliterators[],
int32_t transliteratorCount,
UnicodeFilter* adoptedFilter = 0);
private:
/**
* Constructs a new compound transliterator.
* @param filter the filter. Any character for which
* <tt>filter.contains()</tt> returns <tt>false</tt> will not be
* altered by this transliterator. If <tt>filter</tt> is
* <tt>null</tt> then no filtering is applied.
* @draft ICU 2.0
*/
CompoundTransliterator(const UnicodeString& id,
UTransDirection dir,
@ -92,12 +91,11 @@ public:
/**
* Constructs a new compound transliterator in the FORWARD
* direction with a NULL filter.
* @draft ICU 2.0
*/
CompoundTransliterator(const UnicodeString& id,
UParseError& parseError,
UErrorCode& status);
public:
/**
* Destructor.
* @stable
@ -106,26 +104,26 @@ public:
/**
* Copy constructor.
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createInstance factory method.
*/
CompoundTransliterator(const CompoundTransliterator&);
/**
* Assignment operator.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
CompoundTransliterator& operator=(const CompoundTransliterator&);
/**
* Transliterator API.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
Transliterator* clone(void) const;
/**
* Returns the number of transliterators in this chain.
* @return number of transliterators in this chain.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual int32_t getCount(void) const;
@ -133,18 +131,20 @@ public:
* Returns the transliterator at the given index in this chain.
* @param index index into chain, from 0 to <code>getCount() - 1</code>
* @return transliterator at the given index
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual const Transliterator& getTransliterator(int32_t index) const;
/**
* @stable
* Sets the transliterators.
* @deprecated To be removed after 2002-sep-30.
*/
void setTransliterators(Transliterator* const transliterators[],
int32_t count);
/**
* @stable
* Adopts the transliterators.
* @deprecated To be removed after 2002-sep-30.
*/
void adoptTransliterators(Transliterator* adoptedTransliterators[],
int32_t count);
@ -159,13 +159,14 @@ public:
* character to their hex escape representations, \uxxxx or
* \Uxxxxxxxx. Unprintable characters are those other than
* U+000A, U+0020..U+007E.
* @deprecated To be removed after 2002-sep-30.
*/
virtual UnicodeString& toRules(UnicodeString& result,
UBool escapeUnprintable) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& index,
UBool incremental) const;
@ -226,6 +227,7 @@ public:
/**
* Constructs a new compound transliterator.
* Use Transliterator::createInstance factory method.
* @param filter the filter. Any character for which
* <tt>filter.isIn()</tt> returns <tt>false</tt> will not be
* altered by this transliterator. If <tt>filter</tt> is
@ -241,6 +243,7 @@ public:
/**
* Constructs a new compound transliterator in the FORWARD
* direction with a NULL filter.
* Use Transliterator::createInstance factory method.
* @deprecated Remove after Aug 2002. Use the constructor that takes
* UParseError as one of the parmeters.
*/

View file

@ -24,8 +24,8 @@ U_NAMESPACE_BEGIN
* <p>Copyright &copy; IBM Corporation 1999. All rights reserved.
*
* @author Alan Liu
* @version $RCSfile: hextouni.h,v $ $Revision: 1.12 $ $Date: 2001/11/14 00:16:29 $
* @stable
* @version $RCSfile: hextouni.h,v $ $Revision: 1.13 $ $Date: 2001/11/16 23:50:17 $
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
*/
class U_I18N_API HexToUnicodeTransliterator : public Transliterator {
@ -69,13 +69,14 @@ public:
* Constructs a transliterator that recognizes the standard
* prefixes "&#92;u", "&#92;U", "u+", and "U+", each with no
* suffix.
* @stable
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
*/
HexToUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Constructs a custom transliterator with the given pattern.
* @see #applyPattern
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
*/
HexToUnicodeTransliterator(const UnicodeString& pattern,
UErrorCode& status);
@ -84,6 +85,7 @@ public:
* Constructs a custom transliterator with the given pattern
* and filter.
* @see #applyPattern
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method.
*/
HexToUnicodeTransliterator(const UnicodeString& pattern,
UnicodeFilter* adoptedFilter,
@ -91,25 +93,25 @@ public:
/**
* Destructor.
* @stable
* @deprecated To be removed after 2002-sep-30, use Transliterator dtor directly.
*/
virtual ~HexToUnicodeTransliterator();
/**
* Copy constructor.
* @stable
* @deprecated To be removed after 2002-sep-30, use Transliterator::createInstance factory method
*/
HexToUnicodeTransliterator(const HexToUnicodeTransliterator&);
/**
* Assignment operator.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
HexToUnicodeTransliterator& operator=(const HexToUnicodeTransliterator&);
/**
* Transliterator API.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
Transliterator* clone(void) const;
@ -138,17 +140,19 @@ public:
* suffix-char := [^special-char] | '\\' special-char
* special-char := ';' | '0' | '#' | '\\'
* </pre>
* @deprecated To be removed after 2002-sep-30.
*/
void applyPattern(const UnicodeString& thePattern, UErrorCode& status);
/**
* Return this transliterator's pattern.
* @deprecated To be removed after 2002-sep-30.
*/
const UnicodeString& toPattern(void) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;

View file

@ -1,83 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 06/07/01 aliu Creation.
**********************************************************************
*/
#ifndef NAME2UNI_H
#define NAME2UNI_H
#include "unicode/translit.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that performs name to character mapping.
* @author Alan Liu
* @draft ICU 2.0
*/
class U_I18N_API NameUnicodeTransliterator : public Transliterator {
UChar32 openDelimiter;
UChar32 closeDelimiter;
public:
/**
* Constructs a transliterator.
* @draft ICU 2.0
*/
NameUnicodeTransliterator(UChar32 openDelimiter, UChar32 closeDelimiter,
UnicodeFilter* adoptedFilter = 0);
/**
* Constructs a transliterator with the default delimiters '{' and
* '}'.
* @draft ICU 2.0
*/
NameUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
* @draft ICU 2.0
*/
virtual ~NameUnicodeTransliterator();
/**
* Copy constructor.
* @draft ICU 2.0
*/
NameUnicodeTransliterator(const NameUnicodeTransliterator&);
/**
* Assignment operator.
* @draft ICU 2.0
*/
NameUnicodeTransliterator& operator=(const NameUnicodeTransliterator&);
/**
* Transliterator API.
* @draft ICU 2.0
*/
Transliterator* clone(void) const;
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
* @draft ICU 2.0
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
private:
static const char _ID[];
};
U_NAMESPACE_END
#endif

View file

@ -1,88 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 07/03/01 aliu Creation.
**********************************************************************
*/
#ifndef NORTRANS_H
#define NORTRANS_H
#include "unicode/utypes.h"
#include "unicode/translit.h"
#include "unicode/normlzr.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that performs normalization.
* @author Alan Liu
* @version $RCSfile: nortrans.h,v $ $Revision: 1.5 $ $Date: 2001/10/17 17:29:33 $
*/
class U_I18N_API NormalizationTransliterator : public Transliterator {
/**
* The normalization mode of this transliterator.
*/
UNormalizationMode fMode;
/**
* Normalization options for this transliterator.
*/
int32_t options;
public:
/**
* Destructor.
*/
virtual ~NormalizationTransliterator();
/**
* Copy constructor.
*/
NormalizationTransliterator(const NormalizationTransliterator&);
/**
* Assignment operator.
*/
NormalizationTransliterator& operator=(const NormalizationTransliterator&);
/**
* Transliterator API.
*/
Transliterator* clone(void) const;
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
*/
void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
public:
/**
* System registration hook. Public to Transliterator only.
*/
static void registerIDs();
private:
// Transliterator::Factory methods
static Transliterator* _create(const UnicodeString& ID,
Token context);
/**
* Constructs a transliterator. This method is private.
* Public users must use the factory method createInstance().
*/
NormalizationTransliterator(const UnicodeString& id,
UNormalizationMode mode, int32_t opt);
};
U_NAMESPACE_END
#endif

View file

@ -17,6 +17,7 @@ U_NAMESPACE_BEGIN
/**
* A transliterator that leaves text unchanged.
* @author Alan Liu
* @deprecated To be removed after 2002-sep-30; use Transliterator::createInstance factory method
*/
class U_I18N_API NullTransliterator : public Transliterator {
@ -24,31 +25,37 @@ public:
/**
* ID for this transliterator.
* @deprecated To be removed after 2002-sep-30.
*/
static const UChar ID[]; // public for Transliterator
/**
* ID for this transliterator.
* @deprecated To be removed after 2002-sep-30.
*/
static const UChar SHORT_ID[]; // public for Transliterator
/**
* Constructs a transliterator.
* @deprecated To be removed after 2002-sep-30.
*/
NullTransliterator();
/**
* Destructor.
* @deprecated To be removed after 2002-sep-30.
*/
virtual ~NullTransliterator();
/**
* Transliterator API.
* @deprecated To be removed after 2002-sep-30.
*/
Transliterator* clone(void) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
* @deprecated To be removed after 2002-sep-30.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;

View file

@ -277,7 +277,7 @@ class TransliterationRuleData;
* rule <em>masks</em> the second rule. </p>
*
* @author Alan Liu
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
class U_I18N_API RuleBasedTransliterator : public Transliterator {
@ -298,9 +298,8 @@ public:
* Constructs a new transliterator from the given rules.
* @param rules rules, separated by ';'
* @param direction either FORWARD or REVERSE.
* @exception IllegalArgumentException if rules are malformed
* or direction is invalid.
* @stable
* @exception IllegalArgumentException if rules are malformed.
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -313,8 +312,8 @@ public:
* Constructs a new transliterator from the given rules.
* @param rules rules, separated by ';'
* @param direction either FORWARD or REVERSE.
* @exception IllegalArgumentException if rules are malformed
* or direction is invalid.
* @exception IllegalArgumentException if rules are malformed.
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -324,7 +323,7 @@ public:
/**
* Covenience constructor with no filter.
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -333,7 +332,7 @@ public:
/**
* Covenience constructor with no filter and FORWARD direction.
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -341,22 +340,22 @@ public:
/**
* Covenience constructor with FORWARD direction.
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
UnicodeFilter* adoptedFilter,
UErrorCode& status);
private:
friend class TransliteratorRegistry; // to access TransliterationRuleData convenience ctor
/**
* Covenience constructor.
* @stable
*/
RuleBasedTransliterator(const UnicodeString& id,
const TransliterationRuleData* theData,
UnicodeFilter* adoptedFilter = 0);
private:
friend class Transliterator; // to access following ct
@ -371,7 +370,7 @@ public:
/**
* Copy constructor.
* @stable
* @deprecated To be removed after 2002-sep-30; use the Transliterator::createFromRules factory method.
*/
RuleBasedTransliterator(const RuleBasedTransliterator&);
@ -379,13 +378,13 @@ public:
/**
* Implement Transliterator API.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
Transliterator* clone(void) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offsets,
UBool isIncremental) const;
@ -400,6 +399,7 @@ public:
* character to their hex escape representations, \uxxxx or
* \Uxxxxxxxx. Unprintable characters are those other than
* U+000A, U+0020..U+007E.
* @deprecated To be removed after 2002-sep-30; use the Transliterator::toRules directly.
*/
virtual UnicodeString& toRules(UnicodeString& result,
UBool escapeUnprintable) const;
@ -413,7 +413,7 @@ public:
* . Derived::getStaticClassID()) ...
* </pre>
* @return The class ID for all objects of this class.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }
@ -441,35 +441,6 @@ public:
*/
virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); };
/**
* Parse error codes generated by RuleBasedTransliterator.
* See parseerr.h.
*/
/*enum {
PARSE_ERROR_BASE = 0x10000,
BAD_VARIABLE_DEFINITION,
MALFORMED_RULE,
MALFORMED_SET,
MALFORMED_SYMBOL_REFERENCE,
MALFORMED_UNICODE_ESCAPE,
MALFORMED_VARIABLE_DEFINITION,
MALFORMED_VARIABLE_REFERENCE,
MISMATCHED_SEGMENT_DELIMITERS,
MISPLACED_ANCHOR_START,
MISPLACED_CURSOR_OFFSET,
MISPLACED_QUANTIFIER,
MISSING_OPERATOR,
MISSING_SEGMENT_CLOSE,
MULTIPLE_ANTE_CONTEXTS,
MULTIPLE_CURSORS,
MULTIPLE_POST_CONTEXTS,
TRAILING_BACKSLASH,
UNDEFINED_SEGMENT_REFERENCE,
UNDEFINED_VARIABLE,
UNQUOTED_SPECIAL,
UNTERMINATED_QUOTE
};
*/
private:
/**

View file

@ -1,58 +0,0 @@
/*
**********************************************************************
* Copyright (c) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 04/02/2001 aliu Creation.
**********************************************************************
*/
#ifndef REMTRANS_H
#define REMTRANS_H
#include "unicode/translit.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that removes text.
* @author Alan Liu
*/
class U_I18N_API RemoveTransliterator : public Transliterator {
public:
/**
* ID for this transliterator.
*/
static const UChar ID[]; // public for Transliterator
/**
* Constructs a transliterator.
*/
RemoveTransliterator();
/**
* Destructor.
*/
virtual ~RemoveTransliterator();
/**
* Transliterator API.
*/
Transliterator* clone(void) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
};
inline RemoveTransliterator::RemoveTransliterator() : Transliterator(ID, 0) {}
inline RemoveTransliterator::~RemoveTransliterator() {}
U_NAMESPACE_END
#endif

View file

@ -1,77 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 05/24/01 aliu Creation.
**********************************************************************
*/
#ifndef TITLETRN_H
#define TITLETRN_H
#include "unicode/translit.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that converts all letters (as defined by
* <code>UCharacter.isLetter()</code>) to lower case, except for those
* letters preceded by non-letters. The latter are converted to title
* case using <code>UCharacter.toTitleCase()</code>.
* @author Alan Liu
*/
class U_I18N_API TitlecaseTransliterator : public Transliterator {
/**
* ID for this transliterator.
*/
static const char _ID[];
public:
/**
* Constructs a transliterator.
*/
TitlecaseTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
*/
virtual ~TitlecaseTransliterator();
/**
* Copy constructor.
*/
TitlecaseTransliterator(const TitlecaseTransliterator&);
/**
* Assignment operator.
*/
TitlecaseTransliterator& operator=(const TitlecaseTransliterator&);
/**
* Transliterator API.
*/
Transliterator* clone(void) const;
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
*/
void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
public:
/**
* Static memory cleanup function. FOR INTERNAL USE ONLY; DO NOT
* CALL.
*/
static void cleanup();
};
U_NAMESPACE_END
#endif

View file

@ -1,74 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 05/24/01 aliu Creation.
**********************************************************************
*/
#ifndef TOLOWTRN_H
#define TOLOWTRN_H
#include "unicode/xformtrn.h"
#include "unicode/locid.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that performs locale-sensitive toLower()
* case mapping.
* @author Alan Liu
*/
class U_I18N_API LowercaseTransliterator : public TransformTransliterator {
public:
/**
* Constructs a transliterator.
*/
LowercaseTransliterator(const Locale& loc = Locale::getDefault(),
UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
*/
virtual ~LowercaseTransliterator();
/**
* Copy constructor.
*/
LowercaseTransliterator(const LowercaseTransliterator&);
/**
* Assignment operator.
*/
LowercaseTransliterator& operator=(const LowercaseTransliterator&);
/**
* Transliterator API.
*/
Transliterator* clone(void) const;
protected:
/**
* TransformTransliterator framework method.
*/
virtual UBool hasTransform(UChar32 c) const;
/**
* TransformTransliterator framework method.
*/
virtual void transform(UnicodeString& s) const;
private:
Locale loc;
static const char _ID[];
};
U_NAMESPACE_END
#endif

View file

@ -1,74 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 05/24/01 aliu Creation.
**********************************************************************
*/
#ifndef TOUPPTRN_H
#define TOUPPTRN_H
#include "unicode/xformtrn.h"
#include "unicode/locid.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that performs locale-sensitive toUpper()
* case mapping.
* @author Alan Liu
*/
class U_I18N_API UppercaseTransliterator : public TransformTransliterator {
public:
/**
* Constructs a transliterator.
*/
UppercaseTransliterator(const Locale& loc = Locale::getDefault(),
UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
*/
virtual ~UppercaseTransliterator();
/**
* Copy constructor.
*/
UppercaseTransliterator(const UppercaseTransliterator&);
/**
* Assignment operator.
*/
UppercaseTransliterator& operator=(const UppercaseTransliterator&);
/**
* Transliterator API.
*/
Transliterator* clone(void) const;
protected:
/**
* TransformTransliterator framework method.
*/
virtual UBool hasTransform(UChar32 c) const;
/**
* TransformTransliterator framework method.
*/
virtual void transform(UnicodeString& s) const;
private:
Locale loc;
static const char _ID[];
};
U_NAMESPACE_END
#endif

View file

@ -384,10 +384,15 @@ public:
* <= limit</code>.
* @param limit the ending index, exclusive; <code>start <= limit
* <= text.length()</code>.
* @param filter the filter. Any character for which
* <tt>filter.contains()</tt> returns <tt>false</tt> will not be
* altered by this transliterator. If <tt>filter</tt> is
* <tt>null</tt> then no filtering is applied.
* @return The new limit index. The text previously occupying <code>[start,
* limit)</code> has been transliterated, possibly to a string of a different
* length, at <code>[start, </code><em>new-limit</em><code>)</code>, where
* <em>new-limit</em> is the return value.
* <em>new-limit</em> is the return value. If the input offsets are out of bounds,
* the returned value will be 0 and the input string remains unchanged.
* @stable
*/
virtual int32_t transliterate(Replaceable& text,
@ -460,6 +465,7 @@ public:
* @see #handleTransliterate
* @exception IllegalArgumentException if <code>index</code>
* is invalid
* @see UTransPosition
* @stable
*/
virtual void transliterate(Replaceable& text, UTransPosition& index,
@ -857,6 +863,8 @@ public:
/**
* Unregisters a transliterator or class. This may be either
* a system transliterator or a user transliterator or class.
* Any attempt to construct an unregistered transliterator based
* on its ID will fail.
*
* @param ID the ID of the transliterator or class
* @return the <code>Object</code> that was registered with

View file

@ -1,75 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 06/06/01 aliu Creation.
**********************************************************************
*/
#ifndef UNI2NAME_H
#define UNI2NAME_H
#include "unicode/translit.h"
U_NAMESPACE_BEGIN
/**
* A transliterator that performs character to name mapping.
* @author Alan Liu
*/
class U_I18N_API UnicodeNameTransliterator : public Transliterator {
UChar32 openDelimiter;
UChar32 closeDelimiter;
public:
/**
* Constructs a transliterator.
*/
UnicodeNameTransliterator(UChar32 openDelimiter, UChar32 closeDelimiter,
UnicodeFilter* adoptedFilter = 0);
/**
* Constructs a transliterator with the default delimiters '{' and
* '}'.
*/
UnicodeNameTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
*/
virtual ~UnicodeNameTransliterator();
/**
* Copy constructor.
*/
UnicodeNameTransliterator(const UnicodeNameTransliterator&);
/**
* Assignment operator.
*/
UnicodeNameTransliterator& operator=(const UnicodeNameTransliterator&);
/**
* Transliterator API.
*/
Transliterator* clone(void) const;
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
private:
static const char _ID[];
};
U_NAMESPACE_END
#endif

View file

@ -94,7 +94,7 @@ class TransliteratorParser;
* <tr align="top">
* <td nowrap valign="top" align="right"><code>hex :=&nbsp; </code></td>
* <td valign="top"><em>any character for which
* </em><code>Character.digit(c, 16)</code><em>
* </em><code>u_digit(c, 16)</code><em>
* returns a non-negative result</em></td>
* </tr>
* <tr>

View file

@ -35,6 +35,7 @@ class UnicodeFilter;
* default is uppercase.
*
* @author Alan Liu
* @deprecated To be removed after 2002-sep-30.
*/
class U_I18N_API UnicodeToHexTransliterator : public Transliterator {
@ -93,7 +94,7 @@ public:
* NULL if none. Adopted by this transliterator.
* @param status Error code indicating success or failure
* to parse pattern.
* @stable
* @deprecated To be removed after 2002-sep-30; use Transliterator::createInstance factory method.
*/
UnicodeToHexTransliterator(const UnicodeString& pattern,
UBool isUppercase,
@ -106,6 +107,7 @@ public:
* applyPattern() for pattern syntax.
* @param status Error code indicating success or failure
* to parse pattern.
* @deprecated To be removed after 2002-sep-30; use Transliterator::createInstance factory method.
*/
UnicodeToHexTransliterator(const UnicodeString& pattern,
UErrorCode& status);
@ -113,19 +115,19 @@ public:
/**
* Constructs a transliterator with the default prefix "\u"
* that outputs uppercase hex digits.
* @stable
* @deprecated To be removed after 2002-sep-30; use Transliterator::createInstance factory method.
*/
UnicodeToHexTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual ~UnicodeToHexTransliterator();
/**
* Copy constructor.
* @stable
* @deprecated To be removed after 2002-sep-30; use Transliterator::createInstance factory method.
*/
UnicodeToHexTransliterator(const UnicodeToHexTransliterator&);
@ -137,7 +139,7 @@ public:
/**
* Transliterator API.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual Transliterator* clone(void) const;
@ -166,31 +168,31 @@ public:
* <p>Limitations: There is no way to set the uppercase attribute
* in the pattern. (applyPattern() does not alter the uppercase
* attribute.)
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
void applyPattern(const UnicodeString& thePattern, UErrorCode& status);
/**
* Return this transliterator's pattern.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
const UnicodeString& toPattern(void) const;
/**
* Returns true if this transliterator outputs uppercase hex digits.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual UBool isUppercase(void) const;
/**
* Sets if this transliterator outputs uppercase hex digits.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual void setUppercase(UBool outputUppercase);
/**
* Implements {@link Transliterator#handleTransliterate}.
* @stable
* @deprecated To be removed after 2002-sep-30.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offsets,
UBool isIncremental) const;

View file

@ -1,59 +0,0 @@
/*
**********************************************************************
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 05/24/01 aliu Creation.
**********************************************************************
*/
#ifndef XFORMTRN_H
#define XFORMTRN_H
#include "unicode/translit.h"
U_NAMESPACE_BEGIN
/**
* An abstract class for transliterators based on a transform
* operation. To create a transliterator that implements a
* transformation, create a subclass of this class and implement the
* abstract <code>transform()</code> and <code>hasTransform()</code>
* methods.
* @author Alan Liu
*/
class U_I18N_API TransformTransliterator : public Transliterator {
protected:
/**
* Constructs a transliterator. For use by subclasses.
*/
TransformTransliterator(const UnicodeString& id,
UnicodeFilter* adoptedFilter);
/**
* Implements {@link Transliterator#handleTransliterate}.
*/
void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;
/**
* Subclasses must implement this method to determine whether a
* given character has a transform that is not equal to itself.
* This is approximately equivalent to <code>c !=
* transform(String.valueOf(c))</code>, where
* <code>String.valueOf(c)</code> returns a String containing the
* single character (not integer) <code>c</code>. Subclasses that
* transform all their input can simply return <code>true</code>.
*/
virtual UBool hasTransform(UChar32 c) const = 0;
/**
* Subclasses must implement this method to transform a string.
*/
virtual void transform(UnicodeString& s) const = 0;
};
U_NAMESPACE_END
#endif