mirror of https://github.com/AxioDL/nod.git
added virtual destructors to complete polymorphic life-cycles
This commit is contained in:
parent
993b30e4a5
commit
7114f079a4
|
@ -12,4 +12,3 @@ file(GLOB NOD_HEADERS include/NOD/*.hpp)
|
||||||
add_subdirectory(lib)
|
add_subdirectory(lib)
|
||||||
add_subdirectory(driver)
|
add_subdirectory(driver)
|
||||||
install(DIRECTORY include/NOD DESTINATION include/NOD)
|
install(DIRECTORY include/NOD DESTINATION include/NOD)
|
||||||
set(NOD_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE PATH "NODLib include dir" FORCE)
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ namespace NOD
|
||||||
class DiscBase
|
class DiscBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~DiscBase() {}
|
||||||
struct Header
|
struct Header
|
||||||
{
|
{
|
||||||
char gameID[6];
|
char gameID[6];
|
||||||
|
@ -52,6 +53,7 @@ public:
|
||||||
class IPartition
|
class IPartition
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~IPartition() {}
|
||||||
enum Kind
|
enum Kind
|
||||||
{
|
{
|
||||||
PART_DATA,
|
PART_DATA,
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
|
|
||||||
struct IReadStream
|
struct IReadStream
|
||||||
{
|
{
|
||||||
|
virtual ~IReadStream() {}
|
||||||
virtual uint64_t read(void* buf, uint64_t length)=0;
|
virtual uint64_t read(void* buf, uint64_t length)=0;
|
||||||
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
|
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
|
||||||
virtual uint64_t position() const=0;
|
virtual uint64_t position() const=0;
|
||||||
|
@ -29,6 +30,7 @@ public:
|
||||||
|
|
||||||
struct IWriteStream
|
struct IWriteStream
|
||||||
{
|
{
|
||||||
|
virtual ~IWriteStream() {}
|
||||||
virtual uint64_t write(void* buf, uint64_t length)=0;
|
virtual uint64_t write(void* buf, uint64_t length)=0;
|
||||||
};
|
};
|
||||||
virtual std::unique_ptr<IWriteStream> beginWriteStream(uint64_t offset=0) const=0;
|
virtual std::unique_ptr<IWriteStream> beginWriteStream(uint64_t offset=0) const=0;
|
||||||
|
@ -36,6 +38,7 @@ public:
|
||||||
|
|
||||||
struct IPartReadStream
|
struct IPartReadStream
|
||||||
{
|
{
|
||||||
|
virtual ~IPartReadStream() {}
|
||||||
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
|
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
|
||||||
virtual uint64_t position() const=0;
|
virtual uint64_t position() const=0;
|
||||||
virtual uint64_t read(void* buf, uint64_t length)=0;
|
virtual uint64_t read(void* buf, uint64_t length)=0;
|
||||||
|
@ -43,6 +46,7 @@ struct IPartReadStream
|
||||||
|
|
||||||
struct IPartWriteStream
|
struct IPartWriteStream
|
||||||
{
|
{
|
||||||
|
virtual ~IPartWriteStream() {}
|
||||||
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
|
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
|
||||||
virtual uint64_t position() const=0;
|
virtual uint64_t position() const=0;
|
||||||
virtual uint64_t write(void* buf, uint64_t length)=0;
|
virtual uint64_t write(void* buf, uint64_t length)=0;
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace NOD
|
||||||
class IAES
|
class IAES
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~IAES() {}
|
||||||
virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
|
virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
|
||||||
virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
|
virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
|
||||||
virtual void setKey(const uint8_t* key)=0;
|
virtual void setKey(const uint8_t* key)=0;
|
||||||
|
|
Loading…
Reference in New Issue