当前位置: 首页>>代码示例>>C++>>正文


C++ OovStatus类代码示例

本文整理汇总了C++中OovStatus的典型用法代码示例。如果您正苦于以下问题:C++ OovStatus类的具体用法?C++ OovStatus怎么用?C++ OovStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OovStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: isOutputOld

bool FileStat::isOutputOld(OovStringRef const outputFn,
        OovStringRef const inputFn, OovStatus &status)
    {
    time_t outTime = 0;
    time_t inTime = 0;
    status = FileGetFileTime(outputFn, outTime);
    bool old = !status.ok();
    if(status.ok())
        {
        status = FileGetFileTime(inputFn, inTime);
        if(status.ok())
            {
            old = inTime > outTime;
            }
        else
            {
            old = true;
            }
        }
    else
        {
        status.clearError();
        }
    return old;
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:25,代码来源:FilePath.cpp

示例2: makeCoverageBuildProject

bool makeCoverageBuildProject()
    {
    std::string origProjFilePath = Project::getProjectFilePath();
    std::string origCompTypesFilePath = Project::getComponentTypesFilePath();
    std::string origPackagesFilePath = Project::getPackagesFilePath();
    std::string covSrcDir = Project::getCoverageSourceDirectory();
    std::string covProjDir = Project::getCoverageProjectDirectory();
    bool success = true;
    OovStatus status = FileEnsurePathExists(covProjDir);
    if(status.ok())
        {
        Project::setProjectDirectory(covProjDir);
        std::string newProjFilePath = Project::getProjectFilePath();
        success = makeCoverageProjectFile(origProjFilePath,
            newProjFilePath, covSrcDir);
        if(success)
            {
            success = makeCoverageComponentTypesFile(origCompTypesFilePath,
                Project::getComponentTypesFilePath());
            }
        if(success)
            {
            success = copyPackageFileIfNeeded(origPackagesFilePath,
                Project::getPackagesFilePath());
            }
        }
    return status.ok() && success;
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:28,代码来源:Coverage.cpp

示例3: read

void CoverageCountsReader::read(OovStringRef const fn)
    {
    File file;
    OovStatus status = file.open(fn, "r");
    mInstrCounts.clear();
    if(status.ok())
        {
        char buf[100];
        int lineCounter = 0;
        while(file.getString(buf, sizeof(buf), status))
            {
            lineCounter++;
            int val;
            if(sscanf(buf, "%d", &val) == 1)
                {
                if(lineCounter == 1)
                    {
                    mNumInstrumentedLines = val;
                    }
                else
                    {
                    mInstrCounts.push_back(val);
                    }
                }
            }
        }
    if(status.needReport())
        {
        status.report(ET_Error, "Unable to read coverage counts");
        }
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:31,代码来源:Coverage.cpp

示例4: makeCoverageComponentTypesFile

static bool makeCoverageComponentTypesFile(OovStringRef const srcFn, OovStringRef const dstFn)
    {
    ComponentTypesFile file;
    OovStatus status = file.readTypesOnly(srcFn);
    if(status.ok())
        {
        // Define a static library that contains the code that stores
        // the coverage counts that is compiled into exectuables.
        static OovStringRef const covLibName = Project::getCovLibName();
        CompoundValue names = file.getComponentNames();
        if(names.find(covLibName) == CompoundValue::npos)
            {
            names.push_back(covLibName);
            file.setComponentNames(names.getAsString());
            file.setComponentType(covLibName,
                    ComponentTypesFile::getShortComponentTypeName(
                            ComponentTypesFile::CT_StaticLib));
            }
        status = file.writeTypesOnly(dstFn);
        }
    if(status.needReport())
        {
        OovString err = "Unable to make component types file ";
        err += srcFn;
        status.report(ET_Error, err);
        }
    return status.ok();
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:28,代码来源:Coverage.cpp

示例5: updateGraph

void ComponentGraph::updateGraph(const ComponentDrawOptions &options)
    {
    ComponentTypesFile compFile;
    OovStatus status = compFile.read();
    if(status.ok())
        {
        mNodes.clear();
        for(auto const &name : compFile.getComponentNames())
            {
            ComponentTypesFile::eCompTypes ct = compFile.getComponentType(name);
            if(ct != ComponentTypesFile::CT_Unknown)
                {
                mNodes.push_back(ComponentNode(name,
                        ComponentNode::CNT_Component, ct));
                }
            }
        BuildPackages buildPkgs(true);
        std::vector<Package> packages = buildPkgs.getPackages();
        for(auto const &pkg : packages)
            {
            mNodes.push_back(ComponentNode(pkg.getPkgName(),
                    ComponentNode::CNT_ExternalPackage));
            }
        updateConnections(compFile, options);
        }
    if(status.needReport())
        {
        status.report(ET_Error, "Unable to update component graph");
        }
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:30,代码来源:ComponentGraph.cpp

示例6: saveFromScreen

void BuildSettingsDialog::saveScreen()
    {
    saveFromScreen(mLastCompName);
    OovStatus status = mComponentFile.writeFile();
    if(status.needReport())
        {
        status.report(ET_Error, "Unable to save build settings");
        }
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:9,代码来源:BuildSettingsDialog.cpp

示例7: setFilename

OovStatusReturn GuiOptions::read()
{
    setFilename(Project::getGuiOptionsFilePath());
    OovStatus status = NameValueFile::readFile();
    if(status.ok())
    {
        setDefaultOptions();
    }
    return status;
}
开发者ID:Purplenigma,项目名称:oovaide,代码行数:10,代码来源:Options.cpp

示例8: writeFile

OovStatusReturn NameValueFile::writeFile()
    {
    File file;
    OovStatus status = file.open(mFilename.getStr(), "w");
    if(status.ok())
        {
        status = writeFile(file);
        }
    return status;
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:10,代码来源:NameValueFile.cpp

示例9: getEditView

OovStatusReturn EditFiles::saveAsTextFileWithDialog()
    {
    FileEditView *editView = getEditView();
    OovStatus status = editView->saveAsTextFileWithDialog();
    if(status.ok())
        {
        setTabText(editView, editView->getFileName());
        }
    return status;
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:10,代码来源:EditFiles.cpp

示例10: projFile

bool EditFiles::checkDebugger()
    {
    bool ok = false;

    NameValueFile projFile(Project::getProjectFilePath());
    OovStatus status = projFile.readFile();
    if(!status.ok())
        {
        OovString str = "Unable to get project file to get debugger: ";
        str += Project::getProjectFilePath();
        status.report(ET_Error, str);
        }
    getDebugger().setDebuggerFilePath(projFile.getValue(OptToolDebuggerPath));
    getDebugger().setDebuggee(mEditOptions.getValue(OptEditDebuggee));
    getDebugger().setDebuggeeArgs(mEditOptions.getValue(OptEditDebuggeeArgs));
    getDebugger().setWorkingDir(mEditOptions.getValue(OptEditDebuggerWorkingDir));
//Gui::messageBox("Debugging is not recommended. It is very unstable.");
    std::string debugger = getDebugger().getDebuggerFilePath();
    std::string debuggee = getDebugger().getDebuggeeFilePath();
    if(debugger.length() > 0)
        {
        if(debuggee.length() > 0)
            {
// The debugger could be on the path.
//          if(fileExists(debugger))
                {
                if(FileIsFileOnDisk(debuggee, status))
                    {
                    ok = true;
                    }
                else
                    {
                    Gui::messageBox("Component to debug in Edit/Preferences does not exist");
                    }
                if(status.needReport())
                    {
                    status.report(ET_Error, "Unable to check debuggee status");
                    }
                }
//          else
//                {
//                Gui::messageBox("Debugger in Oovaide Analysis/Settings does not exist");
//                }
            }
        else
            {
            Gui::messageBox("Component to debug must be set in Edit/Preferences");
            }
        }
    else
        {
        Gui::messageBox("Debugger tool path must be set in Oovaide Analysis/Settings");
        }
    return ok;
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:55,代码来源:EditFiles.cpp

示例11: getFileDefine

void CoverageHeader::write(SharedFile &outDefFile, OovStringRef const /*srcFn*/,
        int numInstrLines)
    {
    std::string fnDef = getFileDefine();
    mInstrDefineMap[fnDef] = numInstrLines;

    int totalCount = 0;
    for(auto const &defItem : mInstrDefineMap)
        {
        totalCount += defItem.second;
        }

    if(outDefFile.isOpen())
        {
        OovString buf;
        static char const *lines[] =
            {
            "// Automatically generated file by OovCovInstr\n",
            "// This file should not normally be edited manually.\n",
            "#define COV_IN(fileIndex, instrIndex) gCoverage[fileIndex+instrIndex]++;\n",
            };
        for(size_t i=0; i<sizeof(lines)/sizeof(lines[0]); i++)
            {
            buf += lines[i];
            }
        buf += "#define COV_TOTAL_INSTRS ";
        buf.appendInt(totalCount);
        buf += "\n";
        buf += "extern unsigned short gCoverage[COV_TOTAL_INSTRS];\n";

        int coverageCount = 0;
        for(auto const &defItem : mInstrDefineMap)
            {
            OovString def = "#define ";
            def += defItem.first;
            def += " ";
            def.appendInt(coverageCount);
            coverageCount += defItem.second;
            def += " // ";
            def.appendInt(defItem.second);
            def += "\n";
            buf += def;
            }
        outDefFile.truncate();
        OovStatus status = outDefFile.seekBegin();
        if(status.ok())
            {
            status = outDefFile.write(&buf[0], static_cast<int>(buf.size()));
            }
        if(status.needReport())
            {
            status.report(ET_Error, "Unable to write coverage source");
            }
        }
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:55,代码来源:CppInstr.cpp

示例12: readFile

OovStatusReturn NameValueFile::readFile()
    {
    File file;
    OovStatus status = file.open(mFilename.getStr(), "r");
    if(status.ok())
        {
        clear();
        status = readFile(file);
        }
    return status;
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:11,代码来源:NameValueFile.cpp

示例13: writeTypesOnly

OovStatusReturn ComponentTypesFile::writeTypesOnly(OovStringRef const fn)
    {
    mCompTypesFile.setFilename(fn);
    OovStatus status = mCompTypesFile.writeFile();
    if(status.needReport())
        {
        OovString str = "Unable to write source list file: ";
        str += mCompTypesFile.getFilename();
        OovError::report(ET_Error, str);
        }
    return status;
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:12,代码来源:Components.cpp

示例14: setFilename

OovStatusReturn ProjectReader::readProject(OovStringRef const oovProjectDir)
    {
    Project::setProjectDirectory(oovProjectDir);
    setFilename(Project::getProjectFilePath());
    OovStatus status = readFile();
    if(status.ok())
        {
        checkProjectVersion();
        Project::setSourceRootDirectory(getValue(OptSourceRootDir));
        }
    return status;
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:12,代码来源:Project.cpp

示例15: fp

FilePath Project::getOutputDir()
    {
    FilePath fp(Project::getProjectDirectory(), FP_Dir);
    fp.appendDir("output");
    OovStatus status = FileEnsurePathExists(fp);
    if(status.needReport())
        {
        OovString err = "Unable to create directory ";
        err += fp;
        status.report(ET_Error, fp);
        }
    return fp;
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:13,代码来源:Project.cpp


注:本文中的OovStatus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。