ICU-2015 add total_size to header to inform java

X-SVN-Rev: 10145
This commit is contained in:
Alan Liu 2002-11-04 18:32:45 +00:00
parent 0c227bbcfb
commit 1ad9f88a32
2 changed files with 4 additions and 2 deletions

View File

@ -89,6 +89,7 @@ class PropertyAliases {
// The following are needed by external readers of this data.
// We don't use them ourselves.
int16_t total_size; // size in bytes excluding the udata header
Offset valueMap_offset; // offset to start of array
int16_t valueMap_count; // number of entries
Offset nameGroupPool_offset; // offset to start of array
@ -96,8 +97,6 @@ class PropertyAliases {
Offset stringPool_offset; // offset to start of pool
int16_t stringPool_count; // number of strings
int16_t reserved;
// -- end pnames data --
friend class Builder;

View File

@ -784,6 +784,9 @@ void Builder::fixupMiscellaneousOffsets() {
header.enumToName_offset = enumToName_offset;
header.nameToEnum_offset = nameToEnum_offset;
header.enumToValue_offset = enumToValue_offset;
// header meta-info used by Java:
U_ASSERT(total_size > 0 && total_size < 0x7FFF);
header.total_size = (int16_t) total_size;
header.valueMap_offset = valueMap_offset;
header.valueMap_count = (int16_t) valueMap_count;
header.nameGroupPool_offset = nameGroupPool_offset;