jce-manager/src/appDatabase/savedata.h
2014-10-14 02:45:11 +03:00

61 lines
1.1 KiB
C++

#ifndef SAVEDATA_H
#define SAVEDATA_H
/**
* SaveData Class
* --------------------------------------
*
* Uses QMap
*
* key : vale
*
* Keys:
* "username"
* "password"
* "locale"
* "calendar"
*
* Note that the password will be encrypted using the SimpleCrypt class!
*
* SimpleCrypt class was found at the qt projects forms - and been fixed by Sagi Dayan.
*
*/
/* QT libs */
#include <QString>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QMap>
#include "simplecrypt.h"
#define FILE_NAME "JM.dat"
class SaveData
{
public:
SaveData();
bool isSaved();
void reset();
void setUsername(QString username);
void setPassword(QString password);
void setCal(QString cal);
void setLocale(QString locale);
QString getUsername();
QString getPassword();
QString getCal();
QString getLocale();
private:
QMap<QString, QString> DB;
void load();
void save();
void createDB();
QString encrypt(QString pass);
QString decrypte(QString pass);
};
#endif // SAVEDATA_H