mirror of
https://github.com/jakcron/nstool
synced 2024-11-15 02:06:40 +00:00
72 lines
No EOL
1.3 KiB
C++
72 lines
No EOL
1.3 KiB
C++
#pragma once
|
|
#include <nn/hac/aset.h>
|
|
#include <fnd/List.h>
|
|
#include <fnd/IByteModel.h>
|
|
|
|
namespace nn
|
|
{
|
|
namespace hac
|
|
{
|
|
class AssetHeader :
|
|
public fnd::IByteModel
|
|
{
|
|
public:
|
|
struct sSection
|
|
{
|
|
uint64_t offset;
|
|
uint64_t size;
|
|
|
|
void operator=(const sSection& other)
|
|
{
|
|
offset = other.offset;
|
|
size = other.size;
|
|
}
|
|
|
|
bool operator==(const sSection& other) const
|
|
{
|
|
return (offset == other.offset) \
|
|
&& (size == other.size);
|
|
}
|
|
|
|
bool operator!=(const sSection& other) const
|
|
{
|
|
return !operator==(other);
|
|
}
|
|
};
|
|
|
|
AssetHeader();
|
|
AssetHeader(const AssetHeader& other);
|
|
|
|
void operator=(const AssetHeader& other);
|
|
bool operator==(const AssetHeader& other) const;
|
|
bool operator!=(const AssetHeader& other) const;
|
|
|
|
// IByteModel
|
|
void toBytes();
|
|
void fromBytes(const byte_t* bytes, size_t len);
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
|
|
|
// variables
|
|
void clear();
|
|
|
|
const sSection& getIconInfo() const;
|
|
void setIconInfo(const sSection& info);
|
|
|
|
const sSection& getNacpInfo() const;
|
|
void setNacpInfo(const sSection& info);
|
|
|
|
const sSection& getRomfsInfo() const;
|
|
void setRomfsInfo(const sSection& info);
|
|
private:
|
|
const std::string kModuleName = "NRO_ASSET_HEADER";
|
|
|
|
// binary
|
|
fnd::Vec<byte_t> mRawBinary;
|
|
|
|
// data
|
|
sSection mIconInfo;
|
|
sSection mNacpInfo;
|
|
sSection mRomfsInfo;
|
|
};
|
|
}
|
|
} |