Esempio n. 1
0
wxStringMap_t JSONItem::toStringMap() const
{
    wxStringMap_t res;
    if(!_json) { return res; }

    if(_json->type != cJSON_Array) { return res; }

    for(int i = 0; i < arraySize(); ++i) {
        wxString key = arrayItem(i).namedObject("key").toString();
        wxString val = arrayItem(i).namedObject("value").toString();
        res.insert(std::make_pair(key, val));
    }
    return res;
}
Esempio n. 2
0
wxArrayString JSONItem::toArrayString(const wxArrayString& defaultValue) const
{
    if(!_json) { return defaultValue; }

    if(_json->type != cJSON_Array) { return defaultValue; }

    wxArrayString arr;
    for(int i = 0; i < arraySize(); i++) {
        arr.Add(arrayItem(i).toString());
    }
    return arr;
}
Esempio n. 3
0
wxArrayString JSONElement::toArrayString() const
{
    wxArrayString arr;
    if(!_json) {
        return arr;
    }

    if(_json->type != cJSON_Array) {
        return arr;
    }
    
    for(int i=0; i<arraySize(); i++) {
        arr.Add(arrayItem(i).toString());
    }
    return arr;
}