QString RegistryPersistence::ReadOptional(const SmartPointer<IConfigurationElement>& configurationElement, const QString& attribute) { QString value = configurationElement->GetAttribute(attribute); if (value.isEmpty()) { value = QString(); } return value; }
QString RegistryPersistence::ReadRequired(const SmartPointer<IConfigurationElement>& configurationElement, const QString& attribute, QList<SmartPointer<IStatus> >& warningsToLog, const QString& message, const QString& id) { const QString value = configurationElement->GetAttribute(attribute); if (value.isEmpty()) { AddWarning(warningsToLog, message, configurationElement, id); return QString(); } return value; }
bool RegistryPersistence::CheckClass(const SmartPointer<IConfigurationElement>& configurationElement, QList<SmartPointer<IStatus> >& warningsToLog, const QString& message, const QString& id) { // Check to see if we have a handler class. if ((configurationElement->GetAttribute(ATT_CLASS).isNull()) && (configurationElement->GetChildren(TAG_CLASS).isEmpty())) { AddWarning(warningsToLog, message, configurationElement, id); return false; } return true; }
bool RegistryPersistence::ReadBoolean(const SmartPointer<IConfigurationElement>& configurationElement, const QString& attribute, const bool defaultValue) { const QString value = configurationElement->GetAttribute(attribute); if (value.isNull()) { return defaultValue; } if (defaultValue) { return value.compare("false", Qt::CaseInsensitive) != 0; } return value.compare("true", Qt::CaseInsensitive) == 0; }