Athena IO Library
MCFileWriter.hpp
1 #ifndef MCFILEWRITER_HPP
2 #define MCFILEWRITER_HPP
3 
4 #include "athena/Types.hpp"
5 #include "athena/MemoryWriter.hpp"
6 
7 namespace athena
8 {
9 
10 class MCFile;
11 
12 namespace io
13 {
14 
22 class MCFileWriter : protected MemoryCopyWriter
23 {
24  MEMORYCOPYWRITER_BASE();
25 public:
32  MCFileWriter(atUint8*, atUint64);
33 
39  MCFileWriter(const std::string&);
40 
46  void writeFile(MCFile* file);
47 
48  static atUint16 calculateChecksum(atUint8* data, atUint32 length);
49 private:
50  atUint16 calculateSlotChecksum(atUint32 game);
51 };
52 
53 } // io
54 } // zelda
55 
56 #endif // MCFILEWRITER_HPP
atUint8 * data() const
Returns a copy of the current buffer. Changes to the copy do not affect the buffer so it's perfectly...
MCFileWriter(atUint8 *, atUint64)
This constructor takes an existing buffer to write to.
atUint64 length() const
Returns the length of the stream.
The Minish Cap Save save data writer class.
The Minish Cap data container class class.
Definition: MCFile.hpp:16
void writeFile(MCFile *file)
Writes the given save data to a file on disk.