CoRE Simulation Models for Real-time Networks

Changeset c4b02e7 in oppResultManagers


Ignore:
Timestamp:
03/29/16 11:25:08 (3 years ago)
Author:
Till Steinbach <till.steinbach@…>
Branches:
master
Children:
eaa5416
Parents:
462ccd5
Message:

file operations

Location:
src/oppresultmanagers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/oppresultmanagers/SQLite/cSQLiteOutputManager.cc

    r462ccd5 rc4b02e7  
    2929#include "oppresultmanagers/SQLite/cSQLiteOutputManager.h"
    3030
     31#include "oppresultmanagers/utilities/HelperFunctions.h"
     32
    3133Register_PerRunConfigOption(CFGID_SQLITEOUTMGR_FILE, "sqliteoutputmanager-file", CFG_FILENAME,
    3234        "${resultdir}/${configname}-${runnumber}.sqlite3", "Object name of database connection parameters");
     
    7173    if (!connection)
    7274    {
     75        omnetpp::common::mkPath(
     76                omnetpp::common::directoryOf(
     77                        omnetpp::getEnvir()->getConfig()->getAsFilename(CFGID_SQLITEOUTMGR_FILE).c_str()).c_str());
     78
    7379        std::string cfgobj = omnetpp::getEnvir()->getConfig()->getAsFilename(CFGID_SQLITEOUTMGR_FILE);
    7480        int rc = sqlite3_open(cfgobj.c_str(), &connection);
     
    139145    if (rc != SQLITE_OK)
    140146    {
    141         throw omnetpp::cRuntimeError("SQLiteOutputManager:: Could not prepare statement: %s", sqlite3_errmsg(connection));
     147        throw omnetpp::cRuntimeError("SQLiteOutputManager:: Could not prepare statement: %s",
     148                sqlite3_errmsg(connection));
    142149    }
    143150    rc = sqlite3_step(stmt);
     
    160167        if (rc != SQLITE_OK)
    161168        {
    162             throw omnetpp::cRuntimeError("SQLiteOutputManager:: Could not prepare statement: %s", sqlite3_errmsg(connection));
     169            throw omnetpp::cRuntimeError("SQLiteOutputManager:: Could not prepare statement: %s",
     170                    sqlite3_errmsg(connection));
    163171        }
    164172        rc = sqlite3_bind_text(stmt, 1, std::to_string(SCHEMAVERSION).c_str(), -1, SQLITE_STATIC);
     
    170178        if (rc != SQLITE_DONE)
    171179        {
    172             throw omnetpp::cRuntimeError("SQLiteOutputManager:: Could not execute statement (SQL_INSERT_SCHEMAVERSION): %s",
     180            throw omnetpp::cRuntimeError(
     181                    "SQLiteOutputManager:: Could not execute statement (SQL_INSERT_SCHEMAVERSION): %s",
    173182                    sqlite3_errmsg(connection));
    174183        }
  • src/oppresultmanagers/check/cCheckOutputVectorManager.cc

    r462ccd5 rc4b02e7  
    2929#include "oppresultmanagers/check/cCheckOutputVectorManager.h"
    3030
     31#include "oppresultmanagers/utilities/HelperFunctions.h"
     32
    3133#include <regex>
    3234#include <algorithm>
     
    367369    if (fileType == ".csv")
    368370    {
     371        omnetpp::common::removeFile(reportFilename.c_str(), "old eventlog file");
     372        omnetpp::common::mkPath(omnetpp::common::directoryOf(reportFilename.c_str()).c_str());
     373
    369374        std::fstream file;
    370375        file.open(reportFilename, std::fstream::out);
  • src/oppresultmanagers/eventlog/gcta/GCTAEventlogManager.cc

    r462ccd5 rc4b02e7  
    11#include "oppresultmanagers/eventlog/gcta/GCTAEventlogManager.h"
     2
     3#include "oppresultmanagers/utilities/HelperFunctions.h"
    24
    35Register_Class(GCTAEventlogManager);
     
    1820    filename = omnetpp::getEnvir()->getConfig()->getAsFilename(CFGID_EVENTLOG_TLOG_FILE).c_str();
    1921
    20     //removeFile(filename.c_str(), "old eventlog file");
    21     //mkPath(directoryOf(filename.c_str()).c_str());
     22    omnetpp::common::removeFile(filename.c_str(), "old eventlog file");
     23    omnetpp::common::mkPath(omnetpp::common::directoryOf(filename.c_str()).c_str());
    2224    FILE *out = fopen(filename.c_str(), "w");
    2325    if (!out)
  • src/oppresultmanagers/utilities/HelperFunctions.h

    r462ccd5 rc4b02e7  
    3434#include <vector>
    3535
     36namespace omnetpp {
     37namespace common {
     38extern void mkPath(const char *pathname);
     39extern std::string directoryOf(const char *pathname);
     40extern void removeFile(const char *fname, const char *descr);
     41}}
     42
    3643std::vector< std::pair< simtime_t, simtime_t > > parseIntervals(const char* text);
    3744
Note: See TracChangeset for help on using the changeset viewer.