Clean project structure.
This commit is contained in:
parent
78a4fa99ff
commit
947bf937fd
496 changed files with 206 additions and 137 deletions
|
@ -1,57 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "FileFormats.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
class File
|
||||
{
|
||||
public:
|
||||
enum class AccessMode{
|
||||
Read,
|
||||
Write
|
||||
};
|
||||
|
||||
public:
|
||||
File(std::filesystem::path fullPath);
|
||||
|
||||
~File();
|
||||
|
||||
void close();
|
||||
|
||||
std::string dumpBinary();
|
||||
|
||||
std::string getExtension() const;
|
||||
|
||||
std::ifstream* getInHandle() const;
|
||||
|
||||
std::ofstream* getOutHandle() const;
|
||||
|
||||
FileFormat::Format inferFormat() const;
|
||||
|
||||
std::string readText();
|
||||
|
||||
std::vector<std::string> readLines();
|
||||
|
||||
std::string read();
|
||||
|
||||
bool pathExists() const;
|
||||
|
||||
bool open(AccessMode mode);
|
||||
|
||||
std::optional<unsigned char> readNextByte();
|
||||
|
||||
void writeText(const std::string& text);
|
||||
|
||||
private:
|
||||
std::filesystem::path mFullPath;
|
||||
std::unique_ptr<std::ifstream> mInHandle;
|
||||
std::unique_ptr<std::ofstream> mOutHandle;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue