2017-07-06 10:57:33 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
2018-06-28 16:20:56 +00:00
|
|
|
#include <fnd/types.h>
|
2018-06-24 15:56:55 +00:00
|
|
|
#include <fnd/ISerialisable.h>
|
2017-07-06 10:57:33 +00:00
|
|
|
#include <fnd/List.h>
|
2018-08-07 07:17:51 +00:00
|
|
|
#include <nn/hac/fac.h>
|
2017-07-17 08:21:39 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2017-07-06 10:57:33 +00:00
|
|
|
{
|
2018-06-28 16:20:56 +00:00
|
|
|
class FileSystemAccessControlBinary : public fnd::ISerialisable
|
2017-07-06 10:57:33 +00:00
|
|
|
{
|
2017-07-06 11:17:21 +00:00
|
|
|
public:
|
2018-07-10 14:55:04 +00:00
|
|
|
struct sSaveDataOwnerId
|
|
|
|
{
|
2018-08-07 07:17:51 +00:00
|
|
|
nn::hac::fac::SaveDataOwnerIdAccessType access_type;
|
2018-07-10 14:55:04 +00:00
|
|
|
uint64_t id;
|
|
|
|
|
|
|
|
void operator=(const sSaveDataOwnerId& other)
|
|
|
|
{
|
|
|
|
access_type = other.access_type;
|
|
|
|
id = other.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const sSaveDataOwnerId& other) const
|
|
|
|
{
|
|
|
|
return (access_type == other.access_type) \
|
|
|
|
&& (id == other.id);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const sSaveDataOwnerId& other) const
|
|
|
|
{
|
|
|
|
return !(*this == other);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-06-28 16:20:56 +00:00
|
|
|
FileSystemAccessControlBinary();
|
|
|
|
FileSystemAccessControlBinary(const FileSystemAccessControlBinary& other);
|
2017-07-06 10:57:33 +00:00
|
|
|
|
2018-06-28 16:20:56 +00:00
|
|
|
void operator=(const FileSystemAccessControlBinary& other);
|
|
|
|
bool operator==(const FileSystemAccessControlBinary& other) const;
|
|
|
|
bool operator!=(const FileSystemAccessControlBinary& other) const;
|
2017-07-06 10:57:33 +00:00
|
|
|
|
2017-07-06 11:17:21 +00:00
|
|
|
// export/import binary
|
2018-06-24 08:18:54 +00:00
|
|
|
void toBytes();
|
2018-06-28 16:20:56 +00:00
|
|
|
void fromBytes(const byte_t* data, size_t len);
|
2018-06-24 08:18:54 +00:00
|
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
2017-07-06 10:57:33 +00:00
|
|
|
|
2017-07-06 11:17:21 +00:00
|
|
|
// variables
|
2017-07-15 08:28:01 +00:00
|
|
|
void clear();
|
2017-07-06 10:57:33 +00:00
|
|
|
|
2018-06-28 16:20:56 +00:00
|
|
|
uint32_t getFormatVersion() const;
|
|
|
|
void setFormatVersion(uint32_t version);
|
|
|
|
|
2018-06-24 15:56:55 +00:00
|
|
|
const fnd::List<fac::FsAccessFlag>& getFsaRightsList() const;
|
|
|
|
void setFsaRightsList(const fnd::List<fac::FsAccessFlag>& list);
|
|
|
|
|
2018-07-10 14:55:04 +00:00
|
|
|
const fnd::List<uint64_t>& getContentOwnerIdList() const;
|
|
|
|
void setContentOwnerIdList(const fnd::List<uint64_t>& list);
|
2017-07-17 08:21:39 +00:00
|
|
|
|
2018-07-10 14:55:04 +00:00
|
|
|
const fnd::List<sSaveDataOwnerId>& getSaveDataOwnerIdList() const;
|
|
|
|
void setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list);
|
2017-07-06 11:17:21 +00:00
|
|
|
private:
|
2018-06-28 16:20:56 +00:00
|
|
|
const std::string kModuleName = "FILE_SYSTEM_ACCESS_CONTROL_BINARY";
|
2017-07-06 10:57:33 +00:00
|
|
|
|
2018-06-28 16:20:56 +00:00
|
|
|
// raw data
|
2018-06-24 08:18:54 +00:00
|
|
|
fnd::Vec<byte_t> mRawBinary;
|
2017-07-06 10:57:33 +00:00
|
|
|
|
2017-07-06 11:17:21 +00:00
|
|
|
// variables
|
2018-06-28 16:20:56 +00:00
|
|
|
uint32_t mVersion;
|
2018-06-24 15:56:55 +00:00
|
|
|
fnd::List<fac::FsAccessFlag> mFsaRights;
|
2018-07-10 14:55:04 +00:00
|
|
|
fnd::List<uint64_t> mContentOwnerIdList;
|
|
|
|
fnd::List<sSaveDataOwnerId> mSaveDataOwnerIdList;
|
2017-07-06 11:17:21 +00:00
|
|
|
};
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2018-06-28 16:20:56 +00:00
|
|
|
}
|