return ConfigItem::Ptr();
}
+bool ConfigItem::HasObject(const String& type, const String& name)
+{
+ boost::mutex::scoped_lock lock(m_Mutex);
+
+ ConfigItem::ItemMap::iterator it;
+
+ it = m_Items.find(std::make_pair(type, name));
+
+ return (it != m_Items.end());
+}
+
void ConfigItem::ValidateItem(void)
{
if (m_Validated)
static ConfigItem::Ptr GetObject(const String& type,
const String& name);
+ static bool HasObject(const String& type, const String& name);
void ValidateItem(void);
bool TypeRule::MatchValue(const Value& value, String *hint) const
{
- ConfigItem::Ptr item;
-
if (value.IsEmpty())
return true;
if (!value.IsScalar())
return false;
- item = ConfigItem::GetObject(m_NameType, value);
-
- if (!item) {
+ if (!ConfigItem::HasObject(m_NameType, value)) {
*hint = "Object '" + value + "' of type '" + m_NameType + "' does not exist.";
return false;
}