import kepp, clean up build dependencies

This commit is contained in:
2023-10-11 14:50:35 -07:00
parent 0d0d63ede4
commit a61916206c
18 changed files with 718 additions and 81 deletions

56
Buffer.h Normal file
View File

@@ -0,0 +1,56 @@
///
/// \file Buffer.h
/// \author kyle
/// \date 2023-10-10
/// \brief A buffer is the basic document type.
///
#ifndef KEPP_FRAME_H
#define KEPP_FRAME_H
#include "Defs.h"
#include "File.h"
typedef std::vector<std::vector<uint8_t>> BufferContents;
/// A Buffer is the atom of text editing. It represents a single document,
/// whether a memory-only buffer or a file-backed buffer.
///
/// \details
///
/// There are currently two main types of Buffers: file-backed and virtual.
/// A virtual buffer describes any buffer that isn't backed by a file.
///
/// A virtual buffer can be promoted to a file frame, but a file buffer
/// cannot be demoted to a virtual buffer.
class Buffer {
public:
/// The constructor with no arguments generates a new anonymous
/// buffer.
Buffer();
/// A single constructor generates a virtual buffer.
Buffer(std::string fName);
/// Instantiate a Buffer pointing to fPath.
Buffer(std::string fName, std::string fPath);
std::string Name() const { return this->name; }
int Flush(OptString altPath);
void ChangePath(std::string newPath);
private:
std::string name;
OptString path;
OptFile file;
BufferContents contents;
};
#endif // KEPP_FRAME_H