// Encapsulates unitPreferenceData information from units resources, specifying // a sequence of output unit preferences. struct UnitPreference : public UMemory { // Set geq to 1.0 by default
UnitPreference() : geq(1.0) {}
FixedString unit; double geq;
UnicodeString skeleton;
/** *MetadataaboutthepreferencesinUnitPreferences::unitPrefs_. * *Thisclassownsallofitsdata. * *UnitPreferenceMetadatalivesintheanonymousnamespace,becauseitshould *onlybeusefultointernalcodeandunittestingcode.
*/ class UnitPreferenceMetadata : public UMemory { public:
UnitPreferenceMetadata() {} // Constructor, makes copies of the parameters passed to it.
UnitPreferenceMetadata(StringPiece category, StringPiece usage, StringPiece region,
int32_t prefsOffset, int32_t prefsCount, UErrorCode &status);
// Unit category (e.g. "length", "mass", "electric-capacitance").
CharString category; // Usage (e.g. "road", "vehicle-fuel", "blood-glucose"). Every category // should have an entry for "default" usage. TODO(hugovdm): add a test for // this.
CharString usage; // Region code (e.g. "US", "CZ", "001"). Every usage should have an entry // for the "001" region ("world"). TODO(hugovdm): add a test for this.
CharString region; // Offset into the UnitPreferences::unitPrefs_ list where the relevant // preferences are found.
int32_t prefsOffset; // The number of preferences that form this set.
int32_t prefsCount;
protected: // Metadata about the sets of preferences, this is the index for looking up // preferences in the unitPrefs_ list.
MaybeStackVector<UnitPreferenceMetadata> metadata_; // All the preferences as a flat list: which usage and region preferences // are associated with is stored in `metadata_`.
MaybeStackVector<UnitPreference> unitPrefs_;
};
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.