Ignore:
Timestamp:
Oct 6, 2017, 11:36:55 AM (22 months ago)
Author:
cameron
Message:

StringOverride? properties (simple case conversion vs full case conversion)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.h

    r5670 r5672  
    2727        NumericProperty,
    2828        StringProperty,
     29        StringOverrideProperty,
    2930        ObsoleteProperty,
    3031        UnsupportedProperty
     
    155156};
    156157
     158class NumericPropertyObject : public PropertyObject {
     159public:
     160    static inline bool classof(const PropertyObject * p) {
     161        return p->getClassTypeId() == ClassTypeId::NumericProperty;
     162    }
     163    static inline bool classof(const void *) {
     164        return false;
     165    }
     166   
     167    NumericPropertyObject(UCD::property_t p, UnicodeSet NaN_Set, const char * string_buffer, unsigned bufsize, const std::vector<UCD::codepoint_t> & cps)
     168    : PropertyObject(p, ClassTypeId::NumericProperty)
     169    , mNaNCodepointSet(NaN_Set)
     170    , mStringBuffer(string_buffer)
     171    , mBufSize(bufsize)
     172    , mExplicitCps(cps)
     173    {
     174       
     175    }
     176    const UnicodeSet GetCodepointSet(const std::string & numeric_spec) override;
     177   
     178private:
     179    UnicodeSet mNaNCodepointSet;  // codepoints for which the property value is NaN (not a number).
     180    const char * mStringBuffer;  // buffer holding all string values for other codepoints, in sorted order.
     181    unsigned mBufSize;
     182    const std::vector<UCD::codepoint_t> & mExplicitCps;
     183};
     184
    157185class StringPropertyObject : public PropertyObject {
    158186public:
     
    184212};
    185213   
    186 class NumericPropertyObject : public PropertyObject {
    187 public:
    188     static inline bool classof(const PropertyObject * p) {
    189         return p->getClassTypeId() == ClassTypeId::NumericProperty;
    190     }
    191     static inline bool classof(const void *) {
    192         return false;
    193     }
    194    
    195     NumericPropertyObject(UCD::property_t p, UnicodeSet NaN_Set, const char * string_buffer, unsigned bufsize, const std::vector<UCD::codepoint_t> & cps)
    196     : PropertyObject(p, ClassTypeId::NumericProperty)
    197     , mNaNCodepointSet(NaN_Set)
     214class StringOverridePropertyObject : public PropertyObject {
     215public:
     216    static inline bool classof(const PropertyObject * p) {
     217        return p->getClassTypeId() == ClassTypeId::StringOverrideProperty;
     218    }
     219    static inline bool classof(const void *) {
     220        return false;
     221    }
     222    StringOverridePropertyObject(UCD::property_t p, PropertyObject & baseObj, UnicodeSet overridden, const char * string_buffer, unsigned bufsize, const std::vector<UCD::codepoint_t> & cps)
     223    : PropertyObject(p, ClassTypeId::StringOverrideProperty)
     224    , mBaseObject(baseObj)
     225    , mOverriddenSet(overridden)
    198226    , mStringBuffer(string_buffer)
    199227    , mBufSize(bufsize)
     
    202230       
    203231    }
    204     const UnicodeSet GetCodepointSet(const std::string & numeric_spec) override;
    205 
    206 private:
    207     UnicodeSet mNaNCodepointSet;  // codepoints for which the property value is NaN (not a number).
    208     const char * mStringBuffer;  // buffer holding all string values for other codepoints, in sorted order.
     232    const UnicodeSet GetCodepointSet(const std::string & value_spec) override;
     233   
     234private:
     235    PropertyObject & mBaseObject;  // the base object that provides default values for this property unless overridden.
     236    UnicodeSet mOverriddenSet;   // codepoints for which the baseObject value is overridden.
     237    const char * mStringBuffer;  // buffer holding all string values for overridden codepoints, in sorted order.
    209238    unsigned mBufSize;
    210239    const std::vector<UCD::codepoint_t> & mExplicitCps;
    211 };
    212 
     240   
     241};
     242   
    213243class ObsoletePropertyObject : public PropertyObject {
    214244public:
Note: See TracChangeset for help on using the changeset viewer.