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


C++ StringPairArray::size方法代码示例

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


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

示例1: mergePreprocessorDefs

StringPairArray mergePreprocessorDefs (StringPairArray inheritedDefs, const StringPairArray& overridingDefs)
{
    for (int i = 0; i < overridingDefs.size(); ++i)
        inheritedDefs.set (overridingDefs.getAllKeys()[i], overridingDefs.getAllValues()[i]);

    return inheritedDefs;
}
开发者ID:achellies,项目名称:JUCE,代码行数:7,代码来源:jucer_MiscUtilities.cpp

示例2: replacePreprocessorDefs

String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString)
{
    for (int i = 0; i < definitions.size(); ++i)
    {
        const String key (definitions.getAllKeys()[i]);
        const String value (definitions.getAllValues()[i]);

        sourceString = sourceString.replace ("${" + key + "}", value);
    }

    return sourceString;
}
开发者ID:achellies,项目名称:JUCE,代码行数:12,代码来源:jucer_MiscUtilities.cpp

示例3: toArray

const var EnviJSONRPC::toArray (const StringPairArray &stringPairArray)
{
	var ret = empty(false);
	DynamicObject *dso = ret.getDynamicObject();

	for (int i=0; i<stringPairArray.size(); i++)
	{
		dso->setProperty (stringPairArray.getAllKeys() [i], stringPairArray.getAllValues() [i]);
	}

	return (ret);
}
开发者ID:RomanKubiak,项目名称:envi,代码行数:12,代码来源:EnviJSONRPC.cpp

示例4: createGCCPreprocessorFlags

String createGCCPreprocessorFlags (const StringPairArray& defs)
{
    String s;

    for (int i = 0; i < defs.size(); ++i)
    {
        String def (defs.getAllKeys()[i]);
        const String value (defs.getAllValues()[i]);
        if (value.isNotEmpty())
            def << "=" << value;

        s += " -D" + def;
    }

    return s;
}
开发者ID:bacchus,项目名称:JUCE,代码行数:16,代码来源:jucer_MiscUtilities.cpp

示例5: perConfigurationDefs

StringPairArray ProjectExporter::BuildConfiguration::getUniquePreprocessorDefs() const
{
    StringPairArray perConfigurationDefs (parsePreprocessorDefs (getBuildConfigPreprocessorDefsString()));
    const StringPairArray globalDefs (project.getPreprocessorDefs());

    for (int i = 0; i < globalDefs.size(); ++i)
    {
        String globalKey   = globalDefs.getAllKeys()[i];

        int idx = perConfigurationDefs.getAllKeys().indexOf (globalKey);
        if (idx >= 0)
        {
            String globalValue = globalDefs.getAllValues()[i];

            if (globalValue == perConfigurationDefs.getAllValues()[idx])
                perConfigurationDefs.remove (idx);
        }
    }

    return perConfigurationDefs;
}
开发者ID:Neknail,项目名称:JUCE,代码行数:21,代码来源:jucer_ProjectExporter.cpp

示例6: addArray

void StringPairArray::addArray (const StringPairArray& other)
{
    for (int i = 0; i < other.size(); ++i)
        set (other.keys[i], other.values[i]);
}
开发者ID:410pfeliciano,项目名称:plugin-GUI,代码行数:5,代码来源:juce_StringPairArray.cpp

示例7: SaveGame

size_t GameDatabase::SaveGame(const Game &game, 
							  const StringPairArray &rulesets, 
							  const StringPairArray& options,
							  const ISerialize& stats, 
							  const bool reload)
{
	wxString file = FilePath::Data(DataFileGames);
	wxString keyfile = FilePath::Data(DataFileGameKeys);

	// Save the game.
	wxFile gamedb;
	gamedb.Open(file, wxFile::write_append);
	wxFileOutputStream x(gamedb);
	wxDataOutputStream games(x);

	// Move to the end.
	gamedb.SeekEnd();

	// Get the starting position
	wxUint32 pos = gamedb.Tell();

	// Write out the rulesets loaded.
	games << (wxUint32) rulesets.size();
	GameDatabase::StringPairArray::const_iterator it, itEnd = rulesets.end();
	for(it = rulesets.begin(); it != itEnd; ++it)
	{
		games << it->first;
		games << it->second;
	}

	// options data
	games << (wxUint32) options.size();

	itEnd = options.end();
	for(it = options.begin(); it != itEnd; ++it)
	{
		games << it->first;
		games << it->second;
	}

	// Write out the game.
	game.save(games);

	// Stats must always go at the end so we can ignore them while loading if
	// desired.
	stats.save(games);
		
	// Close the file.
	gamedb.Close();

	// Now update the key file.
	wxFile keydb;
	keydb.Open(keyfile, wxFile::write_append);
	wxFileOutputStream y(keydb);
	wxDataOutputStream keys(y);

	// Move to the end
	keydb.SeekEnd();

	// Write the offset
	keys << pos;

	wxUint32 keyLength;
	keyLength = keydb.Length();

	// Flush it.
	keydb.Close();

	if(true == reload)
	{
		InitializeDatabase();
	}

	// Calculate the number of games.
	size_t index = (keyLength / sizeof(size_t)) - 1;
	return index;
}
开发者ID:Dangr8,项目名称:Cities3D,代码行数:77,代码来源:GameDatabase.cpp

示例8: writePluginCharacteristicsFile

//==============================================================================
void ProjectSaver::writePluginCharacteristicsFile()
{
    StringPairArray flags;
    flags.set ("JucePlugin_Build_VST",                   boolToString (project.shouldBuildVST()));
    flags.set ("JucePlugin_Build_VST3",                  boolToString (project.shouldBuildVST3()));
    flags.set ("JucePlugin_Build_AU",                    boolToString (project.shouldBuildAU()));
    flags.set ("JucePlugin_Build_AUv3",                  boolToString (project.shouldBuildAUv3()));
    flags.set ("JucePlugin_Build_RTAS",                  boolToString (project.shouldBuildRTAS()));
    flags.set ("JucePlugin_Build_AAX",                   boolToString (project.shouldBuildAAX()));
    flags.set ("JucePlugin_Build_Standalone",            boolToString (project.shouldBuildStandalonePlugin()));
    flags.set ("JucePlugin_Build_Unity",                 boolToString (project.shouldBuildUnityPlugin()));
    flags.set ("JucePlugin_Enable_IAA",                  boolToString (project.shouldEnableIAA()));
    flags.set ("JucePlugin_Name",                        toStringLiteral (project.getPluginNameString()));
    flags.set ("JucePlugin_Desc",                        toStringLiteral (project.getPluginDescriptionString()));
    flags.set ("JucePlugin_Manufacturer",                toStringLiteral (project.getPluginManufacturerString()));
    flags.set ("JucePlugin_ManufacturerWebsite",         toStringLiteral (project.getCompanyWebsiteString()));
    flags.set ("JucePlugin_ManufacturerEmail",           toStringLiteral (project.getCompanyEmailString()));
    flags.set ("JucePlugin_ManufacturerCode",            toCharLiteral (project.getPluginManufacturerCodeString()));
    flags.set ("JucePlugin_PluginCode",                  toCharLiteral (project.getPluginCodeString()));
    flags.set ("JucePlugin_IsSynth",                     boolToString (project.isPluginSynth()));
    flags.set ("JucePlugin_WantsMidiInput",              boolToString (project.pluginWantsMidiInput()));
    flags.set ("JucePlugin_ProducesMidiOutput",          boolToString (project.pluginProducesMidiOutput()));
    flags.set ("JucePlugin_IsMidiEffect",                boolToString (project.isPluginMidiEffect()));
    flags.set ("JucePlugin_EditorRequiresKeyboardFocus", boolToString (project.pluginEditorNeedsKeyFocus()));
    flags.set ("JucePlugin_Version",                     project.getVersionString());
    flags.set ("JucePlugin_VersionCode",                 project.getVersionAsHex());
    flags.set ("JucePlugin_VersionString",               toStringLiteral (project.getVersionString()));
    flags.set ("JucePlugin_VSTUniqueID",                 "JucePlugin_PluginCode");
    flags.set ("JucePlugin_VSTCategory",                 project.getVSTCategoryString());
    flags.set ("JucePlugin_Vst3Category",                toStringLiteral (project.getVST3CategoryString()));
    flags.set ("JucePlugin_AUMainType",                  project.getAUMainTypeString());
    flags.set ("JucePlugin_AUSubType",                   "JucePlugin_PluginCode");
    flags.set ("JucePlugin_AUExportPrefix",              project.getPluginAUExportPrefixString());
    flags.set ("JucePlugin_AUExportPrefixQuoted",        toStringLiteral (project.getPluginAUExportPrefixString()));
    flags.set ("JucePlugin_AUManufacturerCode",          "JucePlugin_ManufacturerCode");
    flags.set ("JucePlugin_CFBundleIdentifier",          project.getBundleIdentifierString());
    flags.set ("JucePlugin_RTASCategory",                String (project.getRTASCategory()));
    flags.set ("JucePlugin_RTASManufacturerCode",        "JucePlugin_ManufacturerCode");
    flags.set ("JucePlugin_RTASProductId",               "JucePlugin_PluginCode");
    flags.set ("JucePlugin_RTASDisableBypass",           boolToString (project.isPluginRTASBypassDisabled()));
    flags.set ("JucePlugin_RTASDisableMultiMono",        boolToString (project.isPluginRTASMultiMonoDisabled()));
    flags.set ("JucePlugin_AAXIdentifier",               project.getAAXIdentifierString());
    flags.set ("JucePlugin_AAXManufacturerCode",         "JucePlugin_ManufacturerCode");
    flags.set ("JucePlugin_AAXProductId",                "JucePlugin_PluginCode");
    flags.set ("JucePlugin_AAXCategory",                 String (project.getAAXCategory()));
    flags.set ("JucePlugin_AAXDisableBypass",            boolToString (project.isPluginAAXBypassDisabled()));
    flags.set ("JucePlugin_AAXDisableMultiMono",         boolToString (project.isPluginAAXMultiMonoDisabled()));
    flags.set ("JucePlugin_IAAType",                     toCharLiteral (project.getIAATypeCode()));
    flags.set ("JucePlugin_IAASubType",                  "JucePlugin_PluginCode");
    flags.set ("JucePlugin_IAAName",                     project.getIAAPluginName().quoted());
    flags.set ("JucePlugin_VSTNumMidiInputs",            project.getVSTNumMIDIInputsString());
    flags.set ("JucePlugin_VSTNumMidiOutputs",           project.getVSTNumMIDIOutputsString());

    {
        String plugInChannelConfig = project.getPluginChannelConfigsString();

        if (plugInChannelConfig.isNotEmpty())
        {
            flags.set ("JucePlugin_MaxNumInputChannels",            String (countMaxPluginChannels (plugInChannelConfig, true)));
            flags.set ("JucePlugin_MaxNumOutputChannels",           String (countMaxPluginChannels (plugInChannelConfig, false)));
            flags.set ("JucePlugin_PreferredChannelConfigurations", plugInChannelConfig);
        }
    }

    MemoryOutputStream mem;
    mem.setNewLineString (projectLineFeed);

    mem << "//==============================================================================" << newLine
        << "// Audio plugin settings.." << newLine
        << newLine;

    for (int i = 0; i < flags.size(); ++i)
    {
        mem << "#ifndef  " << flags.getAllKeys()[i] << newLine
            << " #define " << flags.getAllKeys()[i].paddedRight (' ', 32) << "  "
                           << flags.getAllValues()[i] << newLine
            << "#endif" << newLine;
    }

    setExtraAppConfigFileContent (mem.toString());
}
开发者ID:julianstorer,项目名称:JUCE,代码行数:82,代码来源:jucer_ProjectSaver.cpp

示例9: if

PopupMenu SAMApplication::MainMenuModel::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
{
	PopupMenu menu;
    if (topLevelMenuIndex == 0)
    {
        menu.addCommandItem (commandManager, CommandIDs::newFile);
        menu.addCommandItem (commandManager, CommandIDs::open);

        PopupMenu recentFiles;
        StoredSettings::getInstance()->recentFiles
            .createPopupMenuItems(recentFiles, recentProjectsBaseID, true, true);

        menu.addSubMenu(TRANS("Open Recent File"), recentFiles);

        menu.addSeparator();
        menu.addCommandItem (commandManager, CommandIDs::closeDocument);
        menu.addCommandItem (commandManager, CommandIDs::saveDocument);
        menu.addCommandItem (commandManager, CommandIDs::saveDocumentAs);
        menu.addSeparator();
        menu.addCommandItem (commandManager, CommandIDs::showMDLProperties);
        menu.addSeparator();
        menu.addCommandItem (commandManager, CommandIDs::saveDocumentAsImage);
        menu.addSeparator();
        menu.addCommandItem(commandManager, CommandIDs::showPrefs);

#if ! JUCE_MAC
        menu.addSeparator();
        menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit);
#endif

    }
    else if (topLevelMenuIndex == 1)
    {
        menu.addCommandItem (commandManager, CommandIDs::undo);
        menu.addCommandItem (commandManager, CommandIDs::redo);
        menu.addSeparator();
        menu.addCommandItem (commandManager, StandardApplicationCommandIDs::cut);
        menu.addCommandItem (commandManager, StandardApplicationCommandIDs::copy);
        menu.addCommandItem (commandManager, StandardApplicationCommandIDs::paste);
        menu.addSeparator();
        menu.addCommandItem (commandManager, StandardApplicationCommandIDs::selectAll);
        menu.addCommandItem (commandManager, StandardApplicationCommandIDs::deselectAll);
        menu.addSeparator();
        menu.addCommandItem (commandManager, CommandIDs::defineFaustcode);
        menu.addSeparator();
        menu.addCommandItem(commandManager, CommandIDs::reverseDirection);
        menu.addSeparator();
        menu.addCommandItem(commandManager, CommandIDs::tidyObjects);
        menu.addSeparator();

        PopupMenu redrawModelMenu;
        redrawModelMenu.addCommandItem(commandManager, CommandIDs::toggleRedrawIncludeMisc);
        redrawModelMenu.addSeparator();
        redrawModelMenu.addCommandItem(commandManager, CommandIDs::redrawCircle);
        redrawModelMenu.addSeparator();
        redrawModelMenu.addCommandItem(commandManager, CommandIDs::redrawForceDirected);
        redrawModelMenu.addCommandItem(commandManager, CommandIDs::showRedrawOptions);
        menu.addSubMenu(TRANS("Redraw Model"), redrawModelMenu);
    }
    else if (topLevelMenuIndex == 2)
    {
    	menu.addCommandItem(commandManager, CommandIDs::insertMass);
    	menu.addCommandItem(commandManager, CommandIDs::insertGround);
    	menu.addCommandItem(commandManager, CommandIDs::insertResonator);
    	menu.addCommandItem(commandManager, CommandIDs::insertPort);
    	menu.addSeparator();
    	menu.addCommandItem(commandManager, CommandIDs::insertLink);
    	menu.addCommandItem(commandManager, CommandIDs::insertTouch);
    	menu.addCommandItem(commandManager, CommandIDs::insertPluck);
    	menu.addCommandItem(commandManager, CommandIDs::insertPulsetouch);
    	menu.addCommandItem(commandManager, CommandIDs::insertDetent);
    	menu.addCommandItem(commandManager, CommandIDs::insertSofteningLink);
    	menu.addCommandItem(commandManager, CommandIDs::insertStiffeningLink);
    	menu.addSeparator();
    	menu.addCommandItem(commandManager, CommandIDs::insertAudioOutput);
        menu.addCommandItem(commandManager, CommandIDs::insertAudioConnection);
        menu.addCommandItem(commandManager, CommandIDs::insertDisplay);
        menu.addCommandItem(commandManager, CommandIDs::insertDisplayConnection);
    	menu.addSeparator();
    	menu.addCommandItem(commandManager, CommandIDs::insertWaveguide);
    	menu.addCommandItem(commandManager, CommandIDs::insertTermination);
        menu.addCommandItem(commandManager, CommandIDs::insertJunction);
        menu.addSeparator();
        menu.addCommandItem(commandManager, CommandIDs::insertComment);
    }
    else if (topLevelMenuIndex == 3)
    {
    	menu.addCommandItem(commandManager, CommandIDs::generateFaust);
        menu.addSeparator();
    	menu.addCommandItem(commandManager, CommandIDs::generateExternal);
        menu.addSeparator();
        StringPairArray spa = StoredSettings::getInstance()->getExporters().getAllProperties();
        String currExporter = StoredSettings::getInstance()->getCurrentExporter();
        for (int i = 0; i < spa.size(); ++i)
        {
            bool isTicked = false;
            if(spa.getAllKeys()[i].compare(currExporter) == 0)
                isTicked = true;
            menu.addItem(exportersBaseID + i, spa.getAllKeys()[i],true,isTicked);
        }
//.........这里部分代码省略.........
开发者ID:ptrv,项目名称:SaM-Designer,代码行数:101,代码来源:Application.cpp


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