diff --git a/Nuake/FDGSerializer.h b/Nuake/FDGSerializer.h index 98bb1932..07cc992c 100644 --- a/Nuake/FDGSerializer.h +++ b/Nuake/FDGSerializer.h @@ -2,6 +2,7 @@ #include class FGDSerializer { +public: static bool BeginFGDFile(const std::string path); static bool RegisterEntity(); diff --git a/Nuake/FGDSerializer.cpp b/Nuake/FGDSerializer.cpp new file mode 100644 index 00000000..27bb7a62 --- /dev/null +++ b/Nuake/FGDSerializer.cpp @@ -0,0 +1,8 @@ +#include "FDGSerializer.h" +#include + + +bool FGDSerializer::BeginFGDFile(const std::string path) +{ + FileSystem::BeginWriteFile(path + ".fgd"); +} \ No newline at end of file diff --git a/Nuake/src/Core/FileSystem.cpp b/Nuake/src/Core/FileSystem.cpp index 76de6e25..4b0caa57 100644 --- a/Nuake/src/Core/FileSystem.cpp +++ b/Nuake/src/Core/FileSystem.cpp @@ -12,6 +12,7 @@ namespace fs = std::filesystem; + std::string FileDialog::OpenFile(const char* filter) { @@ -132,6 +133,24 @@ std::string FileSystem::ReadFile(const std::string& path, bool absolute) return allFile; } +std::ofstream FileSystem::fileWriter; +bool FileSystem::BeginWriteFile(const std::string path) +{ + fileWriter = std::ofstream(); + fileWriter.open("example.txt"); + + return false; +} + +bool FileSystem::WriteLine(const std::string line) +{ + fileWriter << line.c_str(); +} + +void FileSystem::EndWriteFile() +{ + fileWriter.close(); +} Ref FileSystem::GetFileTree() { diff --git a/Nuake/src/Core/FileSystem.h b/Nuake/src/Core/FileSystem.h index 82990f65..513764c1 100644 --- a/Nuake/src/Core/FileSystem.h +++ b/Nuake/src/Core/FileSystem.h @@ -2,7 +2,8 @@ #include #include #include "Core.h" - +#include +#include class FileDialog { public: @@ -49,6 +50,8 @@ public: static std::string ReadFile(const std::string& path, bool absolute = false); - - + static std::ofstream fileWriter; + static bool BeginWriteFile(const std::string path); + static bool WriteLine(const std::string line); + static void EndWriteFile(); }; \ No newline at end of file