bool updated_original_attributes = false;
Type::Ptr type = GetReflectionType();
-
+
std::vector<String> tokens;
boost::algorithm::split(tokens, attr, boost::is_any_of("."));
-
+
String fieldName = tokens[0];
-
+
int fid = type->GetFieldId(fieldName);
Field field = type->GetFieldInfo(fid);
-
+
Value oldValue = GetField(fid);
if (field.Attributes & FAConfig) {
original_attributes->Set(attr, oldValue);
}
}
-
+
Value newValue;
-
+
if (tokens.size() > 1) {
newValue = oldValue.Clone();
Value current = newValue;
-
+
if (current.IsEmpty()) {
current = new Dictionary();
newValue = current;
}
-
+
for (std::vector<String>::size_type i = 1; i < tokens.size() - 1; i++) {
if (!current.IsObjectType<Dictionary>())
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
Dictionary::Ptr dict = current;
const String& key = tokens[i];
-
+
if (!dict->Contains(key)) {
current = new Dictionary();
dict->Set(key, current);
current = dict->Get(key);
}
}
-
+
if (!current.IsObjectType<Dictionary>())
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
-
+
Dictionary::Ptr dict = current;
const String& key = tokens[tokens.size() - 1];
-
+
dict->Set(key, value);
} else
newValue = value;
}
SetAuthority(true);
-
+
NotifyActive();
}