C++ (Qt)QSettings cfg;cfg.setValue("user/name", 1); QByteArray data;QBuffer buffer(&data);buffer.open(QIODevice::ReadWrite);QDataStream out(&buffer);out << cfg;
C++ (Qt)bool readBinFile(QIODevice &device, QSettings::SettingsMap &map){ map << device;} bool writeBinFile(QIODevice &device, const QSettings::SettingsMap &map){ device << map;} int main(int argc, char *argv[]){ const QSettings::Format BinFormat = QSettings::registerFormat("bin", readBinFile, writeBinFile); QSettings settings(BinFormat); }