added more App functions
This commit is contained in:
29
src/App.cpp
29
src/App.cpp
@@ -2,7 +2,7 @@
|
||||
|
||||
App* App::instance = nullptr;
|
||||
|
||||
App::App() {
|
||||
App::App(const int& argc, char* argv[]) {
|
||||
|
||||
if(instance != nullptr) {
|
||||
std::cout << "App already exists\nThere can only be one!\n";
|
||||
@@ -13,6 +13,8 @@ App::App() {
|
||||
|
||||
instance = this;
|
||||
|
||||
handleArgs(argc, argv);
|
||||
|
||||
}
|
||||
|
||||
App::~App() {
|
||||
@@ -29,3 +31,28 @@ void App::run() {
|
||||
}
|
||||
}
|
||||
|
||||
void App::load(std::string lib) {
|
||||
|
||||
}
|
||||
|
||||
void App::handleArgs(const int& argc, char* argv[]) {
|
||||
|
||||
int i = 0;
|
||||
|
||||
while(i < argc) {
|
||||
if(strcmp(argv[i], "-h") == 0) {
|
||||
printHelp();
|
||||
end();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
while(i < argc) {
|
||||
|
||||
load(argv[i]);
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user