Changeset 6175 for icGREP


Ignore:
Timestamp:
Oct 23, 2018, 10:18:07 AM (4 months ago)
Author:
cameron
Message:

Constant attributes for GetStringValue?, GetReflexiveSet? functions

Location:
icGREP/icgrep-devel/icgrep/UCD
Files:
2 edited

Legend:

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

    r6158 r6175  
    4646}
    4747
    48 const std::string PropertyObject::GetStringValue(codepoint_t cp) {
     48const std::string PropertyObject::GetStringValue(codepoint_t cp) const {
    4949    llvm::report_fatal_error("GetStringValue unsupported");
    5050}
     
    5858}
    5959   
    60 const UnicodeSet PropertyObject::GetReflexiveSet() {
     60const UnicodeSet PropertyObject::GetReflexiveSet() const {
    6161    return UnicodeSet();
    6262}
     
    416416}
    417417   
    418 const UnicodeSet StringPropertyObject::GetReflexiveSet() {
     418const UnicodeSet StringPropertyObject::GetReflexiveSet() const {
    419419    return mSelfCodepointSet;
    420420}
    421421
    422 const std::string StringPropertyObject::GetStringValue(codepoint_t cp) {
     422const std::string StringPropertyObject::GetStringValue(codepoint_t cp) const {
    423423    if (mNullCodepointSet.contains(cp)) return "";
    424424    if (mSelfCodepointSet.contains(cp)) {
     
    475475}
    476476
    477 const UnicodeSet StringOverridePropertyObject::GetReflexiveSet() {
     477const UnicodeSet StringOverridePropertyObject::GetReflexiveSet() const {
    478478    return mBaseObject.GetReflexiveSet() - mOverriddenSet;
    479479}
    480480
    481 const std::string StringOverridePropertyObject::GetStringValue(codepoint_t cp) {
     481const std::string StringOverridePropertyObject::GetStringValue(codepoint_t cp) const {
    482482    if (!mOverriddenSet.contains(cp)) return mBaseObject.GetStringValue(cp);
    483483    // Otherwise, binary search through the explicit cps to find the index.
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.h

    r6158 r6175  
    4343    virtual const UnicodeSet GetCodepointSet(const std::string & prop_value_string);
    4444    virtual const UnicodeSet GetCodepointSetMatchingPattern(re::RE * pattern);
    45     virtual const UnicodeSet GetReflexiveSet();
    46     virtual const std::string GetStringValue(UCD::codepoint_t cp);
     45    virtual const UnicodeSet GetReflexiveSet() const;
     46    virtual const std::string GetStringValue(UCD::codepoint_t cp) const;
    4747
    4848    virtual const std::string & GetPropertyValueGrepString();
     
    214214    const UnicodeSet GetCodepointSet(const std::string & value_spec) override;
    215215    const UnicodeSet GetCodepointSetMatchingPattern(re::RE * pattern) override;
    216     const UnicodeSet GetReflexiveSet() override;
    217     const std::string GetStringValue(UCD::codepoint_t cp) override;
     216    const UnicodeSet GetReflexiveSet() const override;
     217    const std::string GetStringValue(UCD::codepoint_t cp) const override;
    218218   
    219219private:
     
    248248    const UnicodeSet GetCodepointSet(const std::string & value_spec) override;
    249249    const UnicodeSet GetCodepointSetMatchingPattern(re::RE * pattern) override;
    250     const UnicodeSet GetReflexiveSet() override;
     250    const UnicodeSet GetReflexiveSet() const override;
    251251    const PropertyObject & GetBaseObject() {return mBaseObject;}
    252     const UnicodeSet & GetOverriddenSet() {return mOverriddenSet;}
    253     const std::string GetStringValue(UCD::codepoint_t cp) override;
     252    const UnicodeSet & GetOverriddenSet() const {return mOverriddenSet;}
     253    const std::string GetStringValue(UCD::codepoint_t cp) const override;
    254254
    255255private:
Note: See TracChangeset for help on using the changeset viewer.