ICU-1962 derive all ICU C++ classes from common UObject base class

X-SVN-Rev: 8953
This commit is contained in:
Markus Scherer 2002-06-27 01:19:20 +00:00
parent a81b115bdb
commit 5a81709c73
81 changed files with 313 additions and 150 deletions

View File

@ -11,6 +11,8 @@
#ifndef BRKDICT_H
#define BRKDICT_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "ucmp8.h"
#include "umemstrm.h"
@ -27,7 +29,7 @@ U_NAMESPACE_BEGIN
* transitions. Indexes are used to compress this array, taking
* advantage of the fact that this array will always be very sparse.
*/
class BreakDictionary {
class BreakDictionary : public UObject {
//=================================================================================
// data members
//=================================================================================

View File

@ -9,6 +9,7 @@
*/
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
//--------------------------------------------------------------------
@ -21,7 +22,7 @@
U_NAMESPACE_BEGIN
class CharString {
class CharString : public UObject {
public:
inline CharString(const UnicodeString& str);
inline ~CharString();

View File

@ -11,8 +11,10 @@
#ifndef DBBI_TBL_H
#define DBBI_TBL_H
#include "brkdict.h"
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/udata.h"
#include "brkdict.h"
U_NAMESPACE_BEGIN
@ -32,7 +34,7 @@ class DictionaryBasedBreakIterator;
// BreakDictionary and get rid of this class, but doing it this way
// was a convenient transition from earlier code, and time is short...
//
class DictionaryBasedBreakIteratorTables {
class DictionaryBasedBreakIteratorTables : public UObject {
private:
int32_t fRefCount;

View File

@ -25,6 +25,7 @@
#define DIGITLST_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include <float.h>
// Decimal digits in a 32-bit int
@ -60,7 +61,7 @@ U_NAMESPACE_BEGIN
* derived by placing all the digits of the list to the right of the
* decimal point, by 10^exponent.
*/
class U_COMMON_API DigitList { // Declare external to make compiler happy
class U_COMMON_API DigitList : public UObject { // Declare external to make compiler happy
public:
DigitList();
~DigitList();

View File

@ -11,8 +11,9 @@
#ifndef HASH_H
#define HASH_H
#include "uhash.h"
#include "unicode/unistr.h"
#include "unicode/uobject.h"
#include "uhash.h"
U_NAMESPACE_BEGIN
@ -23,7 +24,7 @@ U_NAMESPACE_BEGIN
*
* Hashtable is an INTERNAL CLASS.
*/
class Hashtable {
class Hashtable : public UObject {
UHashtable* hash;
public:

View File

@ -148,7 +148,6 @@ uprv_defaultCodePageForLocale(const char *locale)
* The LCID values come from winnt.h
*/
#include "unicode/locid.h"
#include "unicode/uloc.h"

View File

@ -19,8 +19,9 @@
//----------------------------------------------------------------------------
#ifndef MUTEX_H
#define MUTEX_H
#include "unicode/utypes.h"
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "umutex.h"
U_NAMESPACE_BEGIN
@ -55,8 +56,7 @@ U_NAMESPACE_BEGIN
// compiler!!
//
class U_COMMON_API Mutex
{
class U_COMMON_API Mutex : public UObject {
public:
inline Mutex(UMTX *mutex = NULL);
inline ~Mutex();

View File

@ -26,6 +26,8 @@
#ifndef __RBBIDATA_H__
#define __RBBIDATA_H__
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/udata.h"
#include "utrie.h"
@ -95,7 +97,7 @@ struct RBBIStateTable {
//
// The reference counting wrapper class
//
class RBBIDataWrapper {
class RBBIDataWrapper : public UObject {
public:
RBBIDataWrapper(const RBBIDataHeader *data, UErrorCode &status);
RBBIDataWrapper(UDataMemory* udm, UErrorCode &status);

View File

@ -1,6 +1,8 @@
#ifndef RBBINODE_H
#define RBBINODE_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
//
// class RBBINode
@ -14,7 +16,7 @@ U_NAMESPACE_BEGIN
class UnicodeSet;
class UVector;
class RBBINode {
class RBBINode : public UObject {
public:
enum NodeType {
setRef,

View File

@ -11,6 +11,8 @@
#ifndef RBBIRB_H
#define RBBIRB_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/rbbi.h"
#include "unicode/uniset.h"
#include "unicode/parseerr.h"
@ -39,7 +41,7 @@ class RBBITableBuilder;
// UnicodeSet parser to resolve references to $variables.
//
//--------------------------------------------------------------------------------
class RBBISymbolTableEntry { // The symbol table hash table contains one
class RBBISymbolTableEntry : public UObject { // The symbol table hash table contains one
public: // of these structs for each entry.
UnicodeString key;
RBBINode *val;
@ -82,7 +84,7 @@ public:
// class RBBIRuleBuilder The top-level class handling RBBI rule compiling.
//
//--------------------------------------------------------------------------------
class RBBIRuleBuilder {
class RBBIRuleBuilder : public UObject {
public:
// Create a rule based break iterator from a set of rules.

View File

@ -11,6 +11,8 @@
#ifndef RBBISCAN_H
#define RBBISCAN_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/rbbi.h"
#include "unicode/uniset.h"
#include "unicode/parseerr.h"
@ -48,7 +50,7 @@ enum EParseAction {dummy01, dummy02}; // Placeholder enum for the
// actions that are specified in the
// rule parsing state table.
class RBBIRuleScanner {
class RBBIRuleScanner : public UObject {
public:
struct RBBIRuleChar {

View File

@ -10,6 +10,8 @@
#ifndef RBBISETB_H
#define RBBISETB_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "rbbirb.h"
#include "uvector.h"
#include "uhash.h"
@ -65,7 +67,7 @@ struct RangeDescriptor {
//
class RBBISetBuilder {
class RBBISetBuilder : public UObject {
public:
RBBISetBuilder(RBBIRuleBuilder *rb);
~RBBISetBuilder();

View File

@ -12,7 +12,8 @@
#ifndef RBBITBLB_H
#define RBBITBLB_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/rbbi.h"
#include "rbbinode.h"
@ -30,7 +31,7 @@ class RBBIRuleScanner;
// There is no user-visible public API here.
//
class RBBITableBuilder {
class RBBITableBuilder : public UObject {
public:
// TODO: add a root node param to the constructor. We're going to have two
// builders, one for the forward table, and one for the reverse table.
@ -82,7 +83,7 @@ private:
//
// RBBIStateDescriptor - The DFA is constructed as a set of these descriptors,
// one for each state.
class RBBIStateDescriptor {
class RBBIStateDescriptor : public UObject {
public:
UBool fMarked;
int32_t fAccepting;

View File

@ -10,6 +10,9 @@
#ifndef SYMTABLE_H
#define SYMTABLE_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class ParsePosition;
@ -28,7 +31,7 @@ class UnicodeString;
* <p>Currently, RuleBasedTransliterator and UnicodeSet use this
* interface to share variable definitions.
*/
class SymbolTable {
class SymbolTable : public UObject {
public:
/**

View File

@ -18,6 +18,7 @@
#define BIDI_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/ubidi.h"
#ifndef XP_CPLUSPLUS
@ -40,7 +41,7 @@ U_NAMESPACE_BEGIN
* @see UBiDi
* @deprecated To be removed after 2002-sep-30; use the C API with UBiDi and ubidi_... functions.
*/
class U_COMMON_API BiDi {
class U_COMMON_API BiDi : public UObject {
public:
/** @memo Default constructor, calls ubidi_open().
* @deprecated

View File

@ -20,7 +20,8 @@
#ifndef BRKITER_H
#define BRKITER_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/chariter.h"
#include "unicode/locid.h"
@ -177,7 +178,7 @@ U_NAMESPACE_BEGIN
* \endcode
* </pre>
*/
class U_COMMON_API BreakIterator {
class U_COMMON_API BreakIterator : public UObject {
public:
virtual ~BreakIterator();

View File

@ -11,6 +11,7 @@
#define CHARITER_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
@ -81,7 +82,7 @@ U_NAMESPACE_BEGIN
*
* @stable
*/
class U_COMMON_API ForwardCharacterIterator {
class U_COMMON_API ForwardCharacterIterator : public UObject {
public:
/**
* Value returned by most of ForwardCharacterIterator's functions

View File

@ -12,7 +12,8 @@
#ifndef CONVERT_H
#define CONVERT_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/ucnv.h"
@ -36,8 +37,7 @@ U_NAMESPACE_BEGIN
* @see UConverter
* @deprecated To be removed after 2002-sep-30; use the C API with UConverter and ucnv_... functions.
*/
class U_COMMON_API UnicodeConverter
{
class U_COMMON_API UnicodeConverter : public UObject {
private:
/*Internal Data representation of the Converter*/
UConverter* myUnicodeConverter;

View File

@ -29,15 +29,16 @@
#ifndef LOCID_H
#define LOCID_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/putil.h"
/* all ULOC constants are now in uloc.h. */
#include "unicode/uloc.h"
#ifdef XP_CPLUSPLUS
#include "unicode/unistr.h"
/**
* \file
* \brief C++ API: Locale ID object.
*/
/**
* A <code>Locale</code> object represents a specific geographical, political,
@ -173,8 +174,7 @@
* @stable
*/
U_NAMESPACE_BEGIN
class U_COMMON_API Locale
{
class U_COMMON_API Locale : public UObject {
public:
#ifdef ICU_LOCID_USE_DEPRECATES
/**
@ -836,6 +836,4 @@ inline int32_t Locale::LocaleProxy::hashCode(void) const
#endif /* !ICU_LOCID_USE_DEPRECATES */
U_NAMESPACE_END
#endif /* XP_CPLUSPLUS */
#endif

View File

@ -10,6 +10,7 @@
#define NORMLZR_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/chariter.h"
#include "unicode/unorm.h"
@ -108,8 +109,7 @@ U_NAMESPACE_BEGIN
* @author Laura Werner, Mark Davis, Markus Scherer
* @draft ICU 2.0
*/
class U_COMMON_API Normalizer
{
class U_COMMON_API Normalizer : public UObject {
public:
/**
* If DONE is returned from an iteration function that returns a code point,

View File

@ -17,6 +17,7 @@
#define PARSEPOS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
@ -36,7 +37,7 @@ U_NAMESPACE_BEGIN
* @see java.text.Format
*/
class U_COMMON_API ParsePosition {
class U_COMMON_API ParsePosition : public UObject {
public:
/**
* Default constructor, the index starts with 0 as default.

View File

@ -15,6 +15,8 @@
#define REP_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class UnicodeString;
@ -54,7 +56,7 @@ class UnicodeString;
* @author Alan Liu
* @stable
*/
class U_COMMON_API Replaceable {
class U_COMMON_API Replaceable : public UObject {
public:
/**

View File

@ -46,8 +46,9 @@
#ifndef RESBUND_H
#define RESBUND_H
#include "unicode/ures.h"
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/ures.h"
#include "unicode/unistr.h"
#include "unicode/locid.h"
@ -155,7 +156,7 @@ class RuleBasedCollator;
* </pre>
* @stable
*/
class U_COMMON_API ResourceBundle {
class U_COMMON_API ResourceBundle : public UObject {
public:
/**
* Constructor

View File

@ -11,6 +11,7 @@
#define UNIFUNCT_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
@ -23,7 +24,7 @@ class TransliterationRuleData;
* that perform match and/or replace operations on Unicode strings.
* @author Alan Liu
*/
class U_COMMON_API UnicodeFunctor {
class U_COMMON_API UnicodeFunctor : public UObject {
public:

View File

@ -53,7 +53,7 @@ enum UMatchDegree {
* <code>UnicodeMatcher</code> defines a protocol for objects that can
* match a range of characters in a Replaceable string.
*/
class U_COMMON_API UnicodeMatcher {
class U_COMMON_API UnicodeMatcher /* not : public UObject because this is an interface/mixin class */ {
public:

View File

@ -22,6 +22,7 @@
#define UNISTR_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/rep.h"
struct UConverter; // unicode/ucnv.h
@ -3980,8 +3981,7 @@ U_NAMESPACE_BEGIN
//========================================
// class UCharReference
//========================================
class U_COMMON_API UCharReference
{
class U_COMMON_API UCharReference : public UObject {
public:
UCharReference();
inline UCharReference(UnicodeString *string,

View File

@ -0,0 +1,92 @@
/*
******************************************************************************
*
* Copyright (C) 2002, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* file name: uobject.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2002jun26
* created by: Markus W. Scherer
*/
#ifndef __UOBJECT_H__
#define __UOBJECT_H__
#include "unicode/utypes.h"
U_NAMESPACE_BEGIN
/**
* \file
* \brief C++ API: Common ICU base class UObject.
*/
/**
* UObject is the common ICU base class.
* All other ICU C++ classes are derived from UObject (starting with ICU 2.2).
*
* This is primarily to make it possible and simple to override the
* C++ memory management by adding new/delete operators to this base class.
* ICU itself will not declare and implement these new/delete operators, but
* users of ICU can modify the ICU code for the base class.
*/
class U_COMMON_API UObject {
public:
// destructor
virtual inline ~UObject() {}
// possible overrides for ICU4C C++ memory management,
// not provided by ICU itself;
// simple, non-class types are allocated using the macros in common/cmemory.h
// (uprv_malloc(), uprv_free(), uprv_realloc());
// they or something else could be used here to implement C++ new/delete
// for ICU4C C++ classes
// void *operator new(size_t size);
// void *operator new[](size_t size);
// void operator delete(void *p, size_t size);
// void operator delete[](void *p, size_t size);
// ICU4C "poor man's RTTI"
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
virtual inline UClassID getDynamicClassID() { return getStaticClassID(); }
protected:
// the following functions are protected to prevent instantiation and
// direct use of UObject itself
// default constructor
inline UObject() {}
// copy constructor
inline UObject(const UObject &other) {}
// some or all of the following "boilerplate" functions may be made public
// in a future ICU4C release when all subclasses implement them
// assignment operator
// (not virtual, see "Taligent's Guide to Designing Programs" pp.73..74)
// commented out because the implementation is the same as a compiler's default
// UObject &operator=(const UObject &other) { return *this; }
// comparison operators
virtual inline UBool operator==(const UObject &other) const { return this==&other; }
inline UBool operator!=(const UObject &other) const { return !operator==(other); }
// clone() commented out from the base class:
// some compilers do not support co-variant return types
// (i.e., subclasses would have to return UObject& as well, instead of SubClass&)
// virtual UObject *clone() const;
private:
// for ICU4C "poor man's RTTI"
static const char fgClassID;
};
U_NAMESPACE_END
#endif

View File

@ -4,12 +4,14 @@
* Corporation and others. All Rights Reserved.
**********************************************************************
* $Source: /xsrl/Nsvn/icu/icu/source/common/unicode/usetiter.h,v $
* $Revision: 1.1 $
* $Revision: 1.2 $
**********************************************************************
*/
#ifndef USETITER_H
#define USETITER_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
@ -49,7 +51,7 @@ class UnicodeString;
* @author M. Davis
* @draft
*/
class U_COMMON_API UnicodeSetIterator {
class U_COMMON_API UnicodeSetIterator : public UObject {
protected:

View File

@ -8,6 +8,7 @@
#define _UPROPSET_H_
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/uscript.h"
U_NAMESPACE_BEGIN
@ -58,7 +59,7 @@ class Hashtable;
* @author Alan Liu
* @internal
*/
class UnicodePropertySet {
class UnicodePropertySet : public UObject {
public:

View File

@ -22,9 +22,10 @@
*/
#include "unicode/utypes.h"
#include "cmemory.h"
#include "unicode/uobject.h"
#include "unicode/uset.h"
#include "unicode/uniset.h"
#include "cmemory.h"
U_CAPI USet* U_EXPORT2
uset_open(UChar32 start, UChar32 end) {
@ -117,7 +118,7 @@ U_NAMESPACE_BEGIN
* USet support API. Declaring a class a friend is more portable than
* trying to declare extern "C" functions as friends.
*/
class USetAccess {
class USetAccess : public UObject {
public:
// Try to have the compiler inline these
inline static int32_t getStringCount(const UnicodeSet& set) {

View File

@ -11,6 +11,7 @@
#define ICU_UTIL_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
//--------------------------------------------------------------------
@ -22,7 +23,7 @@ U_NAMESPACE_BEGIN
class UnicodeMatcher;
class U_COMMON_API ICU_Utility {
class U_COMMON_API ICU_Utility : public UObject {
public:
/**

View File

@ -13,6 +13,7 @@
#define UVECTOR_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "uhash.h"
U_NAMESPACE_BEGIN
@ -86,7 +87,7 @@ typedef void (U_EXPORT2 * U_CALLCONV UTokenAssigner)(UHashTok dst,
*
* @author Alan Liu
*/
class U_COMMON_API UVector {
class U_COMMON_API UVector : public UObject {
// NOTE: UVector uses the UHashKey (union of void* and int32_t) as
// its basic storage type. It uses UKeyComparator as its
// comparison function. It uses UObjectDeleter as its deleter

View File

@ -15,6 +15,7 @@
#define __SCRPTRUN_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/uscript.h"
struct ScriptRecord
@ -30,8 +31,7 @@ struct ParenStackEntry
UScriptCode scriptCode;
};
class ScriptRun
{
class ScriptRun : public UObject {
public:
ScriptRun();

View File

@ -14,6 +14,7 @@
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/ustream.h"
#include "unicode/ucnv.h"
#include "unicode/uchar.h"
@ -141,8 +142,7 @@ operator>>(STD_ISTREAM& stream, UnicodeString& str)
#include "unicode/unistr.h"
class U_COMMON_API UnicodeStringStreamer
{
class U_COMMON_API UnicodeStringStreamer : public UObject {
public:
static void streamIn(UnicodeString* string, FileStream* is);
static void streamOut(const UnicodeString* string, FileStream* os);

View File

@ -4,18 +4,21 @@
* and others. All Rights Reserved.
*****************************************************************
* $Source: /xsrl/Nsvn/icu/icu/source/i18n/anytrans.cpp,v $
* $Revision: 1.5 $
* $Revision: 1.6 $
*****************************************************************
* Date Name Description
* 06/06/2002 aliu Creation.
*****************************************************************
*/
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/nultrans.h"
#include "unicode/uscript.h"
#include "anytrans.h"
#include "uvector.h"
#include "tridpars.h"
#include "hash.h"
#include "unicode/nultrans.h"
#include "unicode/uscript.h"
//------------------------------------------------------------
// Constants
@ -57,7 +60,7 @@ U_NAMESPACE_BEGIN
* transliterator can consider common characters both before and after
* the scripts.
*/
class ScriptRunIterator {
class ScriptRunIterator : public UObject {
private:
const Replaceable& text;
int32_t textStart;

View File

@ -8,6 +8,8 @@
#ifndef CANITER_H
#define CANITER_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/uniset.h"
#include "unicode/normlzr.h"
@ -52,7 +54,7 @@ Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMB
*@author M. Davis
*@draft
*/
class U_I18N_API CanonicalIterator {
class U_I18N_API CanonicalIterator : public UObject {
public:
/**
*@param source string to get results for

View File

@ -25,6 +25,7 @@
#define DIGITLST_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include <float.h>
// Decimal digits in a 32-bit int
@ -60,7 +61,7 @@ U_NAMESPACE_BEGIN
* derived by placing all the digits of the list to the right of the
* decimal point, by 10^exponent.
*/
class U_COMMON_API DigitList { // Declare external to make compiler happy
class U_COMMON_API DigitList : public UObject { // Declare external to make compiler happy
public:
DigitList();
~DigitList();

View File

@ -308,10 +308,12 @@ using namespace std;
#include "unicode/datefmt.h"
#include "unistrm.h"
class FormattableStreamer
{
class FormattableStreamer /* not : public UObject because all methods are static */ {
public:
static void streamOut(ostream& stream, const Formattable& obj);
private:
FormattableStreamer() {} // private - forbid instantiation
};
// This is for debugging purposes only. This will send a displayable

View File

@ -16,8 +16,9 @@
#ifndef NFRLIST_H
#define NFRLIST_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "cmemory.h"
#include "unicode/umachine.h"
#include "nfrule.h"
@ -26,7 +27,7 @@ U_NAMESPACE_BEGIN
// unsafe class for internal use only. assume memory allocations succeed, indexes are valid.
// should be a template, but we can't use them
class NFRuleList {
class NFRuleList : public UObject {
protected:
NFRule** fStuff;
uint32_t fCount;

View File

@ -16,6 +16,8 @@
#ifndef NFRS_H
#define NFRS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/rbnf.h"
#if U_HAVE_RBNF
@ -27,7 +29,7 @@
U_NAMESPACE_BEGIN
class NFRuleSet {
class NFRuleSet : public UObject {
public:
NFRuleSet(UnicodeString* descriptions, int32_t index, UErrorCode& status);
void parseRules(UnicodeString& rules, const RuleBasedNumberFormat* owner, UErrorCode& status);

View File

@ -12,6 +12,7 @@
#if U_HAVE_RBNF
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
@ -25,7 +26,7 @@ class ParsePosition;
class RuleBasedNumberFormat;
class UnicodeString;
class NFRule {
class NFRule : public UObject {
public:
enum ERuleType {

View File

@ -16,7 +16,10 @@
#ifndef NFSUBS_H
#define NFSUBS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "nfrule.h"
#if U_HAVE_RBNF
#include "unicode/utypes.h"
@ -26,7 +29,7 @@
U_NAMESPACE_BEGIN
class NFSubstitution {
class NFSubstitution : public UObject {
int32_t pos;
const NFRuleSet* ruleSet;
const DecimalFormat* numberFormat;

View File

@ -8,6 +8,8 @@
#ifndef RBT_DATA_H
#define RBT_DATA_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "rbt_set.h"
U_NAMESPACE_BEGIN
@ -35,7 +37,7 @@ class Hashtable;
* data structure handles this. See the parsing code for more
* details.
*/
class U_I18N_API TransliterationRuleData {
class U_I18N_API TransliterationRuleData : public UObject {
public:

View File

@ -7,6 +7,16 @@
* 11/17/99 aliu Creation.
**********************************************************************
*/
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/parseerr.h"
#include "unicode/parsepos.h"
#include "unicode/putil.h"
#include "unicode/rbt.h"
#include "unicode/uchar.h"
#include "unicode/ustring.h"
#include "unicode/uniset.h"
#include "cstring.h"
#include "funcrepl.h"
#include "hash.h"
@ -19,13 +29,6 @@
#include "symtable.h"
#include "tridpars.h"
#include "uvector.h"
#include "unicode/parseerr.h"
#include "unicode/parsepos.h"
#include "unicode/putil.h"
#include "unicode/rbt.h"
#include "unicode/uchar.h"
#include "unicode/ustring.h"
#include "unicode/uniset.h"
#include "util.h"
// Operators
@ -212,7 +215,7 @@ UBool ParseData::isReplacer(UChar32 ch) {
* parse half of a rule. It is tightly coupled to the method
* RuleBasedTransliterator.Parser.parseRule().
*/
class RuleHalf {
class RuleHalf : public UObject {
public:

View File

@ -8,6 +8,8 @@
#ifndef RBT_PARS_H
#define RBT_PARS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/rbt.h"
#include "unicode/parseerr.h"
#include "unicode/unorm.h"
@ -22,7 +24,7 @@ class ParsePosition;
class UVector;
class StringMatcher;
class TransliteratorParser {
class TransliteratorParser : public UObject {
public:

View File

@ -8,6 +8,8 @@
#ifndef RBT_RULE_H
#define RBT_RULE_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/utrans.h"
#include "unicode/unimatch.h"
@ -47,7 +49,7 @@ class UnicodeFunctor;
*
* @author Alan Liu
*/
class TransliterationRule {
class TransliterationRule : public UObject {
private:

View File

@ -8,8 +8,10 @@
#ifndef RBT_SET_H
#define RBT_SET_H
#include "uvector.h"
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/utrans.h"
#include "uvector.h"
U_NAMESPACE_BEGIN
@ -23,7 +25,7 @@ class UnicodeString;
* A set of rules for a <code>RuleBasedTransliterator</code>.
* @author Alan Liu
*/
class U_I18N_API TransliterationRuleSet {
class U_I18N_API TransliterationRuleSet : public UObject {
/**
* Vector of rules, in the order added. This is used while the
* rule set is getting built. After that, freeze() reorders and

View File

@ -7,10 +7,9 @@
* 08/10/2001 aliu Creation.
**********************************************************************
*/
#include "transreg.h"
#include "rbt_data.h"
#include "rbt_pars.h"
#include "tridpars.h"
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/cpdtrans.h"
#include "unicode/nultrans.h"
#include "unicode/parseerr.h"
@ -19,6 +18,10 @@
#include "unicode/translit.h"
#include "unicode/uniset.h"
#include "unicode/uscript.h"
#include "transreg.h"
#include "rbt_data.h"
#include "rbt_pars.h"
#include "tridpars.h"
#include "charstr.h"
// Enable the following symbol to add debugging code that tracks the
@ -112,7 +115,7 @@ Transliterator* TransliteratorAlias::create(UParseError& pe,
* canonical form, or the script is transformed from an abbreviation
* to a full name.
*/
class Spec {
class Spec : public UObject {
public:
Spec(const UnicodeString& spec);
~Spec();
@ -315,7 +318,7 @@ static void DEBUG_useEntry(Entry* e) {
* for it. We could easily add this if there is a need for it in the
* future.
*/
class Entry {
class Entry : public UObject {
public:
enum Type {
RULES_FORWARD,

View File

@ -11,6 +11,7 @@
#define _TRANSREG_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/translit.h"
#include "hash.h"
#include "uvector.h"
@ -34,7 +35,7 @@ class UnicodeString;
* Why all the shenanigans? To prevent circular calls between
* the registry code and the transliterator code that deadlocks.
*/
class TransliteratorAlias {
class TransliteratorAlias : public UObject {
public:
/**
* Construct a simple alias.
@ -93,7 +94,7 @@ class TransliteratorAlias {
*
* @author Alan Liu
*/
class TransliteratorRegistry {
class TransliteratorRegistry : public UObject {
public:

View File

@ -11,6 +11,7 @@
#define TRIDPARS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
@ -41,7 +42,7 @@ class UVector;
*
* @author Alan Liu
*/
class TransliteratorIDParser {
class TransliteratorIDParser : public UObject {
public:
@ -59,7 +60,7 @@ class TransliteratorIDParser {
* 'filter' is the parsed filter pattern, or null if there was no
* filter.
*/
class Specs {
class Specs : public UObject {
public:
UnicodeString source; // not null
UnicodeString target; // not null
@ -86,7 +87,7 @@ class TransliteratorIDParser {
* 'filter' may be null, if there is none, or non-null and
* non-empty.
*/
class SingleID {
class SingleID : public UObject {
public:
UnicodeString canonID;
UnicodeString basicID;

View File

@ -23,6 +23,8 @@
#ifndef CALENDAR_H
#define CALENDAR_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/locid.h"
#include "unicode/timezone.h"
@ -139,7 +141,7 @@ U_NAMESPACE_BEGIN
*
* @stable
*/
class U_I18N_API Calendar {
class U_I18N_API Calendar : public UObject {
public:
/**

View File

@ -27,6 +27,8 @@
#ifndef COLEITR_H
#define COLEITR_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/tblcoll.h"
#include "unicode/ucoleitr.h"
@ -108,8 +110,7 @@ U_NAMESPACE_BEGIN
* @see RuleBasedCollator
* @version 1.8 Jan 16 2001
*/
class U_I18N_API CollationElementIterator
{
class U_I18N_API CollationElementIterator : public UObject {
public:
// CollationElementIterator public data member ------------------------------

View File

@ -44,6 +44,8 @@
#ifndef COLL_H
#define COLL_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/ucol.h"
#include "unicode/normlzr.h"
#include "unicode/locid.h"
@ -151,8 +153,7 @@ class CollationKey;
* @version 2.0 11/15/01
*/
class U_I18N_API Collator
{
class U_I18N_API Collator : public UObject {
public:
// Collator public enums -----------------------------------------------

View File

@ -26,6 +26,7 @@
#define DCFMTSYM_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/locid.h"
U_NAMESPACE_BEGIN
@ -69,7 +70,7 @@ U_NAMESPACE_BEGIN
* contiguous in Unicode, from 0 to 9. Other digits sets (such as
* superscripts) would need a different subclass.
*/
class U_I18N_API DecimalFormatSymbols {
class U_I18N_API DecimalFormatSymbols : public UObject {
public:
/**
* Constants for specifying a number format symbol.

View File

@ -19,6 +19,7 @@
#define DTFMTSYM_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/locid.h"
#include "unicode/resbund.h"
@ -57,7 +58,7 @@ class SimpleDateFormat;
* New DateFormatSymbols sub-classes may be added to support SimpleDateFormat
* for date-time formatting for additional locales.
*/
class U_I18N_API DateFormatSymbols {
class U_I18N_API DateFormatSymbols : public UObject {
public:
/**
* Construct a DateFormatSymbols object by loading format data from

View File

@ -22,6 +22,7 @@
#define FIELDPOS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
@ -91,7 +92,7 @@ U_NAMESPACE_BEGIN
* \endcode
* </pre>
*/
class U_I18N_API FieldPosition {
class U_I18N_API FieldPosition : public UObject {
public:
/**
* DONT_CARE may be specified as the field to indicate that the

View File

@ -17,6 +17,7 @@
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
@ -37,7 +38,7 @@ U_NAMESPACE_BEGIN
* currently must explicitly check for type, but that seems like overkill at
* this point.
*/
class U_I18N_API Formattable {
class U_I18N_API Formattable : public UObject {
public:
/**
* This enum is only used to let callers distinguish between

View File

@ -22,6 +22,7 @@
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/fmtable.h"
#include "unicode/fieldpos.h"
@ -83,7 +84,7 @@ U_NAMESPACE_BEGIN
* \endcode
* </pre>
*/
class U_I18N_API Format {
class U_I18N_API Format : public UObject {
public:
virtual ~Format();

View File

@ -10,6 +10,8 @@
#ifndef SEARCH_H
#define SEARCH_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/chariter.h"
#include "unicode/brkiter.h"
@ -58,7 +60,7 @@ U_NAMESPACE_BEGIN
*
* @see StringSearch
*/
class U_I18N_API SearchIterator {
class U_I18N_API SearchIterator : public UObject {
public:

View File

@ -24,6 +24,7 @@
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/coll.h"
@ -84,7 +85,7 @@ class RuleBasedCollator;
* @version 1.3 12/18/96
* @author Helena Shih
*/
class U_I18N_API CollationKey {
class U_I18N_API CollationKey : public UObject {
public:
/**
* This creates an empty collation key based on the null string. An empty

View File

@ -26,6 +26,8 @@
#ifndef TIMEZONE_H
#define TIMEZONE_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
@ -102,7 +104,7 @@ U_NAMESPACE_BEGIN
* your machine is set up correctly), TimeZone::createDefault() will return a TimeZone
* for Japanese Standard Time ("Asia/Tokyo").
*/
class U_I18N_API TimeZone {
class U_I18N_API TimeZone : public UObject {
public:
/**
* @stable

View File

@ -8,6 +8,8 @@
#ifndef TRANSLIT_H
#define TRANSLIT_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
#include "unicode/parseerr.h"
#include "unicode/utrans.h" // UTransPosition, UTransDirection
@ -227,7 +229,7 @@ class TransliteratorIDParser;
* @author Alan Liu
* @stable
*/
class U_I18N_API Transliterator {
class U_I18N_API Transliterator : public UObject {
private:

View File

@ -10,6 +10,7 @@
#define UNIFLTLG_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
@ -29,7 +30,7 @@ class UnicodeFilter;
* Unicode characters. Likewise, createAnd(g, NULL) returns g->clone(),
* and createAnd(NULL, NULL) returns NULL.
*/
class U_I18N_API UnicodeFilterLogic {
class U_I18N_API UnicodeFilterLogic : public UObject {
public:

View File

@ -26,7 +26,7 @@ class UnicodeString;
* <p>This is a mixin class.
* @author Alan Liu
*/
class U_I18N_API UnicodeReplacer {
class U_I18N_API UnicodeReplacer /* not : public UObject because this is an interface/mixin class */ {
public:

View File

@ -13,15 +13,13 @@
U_NAMESPACE_BEGIN
class Shaper
{
class Shaper : public UObject {
public:
virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isloate) = 0;
virtual void shape(le_int32 outIndex, le_int32 shapeOffset) = 0;
};
class ArabicShaping
{
class ArabicShaping : public UObject {
public:
// shaping bit masks
enum ShapingBitMasks

View File

@ -15,8 +15,7 @@
U_NAMESPACE_BEGIN
class GlyphIterator
{
class GlyphIterator : public UObject {
public:
GlyphIterator(LEGlyphID *theGlyphs, GlyphPositionAdjustment *theGlyphPositionAdjustments, le_int32 theGlyphCount,
le_bool rightToLeft, le_uint16 theLookupFlags, LETag theFeatureTag, const LETag *theGlyphTags[],

View File

@ -13,8 +13,7 @@
U_NAMESPACE_BEGIN
class GlyphPositionAdjustment
{
class GlyphPositionAdjustment : public UObject {
public:
GlyphPositionAdjustment();

View File

@ -13,8 +13,7 @@
U_NAMESPACE_BEGIN
class HebrewShaping
{
class HebrewShaping : public UObject {
public:
static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,
le_bool rightToLeft, const LETag **tags);

View File

@ -12,8 +12,7 @@
U_NAMESPACE_BEGIN
class ReorderingOutput
{
class ReorderingOutput : public UObject {
private:
le_int32 fOutIndex;

View File

@ -125,8 +125,7 @@ struct IndicClassTable
static const IndicClassTable *getScriptClassTable(le_int32 scriptCode);
};
class IndicReordering
{
class IndicReordering : public UObject {
public:
static le_int32 getWorstCaseExpansion(le_int32 scriptCode);

View File

@ -20,8 +20,7 @@ U_NAMESPACE_BEGIN
* and character mirroring - replacing a character which has both a left and a right
* hand form with the opposite form.
*/
class LECharMapper
{
class LECharMapper /* not : public UObject because this is an interface/mixin class */ {
public:
/**
* This method does the adjustments.
@ -43,8 +42,7 @@ public:
* Each instance of an LEFontInstance represents a renerable instance of a font. (i.e. a
* single font at a particular point size, with a particular transform)
*/
class LEFontInstance
{
class LEFontInstance /* not : public UObject because this is an interface/mixin class */ {
public:
/**

View File

@ -16,8 +16,7 @@ U_NAMESPACE_BEGIN
* This is a helper class that is used to
* recognize a set of glyph indices.
*/
class LEGlyphFilter
{
class LEGlyphFilter /* not : public UObject because this is an interface/mixin class */ {
public:
/**
* This method is used to test a particular

View File

@ -29,8 +29,7 @@ U_NAMESPACE_BEGIN
* All methods are static and inline in an attempt to induce the compiler
* to do most of the calculations at compile time.
*/
class LESwaps
{
class LESwaps /* not : public UObject because all methods are static */ {
public:
/**
@ -74,6 +73,9 @@ public:
{
return swapWord((le_uint16) (value >> 16)) | (swapWord((le_uint16) value) << 16);
};
private:
LESwaps() {} // private - forbid instantiation
};
U_NAMESPACE_END

View File

@ -10,6 +10,7 @@
#define __LETYPES_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN

View File

@ -61,8 +61,7 @@ class LEGlyphFilter;
* @see LEFontInstance
* @see ScriptAndLanguageTags.h
*/
class U_LAYOUT_API LayoutEngine
{
class U_LAYOUT_API LayoutEngine : public UObject {
protected:
/**
* The number of glyphs in the output

View File

@ -19,8 +19,7 @@
U_NAMESPACE_BEGIN
class LookupProcessor
{
class LookupProcessor : public UObject {
public:
static const LETag notSelected;
static const LETag defaultFeature;

View File

@ -13,8 +13,7 @@
U_NAMESPACE_BEGIN
class OpenTypeUtilities
{
class OpenTypeUtilities /* not : public UObject because all methods are static */ {
public:
static le_int8 highBit(le_int32 value);
static Offset getTagOffset(LETag tag, const TagAndOffsetRecord *records, le_int32 recordCount);
@ -22,6 +21,9 @@ public:
static le_int32 search(le_uint16 value, const le_uint16 array[], le_int32 count);
static le_int32 search(le_uint32 value, const le_uint32 array[], le_int32 count);
static void sort(le_uint16 *array, le_int32 count);
private:
OpenTypeUtilities() {} // private - forbid instantiation
};
U_NAMESPACE_END

View File

@ -13,8 +13,7 @@
U_NAMESPACE_BEGIN
class SubtableProcessor
{
class SubtableProcessor : public UObject {
public:
virtual void process(LEGlyphID *glyphs, le_int32 *charIndices, le_int32 glyph) = 0;
virtual ~SubtableProcessor();

View File

@ -32,8 +32,7 @@ public:
virtual le_bool filter(LEGlyphID glyph);
};
class ThaiShaping
{
class ThaiShaping : public UObject {
public:
enum {

View File

@ -9,6 +9,7 @@
#define __LOENGINE_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/uscript.h"
#include "unicode/unistr.h"
@ -45,8 +46,7 @@ U_NAMESPACE_BEGIN
* @see LayoutEngine.h
* @see LEFontInstance.h
*/
class U_LAYOUT_API ICULayoutEngine
{
class U_LAYOUT_API ICULayoutEngine : public UObject {
private:
/**
* This holds the instance of LayoutEngine that does all

View File

@ -414,19 +414,19 @@ UnicodeStringTest::TestExtract()
}
for (int32_t i = 0; i < 12; i++) {
if (test1[(int32_t)(11 + i)] != test2[i]) {
if (test1.charAt((int32_t)(11 + i)) != test2.charAt(i)) {
errln(UnicodeString("extracting into a UnicodeString failed at position ") + i);
break;
}
if (test1[(int32_t)(11 + i)] != test3[i]) {
if (test1.charAt((int32_t)(11 + i)) != test3[i]) {
errln(UnicodeString("extracting into an array of UChar failed at position ") + i);
break;
}
if (((char)test1[(int32_t)(11 + i)]) != test4b[i]) {
if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) {
errln(UnicodeString("extracting into an array of char failed at position ") + i);
break;
}
if (test1[(int32_t)(11 + i)] != test5[i]) {
if (test1.charAt((int32_t)(11 + i)) != test5.charAt(i)) {
errln(UnicodeString("extracting with extractBetween failed at position ") + i);
break;
}