Beispiel #1
0
    int CStatsUtil::DoExportGameScripts()
    {
        //Validate output + input paths
        Poco::Path inpath(m_inputPath);
        Poco::Path outpath;
        
        if( m_outputPath.empty() )
            outpath = inpath.absolute().makeParent().append(DefExportScriptsDir);
        else
            outpath = Poco::Path(m_outputPath).makeAbsolute();

        Poco::File fTestOut = outpath;
        if( ! fTestOut.exists() )
        {
            cout << "Created output directory \"" << fTestOut.path() <<"\"!\n";
            fTestOut.createDirectory();
        }
        else if( ! fTestOut.isDirectory() )
            throw runtime_error("CStatsUtil::DoExportGameScripts(): Output path is not a directory!");

        //Setup the script handler
        GameScripts scripts( inpath.absolute().toString() );

        //Convert to XML
        scripts.ExportScriptsToXML( outpath.toString() );

        return 0;
    }
Beispiel #2
0
    int CStatsUtil::DoExportAll()
    {
        Poco::Path inpath(m_inputPath);
        Poco::Path outpath;
        
        if( m_outputPath.empty() )
        {
            outpath = inpath.absolute().makeParent().append(DefExportAllDir);
        }
        else
        {
            outpath = Poco::Path(m_outputPath).makeAbsolute();
        }

        GameStats gstats( m_inputPath, m_langconf );
        gstats.Load();

        //Test output path
        Poco::File fTestOut = outpath;
        if( ! fTestOut.exists() )
        {
            cout << "Created output directory \"" << fTestOut.path() <<"\"!\n";
            fTestOut.createDirectory();
        }
        gstats.ExportAll(outpath.toString());
        return 0;
    }
Beispiel #3
0
    persist_fixture(f8String& curPath, bool before_clear = true, bool after_clear = false):
    before(before_clear),
    after(after_clear),
    directory(curPath + "/"+ "store")
    {
        if (before)
        {
            unlink_directory();
            directory.createDirectory();
        }

        filePer = new FilePersister();
        filePer->initialise(curPath + "/" + "store", "utest_log");
    }