Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CSE3150_Project/EditorDataController.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (27 sloc)
795 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef EDITOR_DATA_CONTROLLER_H | |
#define EDITOR_DATA_CONTROLLER_H | |
#include <vector> | |
#include <string> | |
class EditorDataController | |
{ | |
public: | |
EditorDataController(); | |
~EditorDataController(); | |
void DeleteCharacter(int row, int column); | |
void DeleteNewLine(int row); | |
char GetCharAt(int row, int col); | |
std::string GetLine(int row); | |
int GetLineLength(int row); | |
std::string GetLineSegment(int row, int x0, int x1); | |
int GetNumLines() { return buffer.size(); } | |
void InsertCharacter(char c,int row, int column); | |
void InsertNewLine(int row, int column); | |
void ResetBuffer(); | |
// File Management Methods | |
int SaveFile(std::string fname); | |
int LoadFile(std::string fname); | |
private: | |
void ClearBuffer(); | |
std::vector<std::string*> buffer; | |
}; | |
#endif /* EDITOR_DATA_CONTROLLER_H */ |