Serializes a QSettings's data in an (optionally) encrypted binary format. SettingsSerializer can detect regular .ini files and serialized ones, it will read both regular and serialized .ini, but only save in serialized format. The file is encrypted with the current profile's password, if any. The file is only written to disk if save() is called, the destructor does not save to disk All member functions are reentrant, but not thread safe.
More...
#include <settingsserializer.h>
|
static const char | magic [] = {0x51, 0x54, 0x4F, 0x58} |
|
Serializes a QSettings's data in an (optionally) encrypted binary format. SettingsSerializer can detect regular .ini files and serialized ones, it will read both regular and serialized .ini, but only save in serialized format. The file is encrypted with the current profile's password, if any. The file is only written to disk if save() is called, the destructor does not save to disk All member functions are reentrant, but not thread safe.
Definition at line 29 of file settingsserializer.h.
◆ RecordTag
◆ SettingsSerializer()
SettingsSerializer::SettingsSerializer |
( |
QString |
filePath, |
|
|
const ToxEncrypt * |
passKey = nullptr |
|
) |
| |
◆ beginGroup()
void SettingsSerializer::beginGroup |
( |
const QString & |
prefix | ) |
|
◆ beginReadArray()
int SettingsSerializer::beginReadArray |
( |
const QString & |
prefix | ) |
|
◆ beginWriteArray()
void SettingsSerializer::beginWriteArray |
( |
const QString & |
prefix, |
|
|
int |
size = -1 |
|
) |
| |
◆ endArray()
void SettingsSerializer::endArray |
( |
| ) |
|
◆ endGroup()
void SettingsSerializer::endGroup |
( |
| ) |
|
◆ findValue() [1/2]
◆ findValue() [2/2]
◆ isSerializedFormat()
bool SettingsSerializer::isSerializedFormat |
( |
QString |
filePath | ) |
|
|
static |
Checks if the file is serialized settings.
- Parameters
-
filePath | Path to file to check. |
- Returns
- False on error, true otherwise.
Definition at line 228 of file settingsserializer.cpp.
◆ load()
void SettingsSerializer::load |
( |
| ) |
|
◆ readIni()
void SettingsSerializer::readIni |
( |
| ) |
|
|
private |
◆ readSerialized()
void SettingsSerializer::readSerialized |
( |
| ) |
|
|
private |
◆ removeGroup()
void SettingsSerializer::removeGroup |
( |
int |
group | ) |
|
|
private |
Remove group.
- Note
- The group must be empty.
- Parameters
-
group | ID of group to remove. |
Definition at line 536 of file settingsserializer.cpp.
◆ removeValue()
void SettingsSerializer::removeValue |
( |
const QString & |
key | ) |
|
|
private |
◆ save()
void SettingsSerializer::save |
( |
| ) |
|
◆ setArrayIndex()
void SettingsSerializer::setArrayIndex |
( |
int |
i | ) |
|
◆ setValue()
void SettingsSerializer::setValue |
( |
const QString & |
key, |
|
|
const QVariant & |
value |
|
) |
| |
◆ value()
QVariant SettingsSerializer::value |
( |
const QString & |
key, |
|
|
const QVariant & |
defaultValue = QVariant() |
|
) |
| const |
◆ writePackedVariant()
void SettingsSerializer::writePackedVariant |
( |
QDataStream & |
dataStream, |
|
|
const QVariant & |
v |
|
) |
| |
|
private |
◆ readStream
◆ writeStream
◆ array
int SettingsSerializer::array |
|
private |
◆ arrayIndex
int SettingsSerializer::arrayIndex |
|
private |
◆ arrays
QVector<Array> SettingsSerializer::arrays |
|
private |
◆ group
int SettingsSerializer::group |
|
private |
◆ groups
QStringList SettingsSerializer::groups |
|
private |
◆ magic
const char SettingsSerializer::magic = {0x51, 0x54, 0x4F, 0x58} |
|
staticprivate |
◆ passKey
◆ path
QString SettingsSerializer::path |
|
private |
◆ values
QVector<Value> SettingsSerializer::values |
|
private |
The documentation for this class was generated from the following files: