void ConfigInputDetail::FromJson()

in resource.cpp [188:238]


void ConfigInputDetail::FromJson(const Value& value)
{
    ExtractJsonResult(value, "logType", mLogType);
    ExtractJsonResult(value, "logPath", mLogPath);
    ExtractJsonResult(value, "filePattern", mFilePattern);
    ExtractJsonResult(value, "localStorage", mLocalStorage);
    ExtractJsonResult(value, "timeFormat", mTimeFormat);
    ExtractJsonResult(value, "logBeginRegex", mLogBeginRegex);
    ExtractJsonResult(value, "regex", mRegex);

    const Value& key = GetJsonValue(value, "key");
    for (Value::ConstValueIterator itr = key.Begin(); itr != key.End(); ++itr)
    {
        if (itr->IsString())
        {
            mKey.push_back(itr->GetString());
        }
        else
        {
            throw JsonException("ValueTypeException", "One value of member key is not string type");
        }
    }

    const Value& filterKey = GetJsonValue(value, "filterKey");
    for (Value::ConstValueIterator itr = filterKey.Begin(); itr != filterKey.End(); ++itr)
    {
        if (itr->IsString())
        {
            mFilterKey.push_back(itr->GetString());
        }
        else
        {
            throw JsonException("ValueTypeException", "One value of member filterKey is not string type");
        }
    }

    const Value& filterRegex = GetJsonValue(value, "filterRegex");
    for (Value::ConstValueIterator itr = filterRegex.Begin(); itr != filterRegex.End(); ++itr)
    {
        if (itr->IsString())
        {
            mFilterRegex.push_back(itr->GetString());
        }
        else
        {
            throw JsonException("ValueTypeException", "One value of member key is not string type");
        }
    }

    ExtractJsonResult(value, "topicFormat", mTopicFormat);
}