ICU-1264 added namspace support where possible.

X-SVN-Rev: 6124
This commit is contained in:
Helena Chapman 2001-10-08 23:26:58 +00:00
parent 0ac7c81827
commit d816eefc57
201 changed files with 959 additions and 251 deletions

View file

@ -19,3 +19,4 @@
// provide an object for the implementations of the member functions of BiDi
#include "unicode/bidi.h"

View file

@ -7,6 +7,8 @@
#include "unicode/chariter.h"
U_NAMESPACE_BEGIN
CharacterIterator::CharacterIterator(int32_t length)
: textLength(length), pos(0), begin(0), end(length) {
if(textLength < 0) {
@ -77,3 +79,5 @@ CharacterIterator::first32PostInc(void) {
setToStart();
return next32PostInc();
}
U_NAMESPACE_END

View file

@ -7,6 +7,15 @@
/* C++ wrappers for the ICUs Codeset Conversion Routines*/
#include "unicode/utypes.h"
U_NAMESPACE_BEGIN
class Locale;
class UnicodeString;
class Mutex;
U_NAMESPACE_END
#include "unicode/resbund.h"
#include "cmemory.h"
#include "mutex.h"
@ -17,6 +26,7 @@
#include "unicode/convert.h"
#include "ucln_cmn.h"
/* list of converter and alias names */
static const char **availableConverterNames=NULL;
static int32_t availableConverterNamesCount=0;
@ -32,6 +42,7 @@ UBool UnicodeConverter_cleanup()
return TRUE;
}
U_NAMESPACE_BEGIN
UnicodeConverter::UnicodeConverter()
{
UErrorCode err = U_ZERO_ERROR;
@ -451,7 +462,7 @@ int32_t UnicodeConverter::flushCache()
return ucnv_flushCache();
}
/* HSYS: To be cleaned up. The usage of UChar* and UnicodeString in
/* TODO: To be cleaned up. The usage of UChar* and UnicodeString in
the C++ APIs need to be revisited. */
void UnicodeConverter::fixFileSeparator(UnicodeString& source) const {
if(this==NULL || &source==NULL || source.length()<=0) {
@ -466,3 +477,4 @@ UBool UnicodeConverter::isAmbiguous(void) const
return ucnv_isAmbiguous(myUnicodeConverter);
}
U_NAMESPACE_END

View file

@ -52,6 +52,8 @@ enum {
LONG_MIN_REP_LENGTH = sizeof(LONG_MIN_REP) - 1 //Ignore the NULL at the end
};
U_NAMESPACE_BEGIN
// -------------------------------------
// default constructor
@ -563,4 +565,6 @@ DigitList::initializeLONG_MIN_REP()
}
}*/
U_NAMESPACE_END
//eof

View file

@ -39,6 +39,8 @@ typedef enum EDigitListValues {
MAX_DEC_DIGITS = DBL_DIG + DIGIT_PADDING + MAX_EXPONENT
} EDigitListValues;
U_NAMESPACE_BEGIN
/**
* Digit List. Private to DecimalFormat. Handles the transcoding
* between numeric values and strings of characters. Only handles
@ -197,5 +199,6 @@ DigitList::append(char digit)
}
#endif // _DIGITLST
U_NAMESPACE_END
//eof

View file

@ -14,6 +14,8 @@
#include "uhash.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
/**
* Hashtable is a thin C++ wrapper around UHashtable, a general-purpose void*
* hashtable implemented in C. Hashtable is designed to be idiomatic and
@ -121,4 +123,6 @@ inline const UHashElement* Hashtable::nextElement(int32_t& pos) const {
return uhash_nextElement(hash, &pos);
}
U_NAMESPACE_END
#endif

View file

@ -38,6 +38,100 @@
#include "uhash.h"
#include "ucln_cmn.h"
U_NAMESPACE_BEGIN
static Locale* availableLocaleList = NULL;
static int32_t availableLocaleListCount;
typedef enum ELocalePos {
eENGLISH,
eFRENCH,
eGERMAN,
eITALIAN,
eJAPANESE,
eKOREAN,
eCHINESE,
eFRANCE,
eGERMANY,
eITALY,
eJAPAN,
eKOREA,
eCHINA, /* Alias for PRC */
eTAIWAN,
eUK,
eUS,
eCANADA,
eCANADA_FRENCH,
eDEFAULT,
eMAX_LOCALES
} ELocalePos;
/* Use void * to make it properly aligned */
/* Add 1 for rounding */
static void *gByteLocaleCache[(eMAX_LOCALES + 1) * sizeof(Locale) / sizeof(void*)];
static Locale *gLocaleCache = NULL;
U_NAMESPACE_END
UBool
locale_cleanup(void)
{
U_NAMESPACE_USE
if (availableLocaleList) {
delete []availableLocaleList;
availableLocaleList = NULL;
}
availableLocaleListCount = 0;
if (gLocaleCache) {
gLocaleCache[eDEFAULT].~Locale();
gLocaleCache = NULL;
}
return TRUE;
}
void U_NAMESPACE_QUALIFIER locale_set_default_internal(const char *id)
{
U_NAMESPACE_USE
#ifdef ICU_LOCID_USE_DEPRECATES
Locale::fgDefaultLocale.init(id);
#else
if (gLocaleCache == NULL) {
Locale::initLocaleCache();
}
{
Mutex lock;
gLocaleCache[eDEFAULT].init(id);
}
#endif
}
/* sfb 07/21/99 */
U_CFUNC void
locale_set_default(const char *id)
{
U_NAMESPACE_USE
locale_set_default_internal(id);
}
/* end */
U_CFUNC const char *
locale_get_default(void)
{
U_NAMESPACE_USE
return Locale::getDefault().getName();
}
U_NAMESPACE_BEGIN
/*Character separating the posix id fields*/
// '_'
// In the platform codepage.
@ -46,9 +140,6 @@
/**
* static variables
*/
static Locale* availableLocaleList = NULL;
static int32_t availableLocaleListCount;
#ifdef ICU_LOCID_USE_DEPRECATES
Locale Locale::fgDefaultLocale;
@ -81,32 +172,6 @@ const Locale Locale::CANADA ("en", "CA");
const Locale Locale::CANADA_FRENCH("fr", "CA");
#else
typedef enum ELocalePos {
eENGLISH,
eFRENCH,
eGERMAN,
eITALIAN,
eJAPANESE,
eKOREAN,
eCHINESE,
eFRANCE,
eGERMANY,
eITALY,
eJAPAN,
eKOREA,
eCHINA, /* Alias for PRC */
eTAIWAN,
eUK,
eUS,
eCANADA,
eCANADA_FRENCH,
eDEFAULT,
eMAX_LOCALES
} ELocalePos;
const Locale::LocaleProxy Locale::ENGLISH = {eENGLISH};
const Locale::LocaleProxy Locale::FRENCH = {eFRENCH};
const Locale::LocaleProxy Locale::GERMAN = {eGERMAN};
@ -130,12 +195,6 @@ const Locale::LocaleProxy Locale::US = {eUS};
const Locale::LocaleProxy Locale::CANADA = {eCANADA};
const Locale::LocaleProxy Locale::CANADA_FRENCH={eCANADA_FRENCH};
/* Use void * to make it properly aligned */
/* Add 1 for rounding */
static void *gByteLocaleCache[(eMAX_LOCALES + 1) * sizeof(Locale) / sizeof(void*)];
static Locale *gLocaleCache = NULL;
Locale::LocaleProxy::operator const Locale&(void) const
{
return Locale::getLocale(magicLocaleNumber);
@ -436,37 +495,6 @@ Locale::getDefault()
#endif
}
void locale_set_default_internal(const char *id)
{
#ifdef ICU_LOCID_USE_DEPRECATES
Locale::fgDefaultLocale.init(id);
#else
if (gLocaleCache == NULL) {
Locale::initLocaleCache();
}
{
Mutex lock;
gLocaleCache[eDEFAULT].init(id);
}
#endif
}
/* sfb 07/21/99 */
U_CFUNC void
locale_set_default(const char *id)
{
locale_set_default_internal(id);
}
/* end */
U_CFUNC const char *
locale_get_default(void)
{
return Locale::getDefault().getName();
}
void
Locale::setDefault( const Locale& newLocale,
UErrorCode& status)
@ -709,22 +737,6 @@ Locale::getDisplayName(const Locale &displayLocale,
return result;
}
UBool
locale_cleanup(void)
{
if (availableLocaleList) {
delete []availableLocaleList;
availableLocaleList = NULL;
}
availableLocaleListCount = 0;
if (gLocaleCache) {
gLocaleCache[eDEFAULT].~Locale();
gLocaleCache = NULL;
}
return TRUE;
}
const Locale*
Locale::getAvailableLocales(int32_t& count)
{
@ -971,5 +983,4 @@ Locale::initLocaleCache(void)
#endif
//eof
U_NAMESPACE_END

View file

@ -23,6 +23,8 @@
#include "umutex.h"
U_NAMESPACE_BEGIN
//----------------------------------------------------------------------------
// Code within this library which accesses protected data
// should instantiate a Mutex object while doing so. You should make your own
@ -74,6 +76,8 @@ inline Mutex::~Mutex()
umtx_unlock(fMutex);
}
U_NAMESPACE_END
#endif //_MUTEX_
//eof

View file

@ -14,6 +14,8 @@
#include "unicode/normlzr.h"
#include "unormimp.h"
U_NAMESPACE_BEGIN
//-------------------------------------------------------------------------
// Constructors and other boilerplate
//-------------------------------------------------------------------------
@ -525,3 +527,4 @@ Normalizer::previousNormalize() {
currentIndex=text->getIndex();
return U_SUCCESS(errorCode) && buffer.length()>0;
}
U_NAMESPACE_END

View file

@ -51,6 +51,8 @@
#include "uresimp.h"
U_NAMESPACE_BEGIN
/*-----------------------------------------------------------------------------
* Implementation Notes
*
@ -418,3 +420,4 @@ const Locale &ResourceBundle::getLocale(void) const
}
//eof
U_NAMESPACE_END

View file

@ -16,6 +16,7 @@
#include "unicode/chariter.h"
#include "unicode/schriter.h"
U_NAMESPACE_BEGIN
const char StringCharacterIterator::fgClassID = 0;
@ -111,3 +112,4 @@ void
StringCharacterIterator::getText(UnicodeString& result) {
result = text;
}
U_NAMESPACE_END

View file

@ -8,6 +8,8 @@
#include "unicode/uchriter.h"
#include "uhash.h"
U_NAMESPACE_BEGIN
const char UCharCharacterIterator::fgClassID = 0;
UCharCharacterIterator::UCharCharacterIterator()
@ -357,3 +359,4 @@ UCharCharacterIterator::getText(UnicodeString& result) {
result = UnicodeString(text, textLength);
}
U_NAMESPACE_END

View file

@ -37,6 +37,7 @@ ucln_registerCleanup(ECleanupLibraryType type,
void u_cleanup(void)
{
ECleanupLibraryType libType = UCLN_START;
while (++libType < UCLN_COMMON)
{

View file

@ -35,6 +35,11 @@
#include "ucnv_cnv.h"
#include "ucnv_bld.h"
extern UHashtable *SHARED_DATA_HASHTABLE;
extern UConverter *createConverter (const char *converterName, UErrorCode * err);
extern void copyPlatformString(char *platformString, UConverterPlatform pltfrm);
extern UBool deleteSharedConverterData(UConverterSharedData * deadSharedData);
#if 0
/* debugging for converters */
# include <stdio.h>
@ -320,6 +325,8 @@ void ucnv_getSubstChars (const UConverter * converter,
return;
}
uprv_memcpy (mySubChar, converter->subChar, converter->subCharLen); /*fills in the subchars */
*len = converter->subCharLen; /*store # of bytes copied to buffer */
uprv_memcpy (mySubChar, converter->subChar, converter->subCharLen); /*fills in the subchars */
*len = converter->subCharLen; /*store # of bytes copied to buffer */
}

View file

@ -21,6 +21,7 @@
#include "unicode/ucnv.h"
#include "unicode/ucnv_err.h"
/* size of the overflow buffers in UConverter, enough for escaping callbacks */
#define UCNV_ERROR_BUFFER_LENGTH 32

View file

@ -21,12 +21,14 @@
U_CAPI int32_t
uhash_hashUnicodeString(const UHashKey key) {
U_NAMESPACE_USE
const UnicodeString *str = (const UnicodeString*) key.pointer;
return (str == NULL) ? 0 : str->hashCode();
}
U_CAPI int32_t
uhash_hashCaselessUnicodeString(const UHashKey key) {
U_NAMESPACE_USE
const UnicodeString *str = (const UnicodeString*) key.pointer;
if (str == NULL) {
return 0;
@ -39,11 +41,13 @@ uhash_hashCaselessUnicodeString(const UHashKey key) {
U_CAPI void
uhash_deleteUnicodeString(void *obj) {
U_NAMESPACE_USE
delete (UnicodeString*) obj;
}
U_CAPI UBool
uhash_compareUnicodeString(const UHashKey key1, const UHashKey key2) {
U_NAMESPACE_USE
const UnicodeString *str1 = (const UnicodeString*) key1.pointer;
const UnicodeString *str2 = (const UnicodeString*) key2.pointer;
if (str1 == str2) {
@ -57,6 +61,7 @@ uhash_compareUnicodeString(const UHashKey key1, const UHashKey key2) {
U_CAPI UBool
uhash_compareCaselessUnicodeString(const UHashKey key1, const UHashKey key2) {
U_NAMESPACE_USE
const UnicodeString *str1 = (const UnicodeString*) key1.pointer;
const UnicodeString *str2 = (const UnicodeString*) key2.pointer;
if (str1 == str2) {
@ -73,6 +78,7 @@ uhash_compareCaselessUnicodeString(const UHashKey key1, const UHashKey key2) {
*/
U_CAPI void
uhash_deleteHashtable(void *obj) {
U_NAMESPACE_USE
delete (Hashtable*) obj;
}
@ -81,6 +87,7 @@ uhash_deleteHashtable(void *obj) {
*/
U_CAPI void
uhash_deleteUVector(void *obj) {
U_NAMESPACE_USE
delete (UVector*) obj;
}

View file

@ -37,6 +37,8 @@
#include "unicode/uchar.h"
#include "unicode/unicode.h"
U_NAMESPACE_BEGIN
/*
* Private (sort of) constructors etc., defined only to prevent
* instantiation and subclassing. Therefore, empty.
@ -48,3 +50,4 @@ const Unicode &
Unicode::operator=(const Unicode &) {
return *this;
}
U_NAMESPACE_END

View file

@ -24,6 +24,7 @@
# error This is a C++ header file.
#endif
U_NAMESPACE_BEGIN
/**
* This class is deprecated and will be removed.
* Use the C API with the UBiDi type and ubidi_... functions.
@ -383,4 +384,6 @@ BiDi::writeReverse(const UChar *src, int32_t srcLength,
return ubidi_writeReverse(src, srcLength, dest, destSize, options, &rErrorCode);
}
U_NAMESPACE_END
#endif

View file

@ -13,6 +13,7 @@
#include "unicode/utypes.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
/**
* Abstract class that defines an API for forward-only iteration
* on text objects.
@ -587,4 +588,5 @@ CharacterIterator::getLength(void) const {
return textLength;
}
U_NAMESPACE_END
#endif

View file

@ -16,6 +16,7 @@
#include "unicode/unistr.h"
#include "unicode/ucnv.h"
U_NAMESPACE_BEGIN
/**
* This class is deprecated and will be removed.
* Use the more powerful C conversion API with the UConverter type and ucnv_... functions.
@ -408,4 +409,5 @@ UBool isAmbiguous(void) const;
*/
typedef UnicodeConverter UnicodeConverterCPP; /* Backwards compatibility. */
U_NAMESPACE_END
#endif

View file

@ -32,6 +32,7 @@
#include "unicode/putil.h"
#define ULOC_LANG_CAPACITY 12
#define ULOC_COUNTRY_CAPACITY 4
#define ULOC_FULLNAME_CAPACITY 50
@ -172,6 +173,7 @@
* </pre>
* </blockquote>
*/
U_NAMESPACE_BEGIN
class U_COMMON_API Locale
{
public:
@ -212,6 +214,7 @@ public:
* @deprecated Remove after 2002-aug-31. Use one of the other Locale get functions.
*/
typedef struct U_COMMON_API LocaleProxy {
int32_t magicLocaleNumber; /* Try not to access this. This is not meant for normal use. */
/** Calls Locale's equivalent function */
@ -805,6 +808,7 @@ inline int32_t Locale::LocaleProxy::hashCode(void) const
return ((const Locale)*this).hashCode();
}
#endif /* !ICU_LOCID_USE_DEPRECATES */
U_NAMESPACE_END
#endif /* XP_CPLUSPLUS */
#endif

View file

@ -14,6 +14,7 @@
#include "unicode/chariter.h"
#include "unicode/unorm.h"
U_NAMESPACE_BEGIN
/**
* \file
* \brief C++ API: Unicode Normalization
@ -1013,4 +1014,5 @@ inline Normalizer::EMode Normalizer::getNormalizerEMode(
return Normalizer::DECOMP_COMPAT;
}
U_NAMESPACE_END
#endif // _NORMLZR

View file

@ -73,6 +73,12 @@
#define HAVE_BOOL_T @HAVE_BOOL_T@
#endif
/* Define whether namespace is supported */
#ifndef U_HAVE_NAMESPACE
#define U_HAVE_NAMESPACE @U_HAVE_NAMESPACE@
#endif
/* Determines the endianness of the platform */
#define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@

View file

@ -36,6 +36,9 @@
/* Define whether inttypes.h is available */
#define U_HAVE_INTTYPES_H 0
/* Define whether namespace is supported */
#define U_HAVE_NAMESPACE 1
/*
* Define what support for C++ streams is available.
* If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available

View file

@ -24,6 +24,9 @@
/* Define whether inttypes.h is available */
#define U_HAVE_INTTYPES_H 0
/* Define whether namespace is supported */
#define U_HAVE_NAMESPACE 0
/*
* Define what support for C++ streams is available.
* If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available

View file

@ -25,6 +25,9 @@
/* Define whether inttypes.h is available */
#define U_HAVE_INTTYPES_H 0
/* Define whether namespace is supported */
#define U_HAVE_NAMESPACE 0
/*
* Define what support for C++ streams is available.
* If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available

View file

@ -24,6 +24,8 @@
/* Define whether inttypes.h is available */
#define U_HAVE_INTTYPES_H 0
/* Define whether namespace is supported */
#define U_HAVE_NAMESPACE 1
/*
* Define what support for C++ streams is available.
* If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available

View file

@ -15,6 +15,7 @@
#define REP_H
#include "unicode/utypes.h"
U_NAMESPACE_BEGIN
class UnicodeString;
@ -194,4 +195,6 @@ Replaceable::char32At(UTextOffset offset) const {
return getChar32At(offset);
}
U_NAMESPACE_END
#endif

View file

@ -51,6 +51,7 @@
#include "unicode/unistr.h"
#include "unicode/locid.h"
U_NAMESPACE_BEGIN
/* forward declarations */
class RuleBasedCollator;
@ -431,4 +432,5 @@ private:
Locale fRealLocale;
};
U_NAMESPACE_END
#endif

View file

@ -22,6 +22,7 @@
#include "unicode/chariter.h"
#include "unicode/uchriter.h"
U_NAMESPACE_BEGIN
/**
* A concrete subclass of CharacterIterator that iterates over the
* characters (code units or code points) in a UnicodeString.
@ -147,4 +148,5 @@ private:
static const char fgClassID;
};
U_NAMESPACE_END
#endif

View file

@ -11,6 +11,7 @@
#include "unicode/utypes.h"
#include "unicode/chariter.h"
U_NAMESPACE_BEGIN
/**
* A concrete subclass of CharacterIterator that iterates over the
@ -315,4 +316,5 @@ private:
static const char fgClassID;
};
U_NAMESPACE_END
#endif

View file

@ -60,6 +60,7 @@
#include "unicode/utypes.h"
/**
* FROM_U, TO_U options for sub and skip callbacks
*/

View file

@ -23,7 +23,6 @@
#ifndef __UMACHINE_H__
#define __UMACHINE_H__
#include "unicode/urename.h"
/**
* \file
@ -82,8 +81,20 @@
# define U_CDECL_BEGIN
# define U_CDECL_END
#endif
#define U_CAPI U_CFUNC U_EXPORT
/* Define namespace symbols if the compiler supports it. */
#if U_HAVE_NAMESPACE
# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
# define U_NAMESPACE_END }
# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
#else
# define U_NAMESPACE_BEGIN
# define U_NAMESPACE_END
# define U_NAMESPACE_USE
# define U_NAMESPACE_QUALIFIER
#endif
#define U_CAPI U_CFUNC U_EXPORT
/*===========================================================================*/
/* limits for int32_t etc., like in POSIX inttypes.h */
/*===========================================================================*/
@ -201,5 +212,6 @@ typedef int8_t UBool;
# endif
#endif
#include "unicode/urename.h"
#endif

View file

@ -30,6 +30,7 @@
#include "unicode/utypes.h"
#include "unicode/uchar.h"
U_NAMESPACE_BEGIN
/**
* This class is deprecated and will be removed.
* Use the C API, see uchar.h and utf.h.
@ -1338,5 +1339,6 @@ inline void
Unicode::getUnicodeVersion(UVersionInfo versionArray) {
u_getUnicodeVersion(versionArray);
}
U_NAMESPACE_END
#endif

View file

@ -25,11 +25,18 @@
#include "unicode/rep.h"
#include "unicode/uchar.h"
struct UConverter; // unicode/ucnv.h
U_NAMESPACE_BEGIN
class Locale; // unicode/locid.h
class UCharReference;
class UnicodeConverter; // unicode/convert.h
class Normalizer;
class StringCharacterIterator;
class SearchIterator;
class StringSearch;
/* The <iostream> include has been moved to unicode/ustream.h */
@ -2753,20 +2760,22 @@ private:
UChar fStackBuffer [ US_STACKBUF_SIZE ]; // buffer for small strings
};
U_NAMESPACE_END
//========================================
// Array copying
//========================================
// Copy an array of UnicodeString OBJECTS (not pointers).
inline void
uprv_arrayCopy(const UnicodeString *src, UnicodeString *dst, int32_t count)
uprv_arrayCopy(const U_NAMESPACE_QUALIFIER UnicodeString *src, U_NAMESPACE_QUALIFIER UnicodeString *dst, int32_t count)
{ while(count-- > 0) *dst++ = *src++; }
inline void
uprv_arrayCopy(const UnicodeString *src, int32_t srcStart,
UnicodeString *dst, int32_t dstStart, int32_t count)
uprv_arrayCopy(const U_NAMESPACE_QUALIFIER UnicodeString *src, int32_t srcStart,
U_NAMESPACE_QUALIFIER UnicodeString *dst, int32_t dstStart, int32_t count)
{ uprv_arrayCopy(src+srcStart, dst+dstStart, count); }
U_NAMESPACE_BEGIN
//========================================
// Inline members
//========================================
@ -3680,10 +3689,12 @@ inline int32_t
UnicodeString::setRefCount(int32_t count)
{ return (*((int32_t *)fArray - 1) = count); }
U_NAMESPACE_END
//========================================
// Static members
//========================================
U_NAMESPACE_BEGIN
//========================================
// class UCharReference
@ -3737,4 +3748,6 @@ inline
UCharReference::operator UChar()
{ return fString->charAt(fPos); }
U_NAMESPACE_END
#endif

View file

@ -21,7 +21,7 @@
#ifndef URENAME_H
#define URENAME_H
/* TODO: Review the duplicate C++ defines in perl script. */
/* C exports renaming data */
#define ArabicOpenTypeLayoutEngine ArabicOpenTypeLayoutEngine_1_9
#define BreakIterator BreakIterator_1_9
@ -982,6 +982,8 @@
#define utrans_unregister utrans_unregister_1_9
/* C++ class names renaming defines */
#if !U_HAVE_NAMESPACE
#define AlternateSubstitutionSubtable AlternateSubstitutionSubtable_1_9
#define AnchorTable AnchorTable_1_9
#define ArabicOpenTypeLayoutEngine ArabicOpenTypeLayoutEngine_1_9
@ -1146,3 +1148,4 @@
#define UppercaseTransliterator UppercaseTransliterator_1_9
#define ValueRecord ValueRecord_1_9
#endif
#endif

View file

@ -520,6 +520,7 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
#ifdef XP_CPLUSPLUS
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
/**
* returns a string from a string resource type
*
@ -600,6 +601,8 @@ inline UnicodeString ures_getUnicodeStringByKey(const UResourceBundle *resB, con
return UnicodeString(TRUE, r, len);
}
U_NAMESPACE_END
#endif
#endif /*_URES*/

View file

@ -504,10 +504,18 @@ u_errorName(UErrorCode code);
*/
typedef void *UMTX;
/*===========================================================================*/
/* Include header for platform utilies */
/*===========================================================================*/
#include "unicode/putil.h"
/* TODO: Should we put in the using namespace clause here so the user doesn't have to? */
/*
#if U_HAVE_NAMESPACE
U_NAMESPACE_USE
#endif
*/
#endif /* _UTYPES */

View file

@ -72,6 +72,13 @@
/** The binary form of a version on ICU APIs is an array of 4 uint8_t. */
typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
#if U_HAVE_NAMESPACE && defined(XP_CPLUSPLUS)
#define U_ICU_NAMESPACE icu_1_9
namespace U_ICU_NAMESPACE { }
namespace icu = U_ICU_NAMESPACE;
#endif
/*===========================================================================*/
/* General version helper functions. Definitions in putil.c */
/*===========================================================================*/

View file

@ -88,6 +88,8 @@ us_arrayCopy(const UChar *src, int32_t srcStart,
}
}
U_NAMESPACE_BEGIN
//========================================
// Constructors
//========================================
@ -1722,3 +1724,4 @@ UnicodeString::cloneArrayIfNeeded(int32_t newCapacity,
}
return TRUE;
}
U_NAMESPACE_END

View file

@ -2282,6 +2282,8 @@ unorm_normalize(const UChar *src, int32_t srcLength,
pErrorCode);
}
U_NAMESPACE_BEGIN
/* iteration functions ------------------------------------------------------ */
/*
@ -2668,6 +2670,7 @@ unorm_nextNormalize(UChar *&dest, int32_t &destCapacity,
return destLength;
}
U_NAMESPACE_END
/*
* ### TODO: check if NF*D and FCD iteration finds optimal boundaries
* and if not, how hard it would be to improve it.

View file

@ -256,7 +256,7 @@ unorm_getFCD16FromSurrogatePair(const uint16_t *fcdTrieIndex, uint16_t fcd16, UC
*/
U_CFUNC int32_t
unorm_nextNormalize(UChar *&dest, int32_t &destCapacity,
CharacterIterator &src,
U_NAMESPACE_QUALIFIER CharacterIterator &src,
UNormalizationMode mode, UBool ignoreHangul,
UGrowBuffer *growBuffer, void *context,
UErrorCode *pErrorCode);
@ -267,7 +267,7 @@ unorm_nextNormalize(UChar *&dest, int32_t &destCapacity,
*/
U_CFUNC int32_t
unorm_previousNormalize(UChar *&dest, int32_t &destCapacity,
CharacterIterator &src,
U_NAMESPACE_QUALIFIER CharacterIterator &src,
UNormalizationMode mode, UBool ignoreHangul,
UGrowBuffer *growBuffer, void *context,
UErrorCode *pErrorCode);

View file

@ -21,6 +21,7 @@
#include "unicode/ustring.h"
#include "cmemory.h"
#include "unicode/ushape.h"
#include "ustr_imp.h"
#if UTF_SIZE<16
/*

View file

@ -11,6 +11,8 @@
#include "uvector.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
UVector::UVector(UErrorCode &status, int32_t initialCapacity) :
count(0),
capacity(0),
@ -222,3 +224,6 @@ int32_t UStack::search(void* obj) const {
int32_t i = indexOf(obj);
return (i >= 0) ? size() - i : i;
}
U_NAMESPACE_END

View file

@ -15,6 +15,8 @@
#include "unicode/utypes.h"
#include "uhash.h"
U_NAMESPACE_BEGIN
/**
* <p>Ultralightweight C++ implementation of a <tt>void*</tt> vector
* that is (mostly) compatible with java.util.Vector.
@ -255,4 +257,6 @@ inline int32_t UStack::push(int32_t i, UErrorCode &status) {
return i;
}
U_NAMESPACE_END
#endif

View file

@ -12,6 +12,8 @@
#include "cmemory.h"
#include "unicode/resbund.h"
U_NAMESPACE_BEGIN
//=================================================================================
// deserialization
//=================================================================================
@ -229,3 +231,5 @@ BreakDictionary::internalAt(int32_t row, int32_t col) const
return table[row * numCols + col];
}
U_NAMESPACE_END

View file

@ -14,6 +14,8 @@
#include "ucmp8.h"
#include "umemstrm.h"
U_NAMESPACE_BEGIN
/**
* This is the class that represents the list of known words used by
* DictionaryBasedBreakIterator. The conceptual data structure used
@ -160,5 +162,6 @@ private:
BreakDictionary& operator=(const BreakDictionary& that);
};
U_NAMESPACE_END
#endif

View file

@ -32,6 +32,8 @@
// returning the index of characters where boundaries occur.
// *****************************************************************************
U_NAMESPACE_BEGIN
const UTextOffset BreakIterator::DONE = (int32_t)-1;
// -------------------------------------
@ -194,4 +196,6 @@ BreakIterator::~BreakIterator()
{
}
U_NAMESPACE_END
//eof

View file

@ -29,6 +29,8 @@
#include "unicode/gregocal.h"
#include "unicode/calendar.h"
U_NAMESPACE_BEGIN
// Resource bundle tags read by this class
const char Calendar::kDateTimeElements[] = "DateTimeElements";
@ -783,4 +785,6 @@ Calendar::updateTime(UErrorCode& status)
fIsTimeSet = TRUE;
}
U_NAMESPACE_END
//eof

View file

@ -33,6 +33,8 @@
// class ChoiceFormat
// *****************************************************************************
U_NAMESPACE_BEGIN
const char ChoiceFormat::fgClassID = 0; // Value is irrelevant
//UMTX ChoiceFormat::fgMutex = NULL; // lock for fgNumberFormat
@ -876,4 +878,6 @@ ChoiceFormat::nextDouble( double d, UBool positive )
return uprv_nextDouble( d, positive );
}
U_NAMESPACE_END
//eof

View file

@ -32,6 +32,8 @@
/* Constants --------------------------------------------------------------- */
U_NAMESPACE_BEGIN
/* synwee : public can't remove */
int32_t const CollationElementIterator::NULLORDER = 0xffffffff;
@ -406,4 +408,6 @@ const CollationElementIterator& CollationElementIterator::operator=(
return *this;
}
U_NAMESPACE_END
/* eof */

View file

@ -41,6 +41,7 @@
#include "unicode/tblcoll.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
// Collator public methods -----------------------------------------------
@ -192,3 +193,7 @@ Collator::Collator(const Collator& /* other */)
// UCollator private data members ----------------------------------------
const UVersionInfo Collator::fVersion = {1, 1, 0, 0};
U_NAMESPACE_END
/* eof */

View file

@ -17,6 +17,8 @@ static const UChar ID_SEP = 0x002D; /*-*/
static const UChar ID_DELIM = 0x003B; /*;*/
static const UChar NEWLINE = 10;
U_NAMESPACE_BEGIN
/**
* Constructs a new compound transliterator given an array of
* transliterators. The array of transliterators may be of any
@ -451,3 +453,7 @@ void CompoundTransliterator::computeMaximumContextLength(void) {
}
setMaximumContextLength(max);
}
U_NAMESPACE_END
/* eof */

View file

@ -26,6 +26,8 @@
// class DateFormat
// *****************************************************************************
U_NAMESPACE_BEGIN
DateFormat::DateFormat()
: fCalendar(0),
fNumberFormat(0)
@ -322,4 +324,6 @@ DateFormat::isLenient() const
return fCalendar->isLenient();
}
U_NAMESPACE_END
//eof

View file

@ -15,6 +15,8 @@
#include "unicode/schriter.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
char DictionaryBasedBreakIterator::fgClassID = 0;
//=======================================================================
@ -555,3 +557,6 @@ DictionaryBasedBreakIterator::divideUpDictionaryRange(int32_t startPos, int32_t
positionInCache = 0;
}
U_NAMESPACE_END
/* eof */

View file

@ -12,6 +12,8 @@
#include "dbbi_tbl.h"
#include "unicode/dbbi.h"
U_NAMESPACE_BEGIN
//=======================================================================
// constructor
//=======================================================================
@ -66,3 +68,7 @@ DictionaryBasedBreakIteratorTables::lookupCategory(UChar c,
}
return result;
}
U_NAMESPACE_END
/* eof */

View file

@ -15,6 +15,8 @@
#include "brkdict.h"
#include "unicode/udata.h"
U_NAMESPACE_BEGIN
/* forward declaration */
class DictionaryBasedBreakIterator;
@ -82,4 +84,6 @@ protected:
friend class DictionaryBasedBreakIterator;
};
U_NAMESPACE_END
#endif

View file

@ -25,6 +25,8 @@
// class DecimalFormatSymbols
// *****************************************************************************
U_NAMESPACE_BEGIN
const char DecimalFormatSymbols::fgNumberElements[] = "NumberElements";
const char DecimalFormatSymbols::fgCurrencyElements[] = "CurrencyElements";
@ -205,4 +207,6 @@ DecimalFormatSymbols::initialize() {
fSymbols[kNaNSymbol] = (UChar)0xfffd; // SUB NaN
}
U_NAMESPACE_END
//eof

View file

@ -44,6 +44,8 @@
#include "unicode/unicode.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
//#define FMT_DEBUG
#ifdef FMT_DEBUG
@ -2868,4 +2870,6 @@ void DecimalFormat::setMinimumFractionDigits(int32_t newValue) {
NumberFormat::setMinimumFractionDigits(uprv_min(newValue, kDoubleFractionDigits));
}
U_NAMESPACE_END
//eof

View file

@ -52,6 +52,8 @@ enum {
LONG_MIN_REP_LENGTH = sizeof(LONG_MIN_REP) - 1 //Ignore the NULL at the end
};
U_NAMESPACE_BEGIN
// -------------------------------------
// default constructor
@ -563,4 +565,6 @@ DigitList::initializeLONG_MIN_REP()
}
}*/
U_NAMESPACE_END
//eof

View file

@ -39,6 +39,8 @@ typedef enum EDigitListValues {
MAX_DEC_DIGITS = DBL_DIG + DIGIT_PADDING + MAX_EXPONENT
} EDigitListValues;
U_NAMESPACE_BEGIN
/**
* Digit List. Private to DecimalFormat. Handles the transcoding
* between numeric values and strings of characters. Only handles
@ -197,5 +199,6 @@ DigitList::append(char digit)
}
#endif // _DIGITLST
U_NAMESPACE_END
//eof

View file

@ -25,7 +25,6 @@
// *****************************************************************************
// class DateFormatSymbols
// *****************************************************************************
/**
* These are static arrays we use only in the case where we have no
* resource data.
@ -102,6 +101,9 @@ static const UChar gLastResortZoneStrings[5][4] =
{0x0047, 0x004D, 0x0054, 0x0000} /* "GMT" */
};
U_NAMESPACE_BEGIN
/**
* These are the tags we expect to see in normal resource bundle files associated
* with a locale.
@ -642,4 +644,6 @@ int32_t DateFormatSymbols::_getZoneIndex(const UnicodeString& ID) const
return -1;
}
U_NAMESPACE_END
//eof

View file

@ -24,6 +24,8 @@
// class Formattable
// *****************************************************************************
U_NAMESPACE_BEGIN
// -------------------------------------
// default constructor.
// Creates a formattable object with a long value 0.
@ -370,4 +372,7 @@ FormattableStreamer::streamOut(ostream& stream, const Formattable& obj)
#endif
#endif
U_NAMESPACE_END
//eof

View file

@ -24,7 +24,10 @@
// *****************************************************************************
// class Format
// *****************************************************************************
U_NAMESPACE_BEGIN
// -------------------------------------
// default constructor
@ -100,4 +103,6 @@ Format::operator==(const Format& /*that*/) const
}
//---------------------------------------
U_NAMESPACE_END
//eof

View file

@ -114,6 +114,9 @@ static const int32_t kMaxValues[] = {
1,144683,11,53,6,31,366,7,6,1,11,23,59,59,999,12*U_MILLIS_PER_HOUR,1*U_MILLIS_PER_HOUR, 144683,7
};
U_NAMESPACE_BEGIN
const char GregorianCalendar::fgClassID = 0; // Value is irrelevant
// 00:00:00 UTC, October 15, 1582, expressed in ms from the epoch.
@ -2011,4 +2014,6 @@ GregorianCalendar::internalGetEra() const {
return isSet(ERA) ? internalGet(ERA) : AD;
}
U_NAMESPACE_END
//eof

View file

@ -12,6 +12,9 @@
#include "unicode/unifilt.h"
#include "unicode/unicode.h"
U_NAMESPACE_BEGIN
/**
* ID for this transliterator.
*/
@ -360,3 +363,6 @@ void HexToUnicodeTransliterator::handleTransliterate(Replaceable& text, UTransPo
offsets.limit = limit;
offsets.start = cursor;
}
U_NAMESPACE_END

View file

@ -37,9 +37,6 @@
#define LEFT_CURLY_BRACE ((UChar)0x007B)
#define RIGHT_CURLY_BRACE ((UChar)0x007D)
// -------------------------------------
const char MessageFormat::fgClassID = 0; // Value is irrelevant
//---------------------------------------
// static data
@ -102,10 +99,11 @@ static const UChar *g_umsgDateModifierList[] = {
static const int32_t g_umsgListLength = 9;
//--------------------------------------
// This global NumberFormat instance is shared by all MessageFormat to
// convert a number to(format)/from(parse) a string.
//NumberFormat* MessageFormat::fgNumberFormat = 0;
U_NAMESPACE_BEGIN
// -------------------------------------
const char MessageFormat::fgClassID = 0; // Value is irrelevant
// -------------------------------------
// Creates a MessageFormat instance based on the pattern.
@ -1386,4 +1384,6 @@ MessageFormat::createIntegerFormat(const Locale& locale, UErrorCode& status) con
return temp;
}
U_NAMESPACE_END
//eof

View file

@ -12,11 +12,14 @@
#include "unicode/unifilt.h"
#include "unicode/uchar.h"
const char NameUnicodeTransliterator::_ID[] = "Name-Any";
// As of Unicode 3.0.0, the longest name is 83 characters long.
#define LONGEST_NAME 83
U_NAMESPACE_BEGIN
const char NameUnicodeTransliterator::_ID[] = "Name-Any";
/**
* Constructs a transliterator.
*/
@ -186,3 +189,6 @@ void NameUnicodeTransliterator::handleTransliterate(Replaceable& text, UTransPos
// open delimiter, if we are in mode 1.
offsets.start = (mode == 1 && isIncremental) ? openPos : cursor;
}
U_NAMESPACE_END

View file

@ -10,6 +10,9 @@
#include "unicode/nortrans.h"
U_NAMESPACE_BEGIN
/**
* System registration hook.
*/
@ -202,3 +205,6 @@ void NormalizationTransliterator::handleTransliterate(Replaceable& text, UTransP
offsets.start = limit + delta;
}
}
U_NAMESPACE_END

View file

@ -9,6 +9,9 @@
*/
#include "unicode/nultrans.h"
U_NAMESPACE_BEGIN
// "Any-Null"
const UChar NullTransliterator::ID[] = {65,110,121,45,0x4E, 0x75, 0x6C, 0x6C, 0x00};
@ -23,3 +26,6 @@ void NullTransliterator::handleTransliterate(Replaceable& /*text*/, UTransPositi
UBool /*isIncremental*/) const {
offsets.start = offsets.limit;
}
U_NAMESPACE_END

View file

@ -29,19 +29,6 @@
#include "unicode/decimfmt.h"
#include <float.h>
// *****************************************************************************
// class NumberFormat
// *****************************************************************************
const char NumberFormat::fgClassID = 0; // Value is irrelevant
// If the maximum base 10 exponent were 4, then the largest number would
// be 99,999 which has 5 digits.
const int32_t NumberFormat::fgMaxIntegerDigits = DBL_MAX_10_EXP + 1; // Should be ~40 ? --srl
const int32_t NumberFormat::fgMinIntegerDigits = 127;
const int32_t NumberFormat::fgNumberPatternsCount = 3;
// If no number pattern can be located for a locale, this is the last
// resort.
static const UChar gLastResortDecimalPat[] = {
@ -56,6 +43,21 @@ static const UChar gLastResortPercentPat[] = {
static const UChar gLastResortScientificPat[] = {
0x23, 0x45, 0x30, 0 /* "#E0" */
};
// *****************************************************************************
// class NumberFormat
// *****************************************************************************
U_NAMESPACE_BEGIN
const char NumberFormat::fgClassID = 0; // Value is irrelevant
// If the maximum base 10 exponent were 4, then the largest number would
// be 99,999 which has 5 digits.
const int32_t NumberFormat::fgMaxIntegerDigits = DBL_MAX_10_EXP + 1; // Should be ~40 ? --srl
const int32_t NumberFormat::fgMinIntegerDigits = 127;
const int32_t NumberFormat::fgNumberPatternsCount = 3;
const UChar * const NumberFormat::fgLastResortNumberPatterns[] =
{
gLastResortDecimalPat,
@ -497,4 +499,6 @@ NumberFormat::createInstance(const Locale& desiredLocale,
return f;
}
U_NAMESPACE_END
//eof

View file

@ -9,6 +9,8 @@
#include "quant.h"
#include "unicode/unistr.h"
U_NAMESPACE_BEGIN
Quantifier::Quantifier(UnicodeMatcher *adopted,
uint32_t minCount, uint32_t maxCount) {
// assert(adopted != 0);
@ -114,4 +116,6 @@ UBool Quantifier::matchesIndexValue(uint8_t v) const {
return (minCount == 0) || matcher->matchesIndexValue(v);
}
U_NAMESPACE_END
//eof

View file

@ -10,6 +10,8 @@
#include "unicode/unimatch.h"
U_NAMESPACE_BEGIN
class Quantifier : public UnicodeMatcher {
public:
@ -58,4 +60,6 @@ class Quantifier : public UnicodeMatcher {
uint32_t maxCount;
};
U_NAMESPACE_END
#endif

View file

@ -14,6 +14,8 @@
#include "filestrm.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
/**
* A token used as a character-category value to identify ignore characters
*/
@ -654,3 +656,6 @@ BreakIterator * RuleBasedBreakIterator::createBufferClone(void *stackBuffer,
return localIterator;
}
U_NAMESPACE_END

View file

@ -11,6 +11,8 @@
#include "cmemory.h"
#include "rbbi_tbl.h"
U_NAMESPACE_BEGIN
//=======================================================================
// constructor
//=======================================================================
@ -144,3 +146,5 @@ UBool
RuleBasedBreakIteratorTables::isLookaheadState(int32_t state) const {
return lookaheadStates[state];
}
U_NAMESPACE_END

View file

@ -22,6 +22,8 @@ typedef struct _CompactByteArray CompactByteArray;
#endif
U_CDECL_END
U_NAMESPACE_BEGIN
/* forward declarations */
class RuleBasedBreakIterator;
class DictionaryBasedBreakIterator;
@ -220,5 +222,6 @@ RuleBasedBreakIteratorTables::removeReference(void) {
if (--refCount <= 0)
delete this;
}
U_NAMESPACE_END
#endif

View file

@ -13,6 +13,8 @@
#include "rbt_rule.h"
#include "unicode/rep.h"
U_NAMESPACE_BEGIN
char RuleBasedTransliterator::fgClassID = 0; // Value is irrelevant
void RuleBasedTransliterator::_construct(const UnicodeString& rules,
@ -130,3 +132,6 @@ UnicodeString& RuleBasedTransliterator::toRules(UnicodeString& rulesSource,
UBool escapeUnprintable) const {
return data->ruleSet.toRules(rulesSource, escapeUnprintable);
}
U_NAMESPACE_END

View file

@ -12,6 +12,8 @@
#include "unicode/unistr.h"
#include "unicode/uniset.h"
U_NAMESPACE_BEGIN
TransliterationRuleData::TransliterationRuleData(UErrorCode& status)
: ruleSet(status),
variableNames(0), variables(0)
@ -78,3 +80,5 @@ TransliterationRuleData::lookupSegmentReference(UChar32 c) const {
int32_t i = segmentBase - c;
return (i >= 0 && i < segmentCount) ? i : -1;
}
U_NAMESPACE_END

View file

@ -10,6 +10,8 @@
#include "rbt_set.h"
U_NAMESPACE_BEGIN
class UnicodeString;
class UnicodeMatcher;
class Hashtable;
@ -115,4 +117,6 @@ public:
}
};
U_NAMESPACE_END
#endif

View file

@ -61,6 +61,8 @@ static const UChar gOPERATORS[] = {
static const int32_t ID_TOKEN_LEN = 2;
static const UChar ID_TOKEN[] = { 0x3A, 0x3A }; // ':', ':'
U_NAMESPACE_BEGIN
//----------------------------------------------------------------------
// BEGIN ParseData
//----------------------------------------------------------------------
@ -1347,3 +1349,5 @@ int32_t TransliteratorParser::quotedIndexOf(const UnicodeString& text,
}
return -1;
}
U_NAMESPACE_END

View file

@ -12,6 +12,8 @@
#include "uvector.h"
#include "unicode/parseerr.h"
U_NAMESPACE_BEGIN
class TransliterationRuleData;
class UnicodeMatcher;
class ParseData;
@ -221,4 +223,6 @@ private:
TransliteratorParser& operator=(const TransliteratorParser&);
};
U_NAMESPACE_END
#endif

View file

@ -15,8 +15,6 @@
#include "unicode/unicode.h"
#include "cmemory.h"
const UChar TransliterationRule::ETHER = 0xFFFF;
static const UChar APOSTROPHE = 0x0027; // '\''
static const UChar BACKSLASH = 0x005C; // '\'
@ -38,6 +36,10 @@ static const UChar BACKSLASH = 0x005C; // '\'
#define SEGMENTS_POS(x,i) x[FIRST_SEG_POS_INDEX+i]
#define SEGMENTS_NUM(x,i) (x[x[1]+i]-FIRST_SEG_POS_INDEX)
U_NAMESPACE_BEGIN
const UChar TransliterationRule::ETHER = 0xFFFF;
/**
* Construct a new rule with the given input, output text, and other
* attributes. A cursor position may be specified for the output text.
@ -826,4 +828,6 @@ UnicodeString& TransliterationRule::toRule(UnicodeString& rule,
return rule;
}
U_NAMESPACE_END
//eof

View file

@ -12,6 +12,8 @@
#include "unicode/utrans.h"
#include "unicode/unimatch.h"
U_NAMESPACE_BEGIN
class Replaceable;
class TransliterationRuleData;
@ -273,4 +275,6 @@ inline void TransliterationRule::setData(const TransliterationRuleData* d) {
data = d;
}
U_NAMESPACE_END
#endif

View file

@ -13,15 +13,15 @@
#include "cmemory.h"
static void U_CALLCONV _deleteRule(void *rule) {
delete (TransliterationRule *)rule;
delete (U_NAMESPACE_QUALIFIER TransliterationRule *)rule;
}
// Fill the precontext and postcontext with the patterns of the rules
// that are masking one another.
static void maskingError(const TransliterationRule& rule1,
const TransliterationRule& rule2,
static void maskingError(const U_NAMESPACE_QUALIFIER TransliterationRule& rule1,
const U_NAMESPACE_QUALIFIER TransliterationRule& rule2,
UParseError& parseError) {
UnicodeString r;
U_NAMESPACE_QUALIFIER UnicodeString r;
int32_t len;
parseError.line = 0;
@ -41,6 +41,8 @@ static void maskingError(const TransliterationRule& rule1,
parseError.postContext[len] = 0;
}
U_NAMESPACE_BEGIN
/**
* Construct a new empty rule set.
*/
@ -289,3 +291,5 @@ UnicodeString& TransliterationRuleSet::toRules(UnicodeString& ruleSource,
}
return ruleSource;
}
U_NAMESPACE_END

View file

@ -11,6 +11,8 @@
#include "uvector.h"
#include "unicode/utrans.h"
U_NAMESPACE_BEGIN
class Replaceable;
class TransliterationRule;
class TransliterationRuleData;
@ -129,4 +131,6 @@ public:
virtual UnicodeString& toRules(UnicodeString& result,
UBool escapeUnprintable) const;
};
U_NAMESPACE_END
#endif

View file

@ -9,6 +9,8 @@
*/
#include "unicode/remtrans.h"
U_NAMESPACE_BEGIN
const UChar RemoveTransliterator::ID[] = {65, 110, 121, 45, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x00}; /* "Any-Remove" */
Transliterator* RemoveTransliterator::clone(void) const {
@ -25,3 +27,5 @@ void RemoveTransliterator::handleTransliterate(Replaceable& text, UTransPosition
index.contextLimit -= len;
index.limit -= len;
}
U_NAMESPACE_END

View file

@ -14,6 +14,7 @@
#include "cmemory.h"
// public constructors and destructors -----------------------------------
U_NAMESPACE_BEGIN
SearchIterator::SearchIterator(const SearchIterator &other)
{
@ -355,3 +356,4 @@ void SearchIterator::setMatchNotFound()
}
U_NAMESPACE_END

View file

@ -25,6 +25,8 @@
#include "unicode/gregocal.h"
#include "tzdat.h"
U_NAMESPACE_BEGIN
const char SimpleTimeZone::fgClassID = 0; // Value is irrelevant
// WARNING: assumes that no rule is measured from the end of February,
@ -923,4 +925,6 @@ SimpleTimeZone::decodeEndRule(UErrorCode& status)
}
}
U_NAMESPACE_END
//eof

View file

@ -42,6 +42,8 @@
// class SimpleDateFormat
// *****************************************************************************
U_NAMESPACE_BEGIN
// For time zones that have no names, use strings GMT+minutes and
// GMT-minutes. For instance, in France the time zone is GMT+60.
// Also accepted are GMT+H:MM or GMT-H:MM.
@ -1590,4 +1592,6 @@ SimpleDateFormat::initializeSystemDefaultCentury()
}
}
U_NAMESPACE_END
//eof

View file

@ -37,6 +37,8 @@
#include "uhash.h"
U_NAMESPACE_BEGIN
// A hash code of kInvalidHashCode indicates that the has code needs
// to be computed. A hash code of kEmptyHashCode is used for empty keys
// and for any key whose computed hash code is kInvalidHashCode.
@ -337,3 +339,5 @@ CollationKey::hashCode() const
return fHashCode;
}
U_NAMESPACE_END

View file

@ -10,6 +10,8 @@
#include "rbt_data.h"
#include "rbt_rule.h"
U_NAMESPACE_BEGIN
StringMatcher::StringMatcher(const UnicodeString& theString,
int32_t start,
int32_t limit,
@ -140,4 +142,7 @@ UBool StringMatcher::matchesIndexValue(uint8_t v) const {
return (m == 0) ? ((c & 0xFF) == v) : m->matchesIndexValue(v);
}
U_NAMESPACE_END
//eof

View file

@ -11,6 +11,8 @@
#include "unicode/unistr.h"
#include "unicode/unimatch.h"
U_NAMESPACE_BEGIN
class TransliterationRuleData;
/**
@ -66,4 +68,6 @@ class StringMatcher : public UnicodeMatcher {
UBool isSegment;
};
U_NAMESPACE_END
#endif

View file

@ -11,6 +11,8 @@
#include "cmemory.h"
#include "usrchimp.h"
U_NAMESPACE_BEGIN
// public constructors and destructors -----------------------------------
StringSearch::StringSearch(const UnicodeString &pattern,
@ -385,5 +387,6 @@ UTextOffset StringSearch::handlePrev(int32_t position, UErrorCode &status)
return USEARCH_DONE;
}
U_NAMESPACE_END

View file

@ -10,6 +10,9 @@
#ifndef SYMTABLE_H
#define SYMTABLE_H
U_NAMESPACE_BEGIN
class ParsePosition;
class UnicodeSet;
class UnicodeString;
@ -60,5 +63,7 @@ public:
virtual UnicodeString parseReference(const UnicodeString& text,
ParsePosition& pos, int32_t limit) const = 0;
};
U_NAMESPACE_END
#endif

View file

@ -64,6 +64,8 @@
/* public RuleBasedCollator constructor ---------------------------------- */
U_NAMESPACE_BEGIN
/**
* Copy constructor
*/
@ -632,3 +634,5 @@ const int16_t RuleBasedCollator::FILEID = 0x5443;
const char* RuleBasedCollator::kFilenameSuffix = ".col";
/* class id ? Value is irrelevant */
char RuleBasedCollator::fgClassID = 0;
U_NAMESPACE_END

View file

@ -45,9 +45,7 @@
#include "ucln_in.h"
// static initialization
const char TimeZone::fgClassID = 0; // Value is irrelevant
static TimeZone* DEFAULT_ZONE = NULL;
static const UChar GMT_ID[] = {0x47, 0x4D, 0x54, 0x00}; /* "GMT" */
static const int32_t GMT_ID_LENGTH = 3;
@ -65,27 +63,19 @@ static const TZHeader * DATA = NULL;
static const uint32_t* INDEX_BY_ID = 0;
static const OffsetIndex* INDEX_BY_OFFSET = 0;
static const CountryIndex* INDEX_BY_COUNTRY = 0;
static UnicodeString* ZONE_IDS = 0;
static UDataMemory* UDATA_POINTER = 0;
static UMTX LOCK;
static UBool DATA_LOADED = FALSE;
static TimeZone* GMT = NULL;
static void loadZoneData(void);
U_NAMESPACE_BEGIN
static TimeZone* DEFAULT_ZONE = NULL;
static TimeZone* GMT = NULL;
static UnicodeString* ZONE_IDS = 0;
const char TimeZone::fgClassID = 0; // Value is irrelevant
static const TZEquivalencyGroup* lookupEquivalencyGroup(const UnicodeString& id);
// -------------------------------------
const TimeZone*
TimeZone::getGMT(void)
{
if (!DATA_LOADED) {
loadZoneData();
}
return GMT;
}
U_NAMESPACE_END
/**
* udata callback to verify the zone data.
*/
@ -108,6 +98,8 @@ U_CDECL_END
UBool timeZone_cleanup()
{
U_NAMESPACE_USE
DATA = NULL;
INDEX_BY_ID = NULL;
INDEX_BY_OFFSET = NULL;
@ -124,9 +116,9 @@ UBool timeZone_cleanup()
umtx_destroy(&LOCK);
LOCK = NULL;
}
if (::GMT) {
delete ::GMT;
::GMT = NULL;
if (U_NAMESPACE_QUALIFIER GMT) {
delete U_NAMESPACE_QUALIFIER GMT;
U_NAMESPACE_QUALIFIER GMT = NULL;
}
if (DEFAULT_ZONE) {
delete DEFAULT_ZONE;
@ -150,6 +142,8 @@ UBool timeZone_cleanup()
* initialized.
*/
static void loadZoneData() {
U_NAMESPACE_USE
if (!DATA_LOADED) {
umtx_lock(NULL);
Mutex lock(&LOCK);
@ -197,12 +191,23 @@ static void loadZoneData() {
// Whether we succeed or fail, stop future attempts
DATA_LOADED = TRUE;
::GMT = new SimpleTimeZone(0, UnicodeString(GMT_ID, GMT_ID_LENGTH));
U_NAMESPACE_QUALIFIER GMT = new SimpleTimeZone(0, UnicodeString(GMT_ID, GMT_ID_LENGTH));
ucln_i18n_registerCleanup();
}
}
}
// -------------------------------------
U_NAMESPACE_BEGIN
const TimeZone*
TimeZone::getGMT(void)
{
if (!DATA_LOADED) {
loadZoneData();
}
return GMT;
}
// *****************************************************************************
// class TimeZone
// *****************************************************************************
@ -803,4 +808,6 @@ TimeZone::hasSameRules(const TimeZone& other) const
useDaylightTime() == other.useDaylightTime());
}
U_NAMESPACE_END
//eof

View file

@ -11,6 +11,8 @@
#include "unicode/uchar.h"
#include "unicode/titletrn.h"
U_NAMESPACE_BEGIN
/**
* ID for this transliterator.
*/
@ -134,3 +136,6 @@ void TitlecaseTransliterator::handleTransliterate(
text.handleReplaceBetween(bufStart, bufLimit, buffer);
}
}
U_NAMESPACE_END

View file

@ -10,6 +10,8 @@
#include "unicode/tolowtrn.h"
U_NAMESPACE_BEGIN
const char* LowercaseTransliterator::_ID = "Any-Lower";
/**
@ -63,3 +65,6 @@ UBool LowercaseTransliterator::hasTransform(UChar32 c) const {
void LowercaseTransliterator::transform(UnicodeString& s) const {
s.toLower(loc);
}
U_NAMESPACE_END

View file

@ -10,6 +10,8 @@
#include "unicode/toupptrn.h"
U_NAMESPACE_BEGIN
const char* UppercaseTransliterator::_ID = "Any-Upper";
/**
@ -63,3 +65,6 @@ UBool UppercaseTransliterator::hasTransform(UChar32 c) const {
void UppercaseTransliterator::transform(UnicodeString& s) const {
s.toUpper(loc);
}
U_NAMESPACE_END

View file

@ -43,17 +43,6 @@ static const UChar ID_DELIM = 0x003B; /*;*/
static const UChar VARIANT_SEP = 0x002F; // '/'
static const UChar OPEN_PAREN = 40;
static const UChar CLOSE_PAREN = 41;
/**
* The mutex controlling access to registry object.
*/
static UMTX registryMutex = 0;
/**
* System transliterator registry; non-null when initialized.
*/
static TransliteratorRegistry* registry = 0;
/**
* Prefix for resource bundle key for the display name for a
* transliterator. The ID is appended to this to form the key.
@ -84,6 +73,18 @@ static const char* RB_DISPLAY_NAME_PATTERN = "TransliteratorNamePattern";
*/
static const char* RB_RULE_BASED_IDS = "RuleBasedTransliteratorIDs";
U_NAMESPACE_BEGIN
/**
* The mutex controlling access to registry object.
*/
static UMTX registryMutex = 0;
/**
* System transliterator registry; non-null when initialized.
*/
static TransliteratorRegistry* registry = 0;
/**
* Class identifier for subclasses of Transliterator that do not
* define their class (anonymous subclasses).
@ -1378,6 +1379,8 @@ void Transliterator::initializeRegistry(void) {
* The extra blank field on "alias" lines is to make the array square.
*/
Locale indexLoc("translit_index");
UResourceBundle *bundle, *transIDs, *colBund;
// TODO call internal ures_openXYZ() that guarantees to not canonicalize
// (uloc_getName()) the ch resource bundle name, and that also
@ -1457,4 +1460,6 @@ U_CFUNC UBool transliterator_cleanup(void) {
return TRUE;
}
U_NAMESPACE_END
//eof

Some files were not shown because too many files have changed in this diff Show more