/**
* A UVector which implements a set of strings.
*/
-class U_COMMON_API UStringSet : public UVector {
+class UStringSet : public UVector {
public:
UStringSet(UErrorCode &status) : UVector(uprv_deleteUObject,
uhash_compareUnicodeString,
/**
* Concrete implementation of builder class.
*/
-class U_COMMON_API SimpleFilteredBreakIteratorBuilder : public FilteredBreakIteratorBuilder {
+class SimpleFilteredBreakIteratorBuilder : public FilteredBreakIteratorBuilder {
public:
virtual ~SimpleFilteredBreakIteratorBuilder();
SimpleFilteredBreakIteratorBuilder(const Locale &fromLocale, UErrorCode &status);
#ifdef U_UTF8_IMPL
// No forward declaration if compiling utf_impl.cpp, which defines utf8_countTrailBytes.
#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
-U_CFUNC const uint8_t utf8_countTrailBytes[];
+U_CAPI const uint8_t utf8_countTrailBytes[];
#else
-U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[]; /* U_IMPORT2? */ /*U_IMPORT*/
-#endif
+U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[];
+#endif
/**
* Count the trail bytes for a UTF-8 lead byte.
U_NAMESPACE_BEGIN
-U_CAPI int32_t U_EXPORT2
+int32_t U_EXPORT2
ucache_hashKeys(const UHashTok key) {
const CacheKeyBase *ckey = (const CacheKeyBase *) key.pointer;
return ckey->hashCode();
}
-U_CAPI UBool U_EXPORT2
+UBool U_EXPORT2
ucache_compareKeys(const UHashTok key1, const UHashTok key2) {
const CacheKeyBase *p1 = (const CacheKeyBase *) key1.pointer;
const CacheKeyBase *p2 = (const CacheKeyBase *) key2.pointer;
return *p1 == *p2;
}
-U_CAPI void U_EXPORT2
+void U_EXPORT2
ucache_deleteKey(void *obj) {
CacheKeyBase *p = (CacheKeyBase *) obj;
delete p;
* -finish:
* (BSR: Bit Scan Reverse, scans for a 1-bit, starting from the MSB)
*/
-extern "C" U_EXPORT const uint8_t
+U_CAPI const uint8_t
utf8_countTrailBytes[256]={
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
U_NAMESPACE_BEGIN
-// Some compilers don't care if constants are defined in the .cpp file.
-// MS Visual C++ does not like it, but gcc requires it. clang does not care.
-#ifndef _MSC_VER
-const uint8_t Collation::LEVEL_SEPARATOR_BYTE;
-const uint8_t Collation::MERGE_SEPARATOR_BYTE;
-const uint32_t Collation::ONLY_TERTIARY_MASK;
-const uint32_t Collation::CASE_AND_TERTIARY_MASK;
-#endif
-
uint32_t
Collation::incTwoBytePrimaryByOffset(uint32_t basePrimary, UBool isCompressible, int32_t offset) {
// Extract the second byte, minus the minimum byte value,
// CollationBuilder implementation ----------------------------------------- ***
-// Some compilers don't care if constants are defined in the .cpp file.
-// MS Visual C++ does not like it, but gcc requires it. clang does not care.
-#ifndef _MSC_VER
-const int32_t CollationBuilder::HAS_BEFORE2;
-const int32_t CollationBuilder::HAS_BEFORE3;
-#endif
-
CollationBuilder::CollationBuilder(const CollationTailoring *b, UBool icu4xMode, UErrorCode &errorCode)
: nfd(*Normalizer2::getNFDInstance(errorCode)),
fcd(*Normalizer2Factory::getFCDInstance(errorCode)),
U_CDECL_BEGIN
-U_CAPI void U_CALLCONV
+void U_CALLCONV
uprv_deleteConditionalCE32(void *obj) {
delete static_cast<ConditionalCE32 *>(obj);
}
#include "collationsettings.h"
#include "uhash.h"
#include "umutex.h"
+#include "unifiedcache.h"
+
struct UDataMemory;
struct UResourceBundle;
const CollationTailoring *tailoring;
};
+template<> U_I18N_API
+const CollationCacheEntry *
+LocaleCacheKey<CollationCacheEntry>::createObject(const void *creationContext,
+ UErrorCode &errorCode) const;
U_NAMESPACE_END
#endif // !UCONFIG_NO_COLLATION
U_NAMESPACE_BEGIN
-class U_I18N_API DateFmtBestPattern : public SharedObject {
+class DateFmtBestPattern : public SharedObject {
public:
UnicodeString fPattern;
DateFmtBestPattern::~DateFmtBestPattern() {
}
-template<> U_I18N_API
+template<>
const DateFmtBestPattern *LocaleCacheKey<DateFmtBestPattern>::createObject(
const void * /*creationContext*/, UErrorCode &status) const {
status = U_UNSUPPORTED_ERROR;
return NULL;
}
-class U_I18N_API DateFmtBestPatternKey : public LocaleCacheKey<DateFmtBestPattern> {
+class DateFmtBestPatternKey : public LocaleCacheKey<DateFmtBestPattern> {
private:
UnicodeString fSkeleton;
protected:
U_CAPI decContext * U_EXPORT2 uprv_decContextSetStatusFromStringQuiet(decContext *, const char *);
U_CAPI decContext * U_EXPORT2 uprv_decContextSetStatusQuiet(decContext *, uint32_t);
U_CAPI const char * U_EXPORT2 uprv_decContextStatusToString(const decContext *);
- U_CAPI int32_t U_EXPORT2 uprv_decContextTestEndian(uint8_t);
U_CAPI uint32_t U_EXPORT2 uprv_decContextTestSavedStatus(uint32_t, uint32_t);
U_CAPI uint32_t U_EXPORT2 uprv_decContextTestStatus(decContext *, uint32_t);
U_CAPI decContext * U_EXPORT2 uprv_decContextZeroStatus(decContext *);
return result;
}
-template<> U_I18N_API
+template<>
const MeasureFormatCacheData *LocaleCacheKey<MeasureFormatCacheData>::createObject(
const void * /*unused*/, UErrorCode &status) const {
const char *localeId = fLoc.getName();
return getStringByIndex(topLevel.getAlias(), dateTimeFormatOffset, result, status);
}
-template<> U_I18N_API
+template<>
const RelativeDateTimeCacheData *LocaleCacheKey<RelativeDateTimeCacheData>::createObject(const void * /*unused*/, UErrorCode &status) const {
const char *localeId = fLoc.getName();
LocalUResourceBundlePointer topLevel(ures_open(nullptr, localeId, &status));
U_CAPI void U_EXPORT2
uhash_deleteScriptSet(void *obj);
-#endif // __SCRIPTSET_H__
+U_CAPI UBool U_EXPORT2
+uhash_equalsScriptSet(const UElement key1, const UElement key2);
+
+#endif // __SCRIPTSET_H_
#include "unicode/utypes.h"
#include "sharedobject.h"
+#include "unifiedcache.h"
U_NAMESPACE_BEGIN
SharedCalendar &operator=(const SharedCalendar &) = delete;
};
+template<> U_I18N_API
+const SharedCalendar *LocaleCacheKey<SharedCalendar>::createObject(
+ const void * /*unusedCreationContext*/, UErrorCode &status) const;
+
+
U_NAMESPACE_END
#endif
#include "sharedobject.h"
#include "unicode/dtfmtsym.h"
+#include "unifiedcache.h"
U_NAMESPACE_BEGIN
SharedDateFormatSymbols &operator=(const SharedDateFormatSymbols &) = delete;
};
+template<> U_I18N_API
+const SharedDateFormatSymbols *
+ LocaleCacheKey<SharedDateFormatSymbols>::createObject(
+ const void * /*unusedContext*/, UErrorCode &status) const;
+
U_NAMESPACE_END
#endif /* !UCONFIG_NO_FORMATTING */
#include "unicode/utypes.h"
#include "sharedobject.h"
+#include "unifiedcache.h"
U_NAMESPACE_BEGIN
SharedNumberFormat &operator=(const SharedNumberFormat &) = delete;
};
+template<> U_I18N_API
+const SharedNumberFormat *LocaleCacheKey<SharedNumberFormat>::createObject(
+ const void * /*unused*/, UErrorCode &status) const;
+
U_NAMESPACE_END
#endif
#include "unicode/utypes.h"
#include "sharedobject.h"
+#include "unifiedcache.h"
U_NAMESPACE_BEGIN
SharedPluralRules &operator=(const SharedPluralRules &) =delete;
};
+template<> U_I18N_API
+const SharedPluralRules *LocaleCacheKey<SharedPluralRules>::createObject(
+ const void * /*unused*/, UErrorCode &status) const;
+
U_NAMESPACE_END
#endif
cc_library(
name = "stubdata",
srcs = ["stubdata.cpp"],
+ hdrs = ["stubdata.h"],
deps = ["//icu4c/source/common:headers"],
local_defines = [
"U_COMMON_IMPLEMENTATION",
* for running the data building tools.
*
*/
-#include "unicode/utypes.h"
-#include "unicode/udata.h"
-#include "unicode/uversion.h"
-
-typedef struct {
- uint16_t headerSize;
- uint8_t magic1, magic2;
- UDataInfo info;
- char padding[8];
- uint32_t count, reserved;
- /*
- const struct {
- const char *const name;
- const void *const data;
- } toc[1];
- */
- int fakeNameAndData[4]; /* TODO: Change this header type from */
- /* pointerTOC to OffsetTOC. */
-} ICU_Data_Header;
+#include "stubdata.h"
extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = {
32, /* headerSize */
--- /dev/null
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/******************************************************************************
+*
+* Copyright (C) 2001, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: stubdata.h
+*
+* This header file is intended to be internal and only included in the
+* accompanying implementation file. This file declares a single entry
+* point for visibility of tools like TAPI.
+*
+* Define initialized data that will build into a valid, but empty
+* ICU data library. Used to bootstrap the ICU build, which has these
+* dependencies:
+* ICU Common library depends on ICU data
+* ICU data requires data building tools.
+* ICU data building tools require the ICU common library.
+*
+* The stub data library (for which this file is the source) is sufficient
+* for running the data building tools.
+*
+*/
+
+#ifndef __STUBDATA_H__
+#define __STUBDATA_H__
+
+#include "unicode/utypes.h"
+#include "unicode/udata.h"
+#include "unicode/uversion.h"
+
+typedef struct {
+ uint16_t headerSize;
+ uint8_t magic1, magic2;
+ UDataInfo info;
+ char padding[8];
+ uint32_t count, reserved;
+ /*
+ const struct {
+ const char *const name;
+ const void *const data;
+ } toc[1];
+ */
+ int fakeNameAndData[4]; /* TODO: Change this header type from */
+ /* pointerTOC to OffsetTOC. */
+} ICU_Data_Header;
+
+extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT;
+
+#endif /* __STUBDATA_H__ */