|
easyVim
1.0
a simple vim-like text editor
|
Public Types | |
| enum | EVFileStatus { EVFILE_OK = 0 , EVFILE_NOT_EXIST = 1 , EVFILE_OPEN_FAIL = 2 , EVFILE_READ_FAIL = 3 , EVFILE_WRITE_FAIL = 4 , EVFILE_CLOSE_FAIL = 5 , EVFILE_OUT_OF_BOUND = 6 , EVFILE_DIR_DOSE_NOT_EXIST = 10 , EVFILE_NO_MATCH_PATTERN = 11 , EVFILE_PATTERN_MATCH = 12 , EVFILE_REPLACE_SUCCESS = 13 , EVFILE_REPLACE_FAIL = 14 , EVFILE_COPY_NOTEXIST = 20 } |
Public Member Functions | |
| EVFile (const std::string fileName) | |
| EVFileStatus | loadFile () |
| 读取文件 More... | |
| EVFileStatus | saveFile () |
| 写入文件 More... | |
| EVFileStatus | saveFileAs (const std::string &newFilePath) |
| 文件另存为,还没有实现创建文件夹得功能,如果目录不存在直接返回错误 More... | |
| EVFileStatus | quitFile () |
| 退出文件 More... | |
| EVFileStatus | searchInFile (const std::string content, bool caseSensitive) |
| 在文件中查找匹配的内容,大小写不敏感 More... | |
| EVFileStatus | searchReplace (const std::string searchContent, const std::string replaceContent, bool caseSensitive) |
| 在文件中查找匹配的内容并替换,大小写敏感 More... | |
| EVFileStatus | searchInFileRegex (const std::string regexPattern) |
| 在文件中查找匹配正则表达式的内容 More... | |
| EVFileStatus | searchReplaceRegex (const std::string regexPattern, const std::string replacePattern) |
| 在文件中查找匹配正则表达式的内容并替换 More... | |
| EVFileStatus | insertChar (int row, int col, char x) |
| EVFileStatus | coverChar (int row, int col, char x) |
| EVFileStatus | deleteChar (int row, int col, bool isFront) |
| EVFileStatus | deleteLine (int rowB, int colB=0, int rowE=0, int colE=-1) |
| EVFileStatus | copyLine (int rowB, int colB=0, int rowE=0, int colE=-1) |
| EVFileStatus | pasteLine (int row) |
Public Attributes | |
| std::string | fileName |
| 文件名 | |
| std::vector< std::string > | fileContent |
| 文件内容 | |
| std::vector< std::string > | copiedFile |
| 复制的文件内容 | |
| bool | hasCopy |
| 复制内容是否有效 | |
| bool | hasChange |
| 文件是否有改动 | |
| int | jumpTo |
| 跳转行号 | |
| size_t | start |
| 文件起始行号(由于文件可能很大,不能一次性把所有文件内容都load进来) | |
| size_t | offset |
| 文件偏移量(由于文件可能很大,不能一次性把所有文件内容都load进来) | |
| std::vector< std::pair< size_t, size_t > > | searchPosition |
| 查找结果在文件中的位置 | |
| EVFile::EVFileStatus ev::EVFile::loadFile | ( | ) |
读取文件
| EVFile::EVFileStatus ev::EVFile::quitFile | ( | ) |
退出文件
| EVFile::EVFileStatus ev::EVFile::saveFile | ( | ) |
写入文件
| EVFile::EVFileStatus ev::EVFile::saveFileAs | ( | const std::string & | newFilePath | ) |
文件另存为,还没有实现创建文件夹得功能,如果目录不存在直接返回错误
| 新文件名称 |
| EVFile::EVFileStatus ev::EVFile::searchInFile | ( | const std::string | content, |
| bool | caseSensitive | ||
| ) |
在文件中查找匹配的内容,大小写不敏感
| caseSensitive | 指定是否大小写敏感 |
| EVFile::EVFileStatus ev::EVFile::searchInFileRegex | ( | const std::string | regexPattern | ) |
在文件中查找匹配正则表达式的内容
| EVFile::EVFileStatus ev::EVFile::searchReplace | ( | const std::string | searchContent, |
| const std::string | replaceContent, | ||
| bool | caseSensitive | ||
| ) |
在文件中查找匹配的内容并替换,大小写敏感
| EVFile::EVFileStatus ev::EVFile::searchReplaceRegex | ( | const std::string | regexPattern, |
| const std::string | replacePattern | ||
| ) |
在文件中查找匹配正则表达式的内容并替换