2018-06-10 06:57:00 +00:00
|
|
|
#pragma once
|
2018-10-22 13:39:23 +00:00
|
|
|
#include <nn/hac/define/aset.h>
|
2018-06-10 06:57:00 +00:00
|
|
|
#include <fnd/List.h>
|
2018-10-14 05:45:09 +00:00
|
|
|
#include <fnd/IByteModel.h>
|
2018-06-10 06:57:00 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2018-06-10 06:57:00 +00:00
|
|
|
{
|
2018-06-10 15:48:04 +00:00
|
|
|
class AssetHeader :
|
2018-10-14 05:45:09 +00:00
|
|
|
public fnd::IByteModel
|
2018-06-10 06:57:00 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct sSection
|
|
|
|
{
|
|
|
|
uint64_t offset;
|
|
|
|
uint64_t size;
|
2018-06-24 04:57:10 +00:00
|
|
|
|
|
|
|
void operator=(const sSection& other)
|
|
|
|
{
|
|
|
|
offset = other.offset;
|
|
|
|
size = other.size;
|
|
|
|
}
|
2018-06-24 05:16:02 +00:00
|
|
|
|
|
|
|
bool operator==(const sSection& other) const
|
|
|
|
{
|
|
|
|
return (offset == other.offset) \
|
|
|
|
&& (size == other.size);
|
|
|
|
}
|
2018-06-24 05:18:18 +00:00
|
|
|
|
|
|
|
bool operator!=(const sSection& other) const
|
|
|
|
{
|
|
|
|
return !operator==(other);
|
|
|
|
}
|
2018-06-10 06:57:00 +00:00
|
|
|
};
|
|
|
|
|
2018-06-10 15:48:04 +00:00
|
|
|
AssetHeader();
|
|
|
|
AssetHeader(const AssetHeader& other);
|
2018-06-10 06:57:00 +00:00
|
|
|
|
2018-06-24 05:21:52 +00:00
|
|
|
void operator=(const AssetHeader& other);
|
2018-06-10 15:48:04 +00:00
|
|
|
bool operator==(const AssetHeader& other) const;
|
|
|
|
bool operator!=(const AssetHeader& other) const;
|
2018-06-10 06:57:00 +00:00
|
|
|
|
2018-10-18 12:53:28 +00:00
|
|
|
// IByteModel
|
2018-06-24 04:52:06 +00:00
|
|
|
void toBytes();
|
|
|
|
void fromBytes(const byte_t* bytes, size_t len);
|
|
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
2018-06-10 06:57:00 +00:00
|
|
|
|
|
|
|
// 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
|
2018-06-24 04:52:06 +00:00
|
|
|
fnd::Vec<byte_t> mRawBinary;
|
2018-06-10 06:57:00 +00:00
|
|
|
|
|
|
|
// data
|
|
|
|
sSection mIconInfo;
|
|
|
|
sSection mNacpInfo;
|
|
|
|
sSection mRomfsInfo;
|
|
|
|
};
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2018-06-10 06:57:00 +00:00
|
|
|
}
|