most rudimentary Buffer class imaginable

This commit is contained in:
josh committed 2016-06-29 20:54:08 -04:00
1 parent 1636ee1728
commit fdcba81a3d
2 files changed
+36

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#include "Buffer.h"
#include "FileLoader.h"
bool Buffer::load_from_file(const char * filename)
{
FileLoader fl;
if (!fl.load(filename))
{
return false;
}
for (size_t i = 0, num_lines = fl.num_lines(); i < num_lines; i++)
{
m_lines.push_back(fl.get_line(i));
}
return true;
}
+17
View File
@@ -0,0 +1,17 @@
#ifndef BUFFER_H
#define BUFFER_H
#include <list>
#include <memory>
#include "Text.h"
class Buffer
{
public:
bool load_from_file(const char * filename);
protected:
std::list<std::shared_ptr<Text>> m_lines;
};
#endif