Fixed the Logging system to actually be able to handle errors. Database is also fixed to use directories.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "ehs/db/DbObject.h"
|
||||
#include "ehs/db/DbTable.h"
|
||||
#include "ehs/Serializer.h"
|
||||
#include "ehs/db/Database.h"
|
||||
#include "ehs/io/Directory_LNX.h"
|
||||
#include "ehs/io/File.h"
|
||||
|
||||
namespace ehs
|
||||
@@ -100,7 +102,9 @@ namespace ehs
|
||||
for (UInt_64 i = 0; i < vars.Size(); ++i)
|
||||
vars[i].Serialize(data);
|
||||
|
||||
File file(parent->GetId() + "/" + Str_8::FromNum(id) + ".eho", Mode::WRITE, Disposition::CREATE_PERSISTENT);
|
||||
Directory::CreateRecursive(parent->parent->GetDirectory() + "/" + parent->GetId());
|
||||
|
||||
File file(parent->parent->GetDirectory() + "/" + parent->GetId() + "/" + Str_8::FromNum(id) + ".eho", Mode::WRITE, Disposition::CREATE_PERSISTENT);
|
||||
file.SeekBeginning();
|
||||
file.WriteSerializer_64(data);
|
||||
}
|
||||
@@ -110,7 +114,7 @@ namespace ehs
|
||||
if (IsLoaded())
|
||||
return;
|
||||
|
||||
File file(parent->GetId() + "/" + Str_8::FromNum(id) + ".eho", Mode::READ, Disposition::OPEN);
|
||||
File file(parent->parent->GetDirectory() + "/" + parent->GetId() + "/" + Str_8::FromNum(id) + ".eho", Mode::READ, Disposition::OPEN);
|
||||
Serializer<UInt_64> data = file.ReadSerializer_64(Endianness::LE, file.Size());
|
||||
file.Release();
|
||||
|
||||
|
Reference in New Issue
Block a user