Loading src/blogi.cpp +12 −13 Changes for src/blogi.cpp: 12 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -718,32 +718,31 @@ void logFiles(const char *path,int fd){ #ifndef Windows int main(int argc, char* argv[]) { cmdplus::CmdController *BlogiCmdCtl; BlogiCmdCtl = &cmdplus::CmdController::getInstance(); cmdplus::CmdController BlogiCmdCtl(cmdplus::CmdController::getInstance()); BlogiCmdCtl->registerCmd("help", 'h', false, (const char*) nullptr, "Helpmenu"); BlogiCmdCtl.registerCmd("help", 'h', false, "", "Helpmenu"); if (BlogiCmdCtl->getCmdbyKey("help") && BlogiCmdCtl->getCmdbyKey("help")->getFound()) { BlogiCmdCtl->printHelp(); if (BlogiCmdCtl.getCmdbyKey("help") && BlogiCmdCtl.getCmdbyKey("help")->getFound()) { BlogiCmdCtl.printHelp(); return 0; } BlogiCmdCtl->registerCmd("config",'c', true,(const char*) nullptr,"Blogi Config File"); BlogiCmdCtl->registerCmd("debug",'d', false,(int)0,"Blogi runs Debugmod"); BlogiCmdCtl->registerCmd("foreground",'F', false,(int)0,"Blogi runs Foreground"); BlogiCmdCtl.registerCmd("config",'c', true,"","Blogi Config File"); BlogiCmdCtl.registerCmd("debug",'d', false,(int)0,"Blogi runs Debugmod"); BlogiCmdCtl.registerCmd("foreground",'F', false,(int)0,"Blogi runs Foreground"); BlogiCmdCtl->parseCmd(argc,argv); BlogiCmdCtl.parseCmd(argc,argv); const char *config = BlogiCmdCtl->getCmdbyKey("config")->getValue(); int debug = BlogiCmdCtl->getCmdbyKey("debug")->getValueInt(); std::string config = BlogiCmdCtl.getCmdbyKey("config")->getValue(); int debug = BlogiCmdCtl.getCmdbyKey("debug")->getValueInt(); bool fground = false; if(strcmp(BlogiCmdCtl->getCmdbyKey("foreground")->getValue(),"true")==0){ if(BlogiCmdCtl.getCmdbyKey("foreground")->getValue()=="true"){ fground=true; } if (!config){ if (config.empty()){ return -1; } Loading src/conf.cpp +1 −1 Changes for src/conf.cpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ #include "conf.h" blogi::Config::Config(const char *path) : confplus::Config(path){ blogi::Config::Config(const std::string &path) : confplus::Config(path.c_str()){ if(getKey("/BLOGI/PLUGINDIR")){ for(size_t i =0; i<getElements(getKey("/BLOGI/PLUGINDIR")); ++i){ _PlgDir.push_back(getValue(getKey("/BLOGI/PLUGINDIR"),i)); Loading src/conf.h +1 −1 Changes for src/conf.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ namespace blogi { class Config : public confplus::Config { public: Config(const char *path); Config(const std::string &path); ~Config(); const char* getsiteurl() const; Loading src/plugin.cpp +1 −1 Changes for src/plugin.cpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ void blogi::Plugin::loadPlugins(const char *path, PluginArgs *args){ blogi::Plugin::~Plugin(){ for(PluginData *curdat=_firstPlugin.get(); curdat; curdat=curdat->next.get()){ delete static_cast<PluginApi*>(curdat->pldata); delete static_cast<PluginApi*>(curdat->ins); } } Loading Loading
src/blogi.cpp +12 −13 Changes for src/blogi.cpp: 12 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -718,32 +718,31 @@ void logFiles(const char *path,int fd){ #ifndef Windows int main(int argc, char* argv[]) { cmdplus::CmdController *BlogiCmdCtl; BlogiCmdCtl = &cmdplus::CmdController::getInstance(); cmdplus::CmdController BlogiCmdCtl(cmdplus::CmdController::getInstance()); BlogiCmdCtl->registerCmd("help", 'h', false, (const char*) nullptr, "Helpmenu"); BlogiCmdCtl.registerCmd("help", 'h', false, "", "Helpmenu"); if (BlogiCmdCtl->getCmdbyKey("help") && BlogiCmdCtl->getCmdbyKey("help")->getFound()) { BlogiCmdCtl->printHelp(); if (BlogiCmdCtl.getCmdbyKey("help") && BlogiCmdCtl.getCmdbyKey("help")->getFound()) { BlogiCmdCtl.printHelp(); return 0; } BlogiCmdCtl->registerCmd("config",'c', true,(const char*) nullptr,"Blogi Config File"); BlogiCmdCtl->registerCmd("debug",'d', false,(int)0,"Blogi runs Debugmod"); BlogiCmdCtl->registerCmd("foreground",'F', false,(int)0,"Blogi runs Foreground"); BlogiCmdCtl.registerCmd("config",'c', true,"","Blogi Config File"); BlogiCmdCtl.registerCmd("debug",'d', false,(int)0,"Blogi runs Debugmod"); BlogiCmdCtl.registerCmd("foreground",'F', false,(int)0,"Blogi runs Foreground"); BlogiCmdCtl->parseCmd(argc,argv); BlogiCmdCtl.parseCmd(argc,argv); const char *config = BlogiCmdCtl->getCmdbyKey("config")->getValue(); int debug = BlogiCmdCtl->getCmdbyKey("debug")->getValueInt(); std::string config = BlogiCmdCtl.getCmdbyKey("config")->getValue(); int debug = BlogiCmdCtl.getCmdbyKey("debug")->getValueInt(); bool fground = false; if(strcmp(BlogiCmdCtl->getCmdbyKey("foreground")->getValue(),"true")==0){ if(BlogiCmdCtl.getCmdbyKey("foreground")->getValue()=="true"){ fground=true; } if (!config){ if (config.empty()){ return -1; } Loading
src/conf.cpp +1 −1 Changes for src/conf.cpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ #include "conf.h" blogi::Config::Config(const char *path) : confplus::Config(path){ blogi::Config::Config(const std::string &path) : confplus::Config(path.c_str()){ if(getKey("/BLOGI/PLUGINDIR")){ for(size_t i =0; i<getElements(getKey("/BLOGI/PLUGINDIR")); ++i){ _PlgDir.push_back(getValue(getKey("/BLOGI/PLUGINDIR"),i)); Loading
src/conf.h +1 −1 Changes for src/conf.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ namespace blogi { class Config : public confplus::Config { public: Config(const char *path); Config(const std::string &path); ~Config(); const char* getsiteurl() const; Loading
src/plugin.cpp +1 −1 Changes for src/plugin.cpp: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ void blogi::Plugin::loadPlugins(const char *path, PluginArgs *args){ blogi::Plugin::~Plugin(){ for(PluginData *curdat=_firstPlugin.get(); curdat; curdat=curdat->next.get()){ delete static_cast<PluginApi*>(curdat->pldata); delete static_cast<PluginApi*>(curdat->ins); } } Loading