athena/include/Athena/WiiSaveWriter.hpp

56 lines
1.3 KiB
C++
Raw Permalink Normal View History

2015-03-01 20:42:39 +00:00
#ifndef WIISAVEWRITER_HPP
#define WIISAVEWRITER_HPP
2013-02-16 04:22:16 +00:00
2015-03-01 20:42:39 +00:00
#include "Athena/MemoryWriter.hpp"
2013-07-21 03:57:20 +00:00
2014-04-20 09:14:15 +00:00
namespace Athena
2013-07-21 03:57:20 +00:00
{
2013-02-16 04:22:16 +00:00
class WiiSave;
class WiiBanner;
class WiiFile;
class WiiImage;
namespace io
{
2013-07-21 03:57:20 +00:00
/*! \class WiiSaveWriter
* \brief Wii data.bin writer class
*
* A Class for writing binary data to a wii data.bin file,
* all work is done using a memory buffer, and not written directly to the disk.
* \sa BinaryReader
*/
class WiiSaveWriter : protected MemoryCopyWriter
2013-02-16 04:22:16 +00:00
{
MEMORYCOPYWRITER_BASE();
2013-02-16 04:22:16 +00:00
public:
2013-07-21 03:57:20 +00:00
/*! \brief This constructor creates an instance from a file on disk.
*
* \param filename The file to create the stream from
*/
2013-02-16 04:22:16 +00:00
WiiSaveWriter(const std::string&);
2013-07-21 03:57:20 +00:00
/*!
* \brief writeSave
* \param save
* \param macAddress
* \param ngId
* \param ngPriv
* \param ngSig
* \param ngKeyId
* \param filepath
* \return
*/
bool writeSave(WiiSave* save, atUint8* macAddress, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig, atUint32 ngKeyId, const std::string& filepath = "");
2013-02-16 04:22:16 +00:00
private:
void writeBanner(WiiBanner* banner);
atUint32 writeFile(WiiFile* file);
2013-02-16 04:22:16 +00:00
void writeImage(WiiImage* image);
void writeCerts(atUint32 filesSize, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig, atUint32 ngKeyId);
2013-02-16 04:22:16 +00:00
};
} // io
2013-07-21 03:57:20 +00:00
} // zelda
2015-03-01 20:42:39 +00:00
#endif // WIISAVEWRITER_HPP