Changeset 14562 for trunk/FACT++


Ignore:
Timestamp:
11/05/12 18:40:30 (12 years ago)
Author:
tbretz
Message:
Distinguish the case between 'no data received' and 'data received but zero size'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r14560 r14562  
    762762    ret->Set(String::New("time"),    date,                          ReadOnly);
    763763
     764    // If no event was received (usually a disconnection event in
     765    // the context of FACT++), no data is returned
     766    if (evt->IsEmpty())
     767        return ret;
     768
     769    // If valid data was received, but the size was zero, then
     770    // null is returned as data
     771    if (evt->GetSize()==0)
     772    {
     773        ret->Set(String::New("data"), Null(), ReadOnly);
     774        return ret;
     775    }
     776
    764777    typedef boost::char_separator<char> separator;
    765778    const boost::tokenizer<separator> tokenizer(evt->GetFormat(), separator(";:"));
Note: See TracChangeset for help on using the changeset viewer.