+// A compact storage mechanism for skeleton field strings. Several dozen of these will be created
+// for a typical DateTimePatternGenerator instance.
+class SkeletonFields : public UMemory {
+public:
+ SkeletonFields();
+ void clear();
+ void copyFrom(const SkeletonFields& other);
+ void clearField(int32_t field);
+ UChar getFieldChar(int32_t field) const;
+ int32_t getFieldLength(int32_t field) const;
+ void populate(int32_t field, const UnicodeString& value);
+ void populate(int32_t field, UChar repeatChar, int32_t repeatCount);
+ UBool isFieldEmpty(int32_t field) const;
+ UnicodeString& appendTo(UnicodeString& string) const;
+ UnicodeString& appendFieldTo(int32_t field, UnicodeString& string) const;
+ UChar getFirstChar() const;
+ inline UBool operator==(const SkeletonFields& other) const;
+ inline UBool operator!=(const SkeletonFields& other) const;
+
+private:
+ int8_t chars[UDATPG_FIELD_COUNT];
+ int8_t lengths[UDATPG_FIELD_COUNT];
+};
+
+inline UBool SkeletonFields::operator==(const SkeletonFields& other) const {
+ return (uprv_memcmp(chars, other.chars, sizeof(chars)) == 0
+ && uprv_memcmp(lengths, other.lengths, sizeof(lengths)) == 0);
+}
+
+inline UBool SkeletonFields::operator!=(const SkeletonFields& other) const {
+ return (! operator==(other));
+}
+