Commit b8a06960 authored by jan.koester's avatar jan.koester
Browse files

use new aoi

parent 04984039
Loading
Loading
Loading
Loading
+12 −13
Changes for src/blogi.cpp: 12 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -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;
    }

+1 −1
Changes for src/conf.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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));
+1 −1
Changes for src/conf.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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;
+1 −1
Changes for src/plugin.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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);
    }
}