|
teditor
1.8.0@@fee5e94
Terminal based editor written in C++
|
#include <line.h>
Public Member Functions | |
| Line () | |
| void | append (char c) |
| void | append (const char *c) |
| void | append (const std::string &str) |
| void | prepend (char c) |
| void | prepend (const char *c) |
| void | prepend (char c, int count) |
| void | insert (char c, int idx) |
| void | insert (const char *c, int idx) |
| void | insert (const std::string &str, int idx) |
| std::string | erase (int idx, int len=1) |
| Line | split (int idx) |
| void | join (const Line &other) |
| int | numLinesNeeded (int wid) const |
| bool | empty () const |
| int | length () const |
| const std::string & | get () const |
| char | at (int idx) const |
| void | clear () |
| int | findFirstNotOf (const std::string &str, int pos) const |
| int | findLastNotOf (const std::string &str, int pos) const |
| int | indentSize () const |
Base class to store a line in the buffer
|
inline |
|
inline |
access idx'th element in the line
|
inline |
clear the line
|
inline |
Check for empty line
| std::string teditor::Line::erase | ( | int | idx, |
| int | len = 1 |
||
| ) |
erases from the given index and returns the erased chars
| int teditor::Line::findFirstNotOf | ( | const std::string & | str, |
| int | pos | ||
| ) | const |
Same as find_first_not_of function of std::string However, if no match, it will return the length of the line itself
| int teditor::Line::findLastNotOf | ( | const std::string & | str, |
| int | pos | ||
| ) | const |
Same as find_last_not_of function of std::string However, if no match, it will return 0
|
inline |
get the string
| int teditor::Line::indentSize | ( | ) | const |
measures the indentation at the beginning of this line
|
inline |
Number of chars in the line
| int teditor::Line::numLinesNeeded | ( | int | wid | ) | const |
number of lines needed on the screen to render this line
1.8.17