/* write a xml resource file */ // TODO: C++ify void bundle_write_xml(struct SRBRoot *bundle, constchar *outputDir,constchar* outputEnc, constchar* rbname, char *writtenFilename, int writtenFilenameLen, constchar* language, constchar* package, UErrorCode *status);
/* Various resource types */
/* * Return a unique pointer to a dummy object, * for use in non-error cases when no resource is to be added to the bundle. * (nullptr is used in error cases.)
*/ struct SResource* res_none();
class ArrayResource; class TableResource; class IntVectorResource;
/** * Preflights strings. * Finds duplicates and counts the total number of string code units * so that they can be written first to the 16-bit array, * for minimal string and container storage. * * We walk the final parse tree, rather than collecting this information while building it, * so that we need not deal with changes to the parse tree (especially removing resources).
*/ void preflightStrings(SRBRoot *bundle, UHashtable *stringSet, UErrorCode &errorCode); virtualvoid handlePreflightStrings(SRBRoot *bundle, UHashtable *stringSet, UErrorCode &errorCode);
/** * Writes resource values into f16BitUnits * and determines the resource item word, if possible.
*/ void write16(SRBRoot *bundle); virtualvoid handleWrite16(SRBRoot *bundle);
/** * Calculates ("preflights") and advances the *byteOffset * by the size of the resource's data in the binary file and * determines the resource item word. * * Most handlePreWrite() functions may add any number of bytes, but preWrite() * will always pad it to a multiple of 4. * The resource item type may be a related subtype of the fType. * * The preWrite() and write() functions start and end at the same * byteOffset values. * Prewriting allows bundle.write() to determine the root resource item word, * before actually writing the bundle contents to the file, * which is necessary because the root item is stored at the beginning.
*/ void preWrite(uint32_t *byteOffset); virtualvoid handlePreWrite(uint32_t *byteOffset);
/** * Writes the resource's data to mem and updates the byteOffset * in parallel.
*/ void write(UNewDataMemory *mem, uint32_t *byteOffset); virtualvoid handleWrite(UNewDataMemory *mem, uint32_t *byteOffset);
/** * Applies the given filter with the given base path to this resource. * Removes child resources rejected by the filter recursively. * * @param bundle Needed in order to access the key for this and child resources.
*/ virtualvoid applyFilter(const PathFilter& filter, ResKeyPath& path, const SRBRoot* bundle);
/** * Calls the given function for every key ID present in this tree.
*/ virtualvoid collectKeys(std::function<void(int32_t)> collector) const;
int8_t fType; /* nominal type: fRes (when != 0xffffffff) may use subtype */
UBool fWritten; /* res_write() can exit early */
uint32_t fRes; /* resource item word; RES_BOGUS=0xffffffff if not known yet */
int32_t fRes16; /* Res16 version of fRes for Table, Table16, Array16; -1 if it does not fit. */
int32_t fKey; /* Index into bundle->fKeys; -1 if no key. */
int32_t fKey16; /* Key16 version of fKey for Table & Table16; -1 if no key or it does not fit. */ int line; /* used internally to report duplicate keys in tables */
SResource *fNext; /* This is for internal chaining while building */ struct UString fComment;
};
/** * List of resources for a pool bundle. * Writes an empty table resource, rather than a container structure.
*/ class PseudoListResource : public ContainerResource { public:
PseudoListResource(SRBRoot *bundle, UErrorCode &errorCode)
: ContainerResource(bundle, nullptr, URES_TABLE, nullptr, errorCode) {} virtual ~PseudoListResource();
StringResource *fSame; // used for duplicates
int32_t fSuffixOffset; // this string is a suffix of fSame at this offset
int32_t fNumCopies; // number of equal strings represented by one stringSet element
int32_t fNumUnitsSaved; // from not writing duplicates and suffixes
int8_t fNumCharsForLength;
};
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.8Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.