in resource.cpp [454:504]
void Line::FromJson(const rapidjson::Value& value)
{
const Value& token = GetJsonValue(value, "token");
for (Value::ConstValueIterator itr = token.Begin(); itr != token.End(); ++itr)
{
if (itr->IsString())
{
mToken.push_back(itr->GetString());
}
else
{
throw JsonException("ValueTypeException", "One value of member token is not string type");
}
}
if (value.HasMember("include_keys"))
{
mIncludeKeysSet = true;
const Value& includeKeys = GetJsonValue(value, "include_keys");
for (Value::ConstValueIterator itr = includeKeys.Begin(); itr != includeKeys.End(); ++itr)
{
if (itr->IsString())
{
mIncludeKeys.push_back(itr->GetString());
}
else
{
throw JsonException("ValueTypeException", "One value of member includeKeys is not string type");
}
}
}
if (value.HasMember("exclude_keys"))
{
mExcludeKeysSet = true;
const Value& excludeKeys = GetJsonValue(value, "exclude_keys");
for (Value::ConstValueIterator itr = excludeKeys.Begin(); itr != excludeKeys.End(); ++itr)
{
if (itr->IsString())
{
mExcludeKeys.push_back(itr->GetString());
}
else
{
throw JsonException("ValueTypeException", "One value of member excludeKeys is not string type");
}
}
}
ExtractJsonResult(value, "caseSensitive", mCaseSensitive);
}