nstool/lib/libnx/include/nx/FacBinary.h

55 lines
1.2 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include <fnd/MemoryBlob.h>
#include <fnd/List.h>
#include <nx/FacHeader.h>
2017-07-06 11:17:21 +00:00
namespace nx
{
2017-07-06 11:17:21 +00:00
class FacBinary :
public FacHeader
{
2017-07-06 11:17:21 +00:00
public:
FacBinary();
FacBinary(const FacBinary& other);
2018-03-22 05:26:22 +00:00
FacBinary(const byte_t* bytes, size_t len);
2017-07-06 11:17:21 +00:00
bool operator==(const FacBinary& other) const;
bool operator!=(const FacBinary& other) const;
void operator=(const FacBinary& other);
2017-07-06 11:17:21 +00:00
// to be used after export
2018-03-22 05:26:22 +00:00
const byte_t* getBytes() const;
2017-07-06 11:17:21 +00:00
size_t getSize() const;
2017-07-06 11:17:21 +00:00
// export/import binary
void exportBinary();
2018-03-22 05:26:22 +00:00
void importBinary(const byte_t* bytes, size_t len);
2017-07-06 11:17:21 +00:00
// variables
void clear();
2018-03-22 05:26:22 +00:00
const fnd::List<uint32_t>& getContentOwnerIdList() const;
void setContentOwnerIdList(const fnd::List<uint32_t>& list);
2018-03-22 05:26:22 +00:00
const fnd::List<uint32_t>& getSaveDataOwnerIdList() const;
void setSaveDataOwnerIdList(const fnd::List<uint32_t>& list);
2017-07-06 11:17:21 +00:00
private:
const std::string kModuleName = "FAC_BINARY";
2018-03-22 05:26:22 +00:00
static const uint32_t kFacFormatVersion = 1;
2017-07-06 11:17:21 +00:00
// raw binary
fnd::MemoryBlob mBinaryBlob;
2017-07-06 11:17:21 +00:00
// variables
2018-03-22 05:26:22 +00:00
fnd::List<uint32_t> mContentOwnerIdList;
fnd::List<uint32_t> mSaveDataOwnerIdList;
2017-07-06 11:17:21 +00:00
bool isEqual(const FacBinary& other) const;
void copyFrom(const FacBinary& other);
};
}