EHS/include/ehs/db/Database.h

56 lines
896 B
C++

#pragma once
#include "ehs/Array.h"
#include "DbTable.h"
namespace ehs
{
class EHS_LIB_IO Database
{
private:
UInt_64 hashId;
Str_8 id;
Version version;
Array<DbTable> tables;
Str_8 dir;
public:
Database();
Database(Str_8 id, const Version& version);
Database(Str_8 filePath);
Database(Database&& db) noexcept;
Database(const Database& db);
Database& operator=(Database&& db) noexcept;
Database& operator=(const Database& db);
UInt_64 GetHashId() const;
void SetId(Str_8 newId);
Str_8 GetId() const;
void SetVersion(const Version& newVersion);
Version GetVersion() const;
bool HasTable(UInt_64 hashId) const;
bool HasTable(const Str_8& id) const;
DbTable* CreateTable(Str_8 id);
DbTable* GetTable(UInt_64 hashId) const;
DbTable* GetTable(const Str_8& id) const;
Str_8 GetDirectory() const;
void Save(Str_8 directory);
};
}