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

51 lines
1.2 KiB
C
Raw Permalink Normal View History

2018-10-27 07:06:33 +00:00
#pragma once
#include <string>
#include <fnd/types.h>
#include <fnd/IByteModel.h>
namespace nn
{
namespace hac
{
class ServiceAccessControlEntry :
public fnd::IByteModel
{
public:
ServiceAccessControlEntry();
ServiceAccessControlEntry(const std::string& name, bool isServer);
ServiceAccessControlEntry(const ServiceAccessControlEntry& other);
void operator=(const ServiceAccessControlEntry& other);
bool operator==(const ServiceAccessControlEntry& other) const;
bool operator!=(const ServiceAccessControlEntry& other) const;
// IByteModel
void toBytes();
void fromBytes(const byte_t* bytes, size_t len);
const fnd::Vec<byte_t>& getBytes() const;
// variables
void clear();
bool isServer() const;
void setIsServer(bool isServer);
const std::string& getName() const;
void setName(const std::string& name);
private:
const std::string kModuleName = "SERVICE_ACCESS_CONTROL_ENTRY";
static const size_t kMaxServiceNameLen = 8;
enum ServiceAccessControlEntryFlag
{
SAC_IS_SERVER = _BIT(7),
SAC_NAME_LEN_MASK = _BIT(7) - 1
};
// raw binary
fnd::Vec<byte_t> mRawBinary;
// variables
bool mIsServer;
std::string mName;
};
}
2017-07-06 11:17:21 +00:00
}