paysages3d/src/system/PackStream.h

44 lines
719 B
C
Raw Normal View History

#ifndef PACKSTREAM_H
#define PACKSTREAM_H
#include "system_global.h"
2013-10-31 16:59:18 +00:00
#include <QString>
class QFile;
class QDataStream;
namespace paysages
{
namespace system
{
/*!
* \brief Data (de)serialization in files or streams.
*/
class SYSTEMSHARED_EXPORT PackStream
{
public:
PackStream();
~PackStream();
2013-11-03 12:00:31 +00:00
bool bindToFile(const char* filepath, bool write=false);
void write(int* value);
void write(double* value);
void write(char* value, int max_length);
2013-10-31 16:59:18 +00:00
void write(QString value);
void read(int* value);
void read(double* value);
void read(char* value, int max_length);
2013-10-31 16:59:18 +00:00
QString readString();
private:
QFile* file;
QDataStream* stream;
};
}
}
#endif // PACKSTREAM_H