This commit is contained in:
nastys
2019-07-30 13:48:28 +02:00
parent 17b6c02aee
commit d1349cfebe
157 changed files with 0 additions and 0 deletions
@@ -0,0 +1,41 @@
#include "TextFile.h"
#include <filesystem>
namespace fs = std::filesystem;
namespace TLAC::FileSystem
{
TextFile::TextFile(const std::string &path)
{
FileName = path;
}
TextFile::TextFile(const std::string &directory, const std::string &file)
{
auto fullPath = directory + "/" + file;
FileName = fullPath;
}
TextFile::~TextFile()
{
}
bool TextFile::OpenRead()
{
fs::path configPath = fs::u8path(FileName);
if (!fs::exists(configPath))
return false;
std::ifstream fileStream(configPath.wstring().c_str());
if (!fileStream.is_open())
return false;
Parse(fileStream);
fileStream.close();
return true;
}
}