MCPcopy Create free account
hub / github.com/JibbSmart/JoyShockMapper / loadConfigFile

Method loadConfigFile

JoyShockMapper/src/CmdRegistry.cpp:57–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56
57bool CmdRegistry::loadConfigFile(in_string fileName) {
58 // https://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring
59 ifstream file(fileName);
60 if (!file.is_open())
61 {
62 file.open(std::string{ BASE_JSM_CONFIG_FOLDER() } + fileName);
63 }
64 if (file)
65 {
66 printf("Loading commands from file %s\n", fileName.c_str());
67 // https://stackoverflow.com/questions/6892754/creating-a-simple-configuration-file-and-parser-in-c
68 string line;
69 while (getline(file, line)) {
70 processLine(line);
71 }
72 file.close();
73 return true;
74 }
75 return false;
76}
77
78string_view CmdRegistry::strtrim(std::string_view str)
79{

Callers 2

do_RESET_MAPPINGSFunction · 0.80
mainFunction · 0.80

Calls 1

BASE_JSM_CONFIG_FOLDERFunction · 0.50

Tested by

no test coverage detected