Util: Add file class

This commit is contained in:
Riyyi
2021-09-25 16:55:37 +02:00
parent ee451671cd
commit 418b453507
2 changed files with 105 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2021 Riyyi
*
* SPDX-License-Identifier: MIT
*/
#ifndef FILE_H
#define FILE_H
#include <string>
namespace Util {
class File {
public:
File(const std::string& path);
virtual ~File();
void clear();
File& append(std::string data);
File& flush();
const char* c_str() const { return m_data.c_str(); }
const std::string& data() const { return m_data; }
const std::string& path() const { return m_path; }
private:
std::string m_path;
std::string m_data;
};
} // namespace Util
#endif // FILE_H