+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
-* Copyright (C) 1999-2005, International Business Machines
+* Copyright (C) 1999-2014 International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: rbbidata.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "unicode/uobject.h"
#include "unicode/unistr.h"
+#include "umutex.h"
#include "utrie.h"
U_NAMESPACE_BEGIN
/* tags (rule status values) */
int16_t fReserved;
uint16_t fNextState[2]; /* Next State, indexed by char category. */
- /* Array Size is fNumCols from the */
- /* state table header. */
+ /* This array does not have two elements */
+ /* Array Size is actually fData->fHeader->fCatCount */
/* CAUTION: see RBBITableBuilder::getTableSize() */
/* before changing anything here. */
};
/* */
class RBBIDataWrapper : public UMemory {
public:
+ enum EDontAdopt {
+ kDontAdopt
+ };
RBBIDataWrapper(const RBBIDataHeader *data, UErrorCode &status);
+ RBBIDataWrapper(const RBBIDataHeader *data, enum EDontAdopt dontAdopt, UErrorCode &status);
RBBIDataWrapper(UDataMemory* udm, UErrorCode &status);
~RBBIDataWrapper();
+ void init0();
void init(const RBBIDataHeader *data, UErrorCode &status);
RBBIDataWrapper *addReference();
void removeReference();
UTrie fTrie;
private:
- int32_t fRefCount;
- UDataMemory *fUDataMem;
+ u_atomic_int32_t fRefCount;
+ UDataMemory *fUDataMem;
UnicodeString fRuleString;
+ UBool fDontFreeData;
RBBIDataWrapper(const RBBIDataWrapper &other); /* forbid copying of this class */
RBBIDataWrapper &operator=(const RBBIDataWrapper &other); /* forbid copying of this class */