Avoid external access to treap

This commit is contained in:
Matúš Púll 2025-04-09 14:24:55 +02:00
parent 112e20f4b1
commit 53a53b7a03

View file

@ -32,6 +32,7 @@ void set(int r, int s, char ch) { file.find(file_offset+r)->text[s] = ch; }
void new_line(int r, string text = "") { file.insert(file_offset+r, text); }
void insert(int r, int s, string t) { file.find(file_offset+r)->text.insert(s, t); }
void insert(int r, int s, char ch) { insert(r, s, string{ch}); }
void append(string t) { file.append(t); }
void remove(int r, int s, int len=1) { file.find(file_offset+r)->text.erase(s,len); }
void remove(int r) { file.remove(file_offset+r); }
@ -53,7 +54,7 @@ bool load(string filename) {
string line;
while (std::getline(infile, line))
file.append(line);
append(line);
return 0;
}
// Save file from buffer