MCPcopy Create free account
hub / github.com/blizzard4591/openMittsu / getOptionValueAsByteArray

Method getOptionValueAsByteArray

src/database/SimpleDatabase.cpp:1322–1331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

TEST_FFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64