ProgramLoader corrections
This commit is contained in:
@@ -9,6 +9,10 @@ ProgramLoader::ProgramLoader(const std::string &path){
|
||||
m_programFile.open(path);
|
||||
}
|
||||
|
||||
ProgramLoader::~ProgramLoader() {
|
||||
m_programFile.close();
|
||||
}
|
||||
|
||||
ProgramLoader * ProgramLoader::getInstance(const std::string &program_path) {
|
||||
static ProgramLoader instance{program_path};
|
||||
return &instance;
|
||||
@@ -20,16 +24,15 @@ ProgramLoader * ProgramLoader::getInstance(const std::string &program_path) {
|
||||
std::istringstream iss(input);
|
||||
std::string out;
|
||||
do {
|
||||
out.clear();
|
||||
/// Trenne den IStringStream bei jedem Leerzeichen und füge die Befehl(e)/-sargumente dem Output hinzu
|
||||
std::getline(iss, out, ' ');
|
||||
if (out.empty()) break;
|
||||
/// Stoppe, sobald ein Kommentar im Source Code vorkommt
|
||||
if (out.at(0) != '#') {
|
||||
if (out.at(out.length() -1) == ',') {
|
||||
out.erase(out.length() - 1);
|
||||
}
|
||||
if (out.at(out.length() -1) == ':') {
|
||||
break;
|
||||
}
|
||||
output.push_back(out);
|
||||
} else {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user