nstool/lib/libnx/include/nx/SacBinary.h

49 lines
1 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include <vector>
#include <fnd/MemoryBlob.h>
#include <fnd/List.h>
#include <fnd/ISerialiseableBinary.h>
#include <nx/SacEntry.h>
2017-07-06 11:17:21 +00:00
namespace nx
{
2017-07-06 11:17:21 +00:00
class SacBinary :
public fnd::ISerialiseableBinary
2017-07-06 11:17:21 +00:00
{
public:
SacBinary();
SacBinary(const SacBinary& other);
2018-03-22 05:26:22 +00:00
SacBinary(const byte_t* bytes, size_t len);
2017-07-06 11:17:21 +00:00
bool operator==(const SacBinary& other) const;
bool operator!=(const SacBinary& other) const;
void operator=(const SacBinary& other);
// to be used after export
2018-03-22 05:26:22 +00:00
const byte_t* getBytes() const;
2017-07-06 11:17:21 +00:00
size_t getSize() const;
// export/import binary
void exportBinary();
2018-03-22 05:26:22 +00:00
void importBinary(const byte_t* bytes, size_t len);
2017-07-06 11:17:21 +00:00
// variables
void clear();
2017-07-06 11:17:21 +00:00
const fnd::List<SacEntry>& getServiceList() const;
void addService(const SacEntry& service);
private:
const std::string kModuleName = "SAC_BINARY";
// raw binary
fnd::MemoryBlob mBinaryBlob;
// variables
fnd::List<SacEntry> mServices;
bool isEqual(const SacBinary& other) const;
void copyFrom(const SacBinary& other);
};
}