// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * * Copyright (C) 1999-2014 International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: rbbidata.h * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * RBBI data formats Includes * * Structs that describes the format of the Binary RBBI data, * as it is stored in ICU's data file. * * RBBIDataWrapper - Instances of this class sit between the * raw data structs and the RulesBasedBreakIterator objects * that are created by applications. The wrapper class * provides reference counting for the underlying data, * and direct pointers to data that would not otherwise * be accessible without ugly pointer arithmetic. The * wrapper does not attempt to provide any higher level * abstractions for the data itself. * * There will be only one instance of RBBIDataWrapper for any * set of RBBI run time data being shared by instances * (clones) of RulesBasedBreakIterator. */ #ifndef __RBBIDATA_H__ #define __RBBIDATA_H__ #include "unicode/utypes.h" #include "unicode/udata.h" #include "udataswp.h" /** * Swap RBBI data. See udataswp.h. * @internal */ U_CAPI int32_t U_EXPORT2 ubrk_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outData, UErrorCode *pErrorCode); #ifdef __cplusplus #include "unicode/ucptrie.h" #include "unicode/uobject.h" #include "unicode/unistr.h" #include "unicode/uversion.h" #include "umutex.h" U_NAMESPACE_BEGIN // The current RBBI data format version. static const uint8_t RBBI_DATA_FORMAT_VERSION[] = …; /* * The following structs map exactly onto the raw data from ICU common data file. */ struct RBBIDataHeader { … }; template <typename T> struct RBBIStateTableRowT { … }; RBBIStateTableRow8; RBBIStateTableRow16; constexpr uint16_t ACCEPTING_UNCONDITIONAL = …; // Value constant for RBBIStateTableRow::fAccepting RBBIStateTableRow; struct RBBIStateTable { … }; constexpr uint32_t RBBI_LOOKAHEAD_HARD_BREAK = …; constexpr uint32_t RBBI_BOF_REQUIRED = …; constexpr uint32_t RBBI_8BITS_ROWS = …; /* */ /* The reference counting wrapper class */ /* */ class RBBIDataWrapper : public UMemory { … }; U_NAMESPACE_END U_CFUNC UBool rbbi_cleanup(); #endif /* C++ */ #endif