0ad/source/tools/pmdexp/FilePacker.h
janwas b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00

38 lines
1.0 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: FilePacker.h
///////////////////////////////////////////////////////////////////////////////
#ifndef _FILEPACKER_H
#define _FILEPACKER_H
#include <vector>
////////////////////////////////////////////////////////////////////////////////////////
// CFilePacker: class to assist in writing of binary files
class CFilePacker
{
public:
// CFilePacker exceptions
class CError { };
class CFileOpenError : public CError { };
class CFileWriteError : public CError { };
public:
// constructor
CFilePacker();
// Write: write out any packed data to file, using given version and magic bits
void Write(const char* filename,u32 version,const char magicstr[4]);
// PackRaw: pack given number of bytes onto the end of the data stream
void PackRaw(const void* rawdata,u32 rawdatalen);
// PackString: pack a string onto the end of the data stream
void PackString(const char* str);
private:
// the output data stream built during pack operations
std::vector<u8> m_Data;
};
#endif