Ignore:
Timestamp:
Oct 5, 2017, 1:21:22 PM (21 months ago)
Author:
cameron
Message:

Numeric Property Support and missing SpecialCasing?.h file

File:
1 edited

Legend:

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

    r5668 r5670  
    196196}
    197197   
     198const UnicodeSet NumericPropertyObject::GetCodepointSet(const std::string & value_spec) {
     199    if (value_spec == "NaN") return mNaNCodepointSet;
     200    else {
     201        UnicodeSet result_set;
     202        unsigned val_bytes = value_spec.length();
     203        const char * value_str = value_spec.c_str();
     204        const char * search_str = mStringBuffer;
     205        unsigned buffer_line = 0;
     206        while (buffer_line < mExplicitCps.size()) {
     207            const char * eol = strchr(search_str, '\n');
     208            unsigned len = eol - search_str;
     209            if ((len == val_bytes) && (memcmp(search_str, value_str, len) == 0)) {
     210                result_set.insert(mExplicitCps[buffer_line]);
     211            }
     212            buffer_line++;
     213            search_str = eol+1;
     214        }
     215        return result_set;
     216    }
     217}
     218
    198219const UnicodeSet StringPropertyObject::GetCodepointSet(const std::string & value_spec) {
    199220    if (value_spec == "") return mNullCodepointSet;
Note: See TracChangeset for help on using the changeset viewer.