String ConfigObjectUtility::GetObjectConfigPath(const Type::Ptr& type, const String& fullName) { String typeDir = type->GetPluralName(); boost::algorithm::to_lower(typeDir); return GetConfigDir() + "/conf.d/" + typeDir + "/" + EscapeName(fullName) + ".conf"; }
Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName) { String uname = pluralName; boost::algorithm::to_lower(uname); { Dictionary::Ptr globals = ScriptGlobal::GetGlobals(); ObjectLock olock(globals); BOOST_FOREACH(const Dictionary::Pair& kv, globals) { if (!kv.second.IsObjectType<Type>()) continue; Type::Ptr type = kv.second; String pname = type->GetPluralName(); boost::algorithm::to_lower(pname); if (uname == pname) return type; } } return Type::Ptr(); }