| 1320 | } |
| 1321 | |
| 1322 | QByteArray SimpleDatabase::getOptionValueAsByteArray(QString const& optionName) { |
| 1323 | QString const value = getOptionValueInternal(optionName, false); |
| 1324 | QRegularExpression regexp("^(?:[a-f0-9][a-f0-9])*$"); |
| 1325 | QRegularExpressionMatch match = regexp.match(value); |
| 1326 | if (!match.hasMatch()) { |
| 1327 | throw openmittsu::exceptions::InternalErrorException() << "Could not convert value \"" << value.toStdString() << "\" of option " << optionName.toStdString() << " into a boolean."; |
| 1328 | } |
| 1329 | |
| 1330 | return QByteArray::fromHex(value.toUtf8()); |
| 1331 | } |
| 1332 | |
| 1333 | void SimpleDatabase::setOptionValue(QString const& optionName, QString const& optionValue) { |
| 1334 | setOptionInternal(optionName, optionValue, false); |