FileStorage.hpp Example File
persistentobjects/src/FileStorage.hpp
#ifndef FILESTORAGE_HPP
#define FILESTORAGE_HPP
#include "Storage.hpp"
using namespace bb::cascades;
class FileStorage: public Storage
{
public:
FileStorage();
virtual ~FileStorage();
virtual bool clear();
virtual int load(int& lastID, GroupDataModel *model);
virtual bool save(int lastID, GroupDataModel *model);
private:
static const QString m_personsFilePath;
bool serializeDataModel(int lastID, GroupDataModel* model, QDataStream* stream);
int deserializeIntoDataModel(QDataStream *stream, GroupDataModel *model, int& lastID);
bool loadPerson(QDataStream* stream, GroupDataModel *model);
bool loadLastCustomerID(QDataStream* stream, int& id);
};
#endif