Allows user to change the syntax of sysget
| 66 | |
| 67 | // Allows user to change the syntax of sysget |
| 68 | std::vector<std::string> sysget::CustomArgs(std::string path) { |
| 69 | std::ifstream file(path); |
| 70 | std::string line; |
| 71 | std::vector<std::string> args; |
| 72 | int number_of_lines = 0; |
| 73 | if(file.is_open()) { |
| 74 | while(getline(file, line)) { |
| 75 | number_of_lines++; |
| 76 | args.push_back(line); |
| 77 | } |
| 78 | |
| 79 | if(number_of_lines != 10) { |
| 80 | std::cerr << sysget::JsonSTR(lang["invalidsysget_args"]) << std::endl; |
| 81 | exit(1); |
| 82 | } |
| 83 | |
| 84 | else { |
| 85 | return args; |
| 86 | } |
| 87 | |
| 88 | } |
| 89 | return args; |
| 90 | } |
| 91 | |
| 92 | // Check if an item exists in a vector |
| 93 | bool sysget::VectorContains(std::string s, std::vector<std::string> v) { |