MCPcopy Create free account
hub / github.com/cvengler/sysget / CustomArgs

Method CustomArgs

src/utils.cpp:68–90  ·  view source on GitHub ↗

Allows user to change the syntax of sysget

Source from the content-addressed store, hash-verified

66
67// Allows user to change the syntax of sysget
68std::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
93bool sysget::VectorContains(std::string s, std::vector<std::string> v) {

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected