Files
sqlitebrowser/src/CipherSettings.cpp
Martin Kleusberg ba1270cedb Clean up the code and make some more minor optimisations
This also includes replacing some more Qt containers by their STL
counterparts.
2019-11-06 20:25:18 +01:00

26 lines
560 B
C++

#include "CipherSettings.h"
#include "sqlitedb.h"
CipherSettings::CipherSettings()
: keyFormat(Passphrase),
pageSize(0),
kdfIterations(0)
{
}
std::string CipherSettings::getPassword() const
{
if(keyFormat == Passphrase)
{
return sqlb::escapeString(password);
} else {
// Remove the '0x' part at the beginning
return "\"x'" + password.substr(2) + "'\"";
}
}
CipherSettings::KeyFormats CipherSettings::getKeyFormat(int rawKeyFormat)
{
return static_cast<CipherSettings::KeyFormats>(rawKeyFormat);
}