Start Frame class.
This commit is contained in:
64
Frame.cc
Normal file
64
Frame.cc
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// Created by kyle on 10/14/23.
|
||||
//
|
||||
|
||||
#include "Frame.h"
|
||||
|
||||
|
||||
void
|
||||
Frame::Add()
|
||||
{
|
||||
auto buffer = new Buffer;
|
||||
|
||||
this->bmap[buffer->Name()] = buffer;
|
||||
|
||||
if (this->bmap.size() == 1) {
|
||||
this->activeBuffer = buffer->Name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Frame::Add(std::string name)
|
||||
{
|
||||
auto buffer = new Buffer(name);
|
||||
|
||||
// TODO: find the small buffer name that doesn't conflict with
|
||||
// any other buffers. Idea: deconflict private method?
|
||||
|
||||
this->bmap[buffer->Name()] = buffer;
|
||||
|
||||
if (this->bmap.size() == 1) {
|
||||
this->activeBuffer = buffer->Name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Frame::Add(std::filesystem::path path)
|
||||
{
|
||||
auto buffer = new Buffer(path);
|
||||
|
||||
// TODO: find the small buffer name that doesn't conflict with
|
||||
// any other buffers. Idea: deconflict private method?
|
||||
|
||||
this->bmap[buffer->Name()] = buffer;
|
||||
|
||||
if (this->bmap.size() == 1) {
|
||||
this->activeBuffer = buffer->Name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Buffer::FileStatus
|
||||
Frame::Refresh()
|
||||
{
|
||||
return this->bmap[this->activeBuffer]->Refresh();
|
||||
}
|
||||
|
||||
|
||||
Buffer::FileStatus
|
||||
Frame::Flush()
|
||||
{
|
||||
return this->bmap[this->activeBuffer]->Flush();
|
||||
}
|
||||
Reference in New Issue
Block a user