easyVim  1.0
a simple vim-like text editor
inst.hpp
Go to the documentation of this file.
1 
8 #ifndef EASYVIM_INST_HPP
9 #define EASYVIM_INST_HPP
10 
11 #include <string>
12 #include <unordered_map>
13 #include <cstring>
14 #include <vector>
15 #include <fstream>
16 #include "../core/core.hpp"
17 
18 namespace ev {
24 class EVConfig{
25 public:
26  EVConfig(std::string f = ""){
27  fileName = f;
28  FILE* file = fopen(fileName.c_str(), "r");
29  instList = std::vector<std::string>();
30  if (file != NULL){
31  char buf[128] = {0};
32  while(fgets(buf, 128, file) != NULL){
33  if (buf[0] == '#'){
34  continue;
35  }
36  if (buf[strlen(buf) - 1] == '\n'){
37  buf[strlen(buf) - 1] = '\0';
38  }
39  instList.push_back(buf);
40  }
41  fclose(file);
42  }
43  }
44  ~EVConfig(){}
45 
46  std::string fileName;
47  std::vector<std::string> instList;
48 };
49 
50 }
51 
52 #endif //EASYVIM_INST_HPP
easyVim 指令配置类
Definition: inst.hpp:24
std::string fileName
配置文件名
Definition: inst.hpp:46
std::vector< std::string > instList
指令列表
Definition: inst.hpp:47