nstool/lib/nx/NpdmBinary.h

56 lines
1.1 KiB
C++

#pragma once
#include <string>
#include <fnd/memory_blob.h>
#include <fnd/List.h>
#include <nx/ISerialiseableBinary.h>
#include <nx/NpdmHeader.h>
#include <nx/AciBinary.h>
#include <nx/AcidBinary.h>
namespace nx
{
class NpdmBinary :
public NpdmHeader
{
public:
NpdmBinary();
NpdmBinary(const NpdmBinary& other);
NpdmBinary(const u8* bytes, size_t len);
bool operator==(const NpdmBinary& other) const;
bool operator!=(const NpdmBinary& other) const;
void operator=(const NpdmBinary& other);
// to be used after export
const u8* getBytes() const;
size_t getSize() const;
// export/import binary
void exportBinary();
void importBinary(const u8* bytes, size_t len);
// variables
void clear();
const AciBinary& getAci() const;
void setAci(const AciBinary& aci);
const AcidBinary& getAcid() const;
void setAcid(const AcidBinary& acid);
private:
const std::string kModuleName = "NPDM_BINARY";
// raw binary
fnd::MemoryBlob mBinaryBlob;
// variables
AciBinary mAci;
AcidBinary mAcid;
bool isEqual(const NpdmBinary& other) const;
void copyFrom(const NpdmBinary& other);
};
}