nstool/lib/libhac/include/nn/hac/FileSystemAccessControl.h

78 lines
1.9 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include <fnd/types.h>
#include <fnd/IByteModel.h>
#include <fnd/List.h>
#include <nn/hac/define/fac.h>
2018-08-07 07:17:51 +00:00
namespace nn
{
namespace hac
{
class FileSystemAccessControl :
public fnd::IByteModel
{
2017-07-06 11:17:21 +00:00
public:
struct sSaveDataOwnerId
{
2018-08-07 07:17:51 +00:00
nn::hac::fac::SaveDataOwnerIdAccessType access_type;
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);
}
};
FileSystemAccessControl();
FileSystemAccessControl(const FileSystemAccessControl& other);
void operator=(const FileSystemAccessControl& other);
bool operator==(const FileSystemAccessControl& other) const;
bool operator!=(const FileSystemAccessControl& other) const;
// IByteModel
2018-06-24 08:18:54 +00:00
void toBytes();
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 11:17:21 +00:00
// variables
void clear();
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);
const fnd::List<uint64_t>& getContentOwnerIdList() const;
void setContentOwnerIdList(const fnd::List<uint64_t>& list);
const fnd::List<sSaveDataOwnerId>& getSaveDataOwnerIdList() const;
void setSaveDataOwnerIdList(const fnd::List<sSaveDataOwnerId>& list);
2017-07-06 11:17:21 +00:00
private:
const std::string kModuleName = "FILE_SYSTEM_ACCESS_CONTROL";
// raw data
2018-06-24 08:18:54 +00:00
fnd::Vec<byte_t> mRawBinary;
2017-07-06 11:17:21 +00:00
// variables
uint32_t mVersion;
2018-06-24 15:56:55 +00:00
fnd::List<fac::FsAccessFlag> mFsaRights;
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
}
}