Putting Buffers in main to test things out.

This commit is contained in:
2023-10-12 00:22:30 -07:00
parent 2dcc577f57
commit ba27e132e3
5 changed files with 118 additions and 15 deletions

View File

@@ -59,6 +59,8 @@ public:
FileStatusNonExistent = 5,
};
static std::string FileStatusToString(FileStatus status);
static bool StatusOK(FileStatus status)
{ return status == FileStatus::FileStatusOK; }
@@ -74,11 +76,16 @@ public:
/// Instantiate a Buffer pointing to fPath.
Buffer(std::string fName, std::string fPath);
void Close();
/// Instantiate a buffer from a filesystem path.
Buffer(std::filesystem::path fPath);
std::string Name() const
{ return this->name; }
bool IsVirtual()
{ return this->file.has_value(); }
{ return !this->file.has_value(); }
Buffer::FileStatus Flush(OptString altPath);
@@ -100,6 +107,8 @@ public:
bool IsDirty()
{ return this->dirty; }
size_t Size();
private:
void clearContents();