Athena IO Library
WiiSaveWriter.hpp
1 #ifndef ATHENA_NO_SAVES
2 // This file is part of libAthena.
3 //
4 // libAthena is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // libAthena is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with libAthena. If not, see <http://www.gnu.org/licenses/>
16 
17 #ifndef WIISAVEWRITER_HPP
18 #define WIISAVEWRITER_HPP
19 
20 #include "Athena/MemoryWriter.hpp"
21 
22 namespace Athena
23 {
24 class WiiSave;
25 class WiiBanner;
26 class WiiFile;
27 class WiiImage;
28 
29 namespace io
30 {
31 
39 class WiiSaveWriter : protected MemoryWriter
40 {
41  MEMORYWRITER_BASE();
42 public:
47  WiiSaveWriter(const std::string&);
48 
60  bool writeSave(WiiSave* save, atUint8* macAddress, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig, atUint32 ngKeyId, const std::string& filepath = "");
61 
62 private:
63  void writeBanner(WiiBanner* banner);
64  atUint32 writeFile(WiiFile* file);
65  void writeImage(WiiImage* image);
66  void writeCerts(atUint32 filesSize, atUint32 ngId, atUint8* ngPriv, atUint8* ngSig, atUint32 ngKeyId);
67 };
68 
69 } // io
70 } // zelda
71 #endif // WIISAVEWRITER_HPP
72 #endif // ATHENA_NO_SAVES
Wii data.bin writer class.
The WiiImage class.
Definition: WiiImage.hpp:28
std::string filepath() const
Returns the target file.
void save(const std::string &filename="")
Saves the file to the specified file.
bool writeSave(WiiSave *save, atUint8 *macAddress, atUint32 ngId, atUint8 *ngPriv, atUint8 *ngSig, atUint32 ngKeyId, const std::string &filepath="")
writeSave
Wii banner container class.
Definition: WiiBanner.hpp:33
Wii file container class.
Definition: WiiFile.hpp:36
Wii data.bin container class.
Definition: WiiSave.hpp:38
WiiSaveWriter(const std::string &)
This constructor creates an instance from a file on disk.