|
|
@ -6,6 +6,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <cassert> // assert |
|
|
|
#include <cassert> // assert |
|
|
|
#include <cstdint> // int32_t |
|
|
|
#include <cstdint> // int32_t |
|
|
|
|
|
|
|
#include <filesystem> |
|
|
|
#include <fstream> // ifstream, ios, ofstream |
|
|
|
#include <fstream> // ifstream, ios, ofstream |
|
|
|
#include <memory> // make_unique |
|
|
|
#include <memory> // make_unique |
|
|
|
#include <string> |
|
|
|
#include <string> |
|
|
@ -43,6 +44,17 @@ File::~File() |
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File File::create(const std::string& path) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!std::filesystem::exists(path)) { |
|
|
|
|
|
|
|
std::ofstream { path }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Util::File(path); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
void File::clear() |
|
|
|
void File::clear() |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_data.clear(); |
|
|
|
m_data.clear(); |
|
|
|