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


C++ CompoundValue::addArg方法代码示例

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


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

示例1: write

/// For every includer file that is run across during parsing, this means that
/// the includer file was fully parsed, and that no old included information
/// needs to be kept, except to check if the old included information has not
/// changed.
///
///  This code assumes that no tricks are played with ifdef values, and
/// ifdef values must be the same every time a the same file is included.
void IncDirDependencyMap::write()
    {
    bool anyChanges = false;
    time_t curTime;
    time_t changedTime = 0;
    time(&curTime);

#if(SHARED_FILE)
    SharedFile file;
    if(!writeFileExclusiveReadUpdate(file))
        {
        fprintf(stderr, "\nOovCppParser - Write file sharing error %s\n", getFilename().c_str());
        }
#endif
    // Append new values from parsed includes into the original NameValueFile.
    // Update existing values times and make new dependencies.
    for(const auto &newMapItem : mParsedIncludeDependencies)
        {
        bool changed = includedPathsChanged(newMapItem.first, newMapItem.second);
        if(changed)
            {
            // Cheat and say updated time and checked time are the same.
            changedTime = curTime;

            CompoundValue newIncludedInfoCompVal;
            OovString changeStr;
            changeStr.appendInt(changedTime);
            newIncludedInfoCompVal.addArg(changeStr);

            OovString checkedStr;
            checkedStr.appendInt(curTime);
            newIncludedInfoCompVal.addArg(checkedStr);

            for(const auto &str : newMapItem.second)
                {
                size_t pos = newIncludedInfoCompVal.find(str);
                if(pos == CompoundValue::npos)
                    {
                    newIncludedInfoCompVal.addArg(str);
                    }
                }
            setNameValue(newMapItem.first, newIncludedInfoCompVal.getAsString());
            anyChanges = true;
            }
        }
    if(file.isOpen() && anyChanges)
        {
#if(SHARED_FILE)
        if(!writeFileExclusive(file))
            {
            OovString str = "Unable to write include map file";
            OovError::report(ET_Error, str);
            }
#else
        writeFile();
#endif
        }
    }
开发者ID:8l,项目名称:oovcde,代码行数:65,代码来源:IncDirMap.cpp

示例2: addConfig

void OptionsDialog::addConfig()
    {
    GtkEntry *newNameEntry = GTK_ENTRY(Builder::getBuilder()->getWidget("NewConfigNameEntry"));

    // Update the build config option
    std::string compStr = mProjectOptions.getValue(OptBuildConfigs);
    CompoundValue compVal;
    compVal.parseString(compStr);
    OovString newName = Gui::getText(newNameEntry);

    OovStringVec cfgs = compVal;
    cfgs.push_back(BuildConfigAnalysis);
    cfgs.push_back(BuildConfigDebug);
    cfgs.push_back(BuildConfigRelease);
    bool found = std::find(cfgs.begin(), cfgs.end(), newName) != cfgs.end();
    if(!found)
        {
        compVal.addArg(newName);
        mProjectOptions.setNameValue(OptBuildConfigs, compVal.getAsString());

        // Leave what is on the screen, and change the config name.Save the
        // screen data to the new config.
        mCurrentBuildConfig = newName;
    //    ScreenOptions options(mCurrentBuildConfig);
     //   options.screenToOptions();

        updateBuildConfig();
        }
    else
        Gui::messageBox("Configuration already exists", GTK_MESSAGE_INFO);
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:31,代码来源:OptionsDialog.cpp

示例3: saveDiagram

OovStatusReturn ClassDiagram::saveDiagram(File &file)
    {
    OovStatus status(true, SC_File);
    NameValueFile nameValFile;

    CompoundValue names;
    CompoundValue xPositions;
    CompoundValue yPositions;
    OovString drawingName;
    for(auto const &node : mClassGraph.getNodes())
        {
        if(node.getType())
            {
            if(drawingName.length() == 0)
                {
                drawingName = node.getType()->getName();
                }
            names.addArg(node.getType()->getName());
            }
        else
            {
            names.addArg("Oov-Key");
            }
        OovString num;
        num.appendInt(node.getPosition().x);
        xPositions.addArg(num);

        num.clear();
        num.appendInt(node.getPosition().y);
        yPositions.addArg(num);
        }

    if(drawingName.length() > 0)
        {
        DiagramStorage::setDrawingHeader(nameValFile, DST_Class, drawingName);
        nameValFile.setNameValue("Names", names.getAsString());
        nameValFile.setNameValue("XPositions", xPositions.getAsString());
        nameValFile.setNameValue("YPositions", yPositions.getAsString());
        status = nameValFile.writeFile(file);
        }
    return status;
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:42,代码来源:ClassDiagram.cpp

示例4: setComponentFiles

void ComponentTypesFile::setComponentFiles(CompFileTypes cft,
    OovStringRef const compName, OovStringSet const &srcs)
    {
    CompoundValue objArgs;
    for(const auto &src : srcs)
        {
        objArgs.addArg(src);
        }
    OovString tag = getCompTagName(compName, getCompFileTypeTagName(cft));
    mCompSourceListFile.setNameValue(tag, objArgs.getAsString());
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:11,代码来源:Components.cpp

示例5: addCLangArgs

static void addCLangArgs(CompoundValue &cv)
{
    cv.addArg("-x");
    cv.addArg("c++");
    cv.addArg("-std=c++11");
}
开发者ID:Purplenigma,项目名称:oovaide,代码行数:6,代码来源:Options.cpp

示例6: setDefaultOptions

void OptionsDefaults::setDefaultOptions()
{
    CompoundValue baseArgs;
    CompoundValue extraCppDocArgs;
    CompoundValue extraCppRlsArgs;
    CompoundValue extraCppDbgArgs;

    baseArgs.addArg("-c");
    bool useCLangBuild = false;
#ifdef __linux__
//    baseArgs.addArg("-ER/usr/include/gtk-3.0");
//    baseArgs.addArg("-ER/usr/lib/x86_64-linux-gnu/glib-2.0/include");
    OovStatus status(true, SC_File);
    if(FileIsFileOnDisk("/usr/bin/clang++", status))
        useCLangBuild = true;
    if(status.needReport())
    {
        status.reported();
    }
#else
    std::string path = getenv("PATH");
    if(path.find("LLVM") != std::string::npos)
    {
        useCLangBuild = true;
    }
    /*
        // On Windows, GTK includes gmodule, glib, etc., so no reason to get mingw.
        bool success = addExternalReference(path, "gtk", baseArgs);
        if(!success)
            {
            addExternalReference(path, "mingw", baseArgs);
            }
        addExternalReference(path, "qt", baseArgs);
    */
#endif
    // The GNU compiler cannot have these, but the clang compiler requires them.
    // CLang 3.2 does not work on Windows well, so GNU is used on Windows for
    // building, but CLang is used for XMI parsing.
    // These are important for xmi parsing to show template relations
    if(useCLangBuild)
    {
        addCLangArgs(baseArgs);
    }
    else
    {
        addCLangArgs(extraCppDocArgs);
        extraCppDbgArgs.addArg("-std=c++0x");
        extraCppRlsArgs.addArg("-std=c++0x");
    }
    extraCppDbgArgs.addArg("-O0");
    extraCppDbgArgs.addArg("-g3");

    extraCppRlsArgs.addArg("-O3");

#ifdef __linux__
    mProject.setNameValue(OptToolDebuggerPath, "/usr/bin/gdb");
#else
    // This works without setting the full path.
    // The path could be /MinGW/bin, or could be /Program Files/mingw-builds/...
    mProject.setNameValue(OptToolDebuggerPath, "gdb.exe");
#endif

    setBuildConfigurationPaths(mProject, BuildConfigAnalysis,
                               extraCppDocArgs.getAsString(), useCLangBuild);
    setBuildConfigurationPaths(mProject, BuildConfigDebug,
                               extraCppDbgArgs.getAsString(), useCLangBuild);
    setBuildConfigurationPaths(mProject, BuildConfigRelease,
                               extraCppRlsArgs.getAsString(), useCLangBuild);

    mProject.setNameValue(OptBaseArgs, baseArgs.getAsString());
}
开发者ID:Purplenigma,项目名称:oovaide,代码行数:71,代码来源:Options.cpp


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