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


C++ PropertiesFile::getFile方法代码示例

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


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

示例1: filename

PropertiesFile& StoredSettings::getProjectProperties (const String& projectUID)
{
    const String filename ("Introjucer_Project_" + projectUID);

    for (int i = propertyFiles.size(); --i >= 0;)
    {
        PropertiesFile* const props = propertyFiles.getUnchecked(i);
        if (props->getFile().getFileNameWithoutExtension() == filename)
            return *props;
    }

    PropertiesFile* p = createPropsFile (filename);
	if (!p->getFile().existsAsFile())
	{
		p->getFile().create();
	}
	DBG("PROPERTIES FILE FOR PROJECT: " + p->getFile().getFullPathName());
    propertyFiles.add (p);
    return *p;
}
开发者ID:Theadd,项目名称:Designi,代码行数:20,代码来源:StoredSettings.cpp

示例2: saveSettingsToFile

void ApplicationSettingsComponent::saveSettingsToFile(){
  PropertiesFile* properties = ApplicationConfiguration::getApplicationProperties();
  properties->setValue("serialport", serialPortComboBox->getText());
  properties->setValue("serialspeed", serialSpeedComboBox->getText());
  properties->setValue("presetdirectory", presetDirectoryEditor->getText());
  properties->setValue("midiinput", midiInputComboBox->getText());
  properties->setValue("midioutput", midiOutputComboBox->getText());
  properties->setValue("oschost", oscHostEditor->getText());
  properties->setValue("oscport", oscPortEditor->getText());
  properties->saveIfNeeded();
  std::cout << "saved settings to file " << properties->getFile().getFullPathName() << std::endl;
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例3: loadSettingsFromFile

void ApplicationSettingsComponent::loadSettingsFromFile(){
  PropertiesFile* properties = ApplicationConfiguration::getApplicationProperties();
#if JUCE_MAC || JUCE_IOS
  DirectoryIterator it(File("/dev"), false, "tty.usbserial-*");
#elif JUCE_WINDOWS
  DirectoryIterator it(File("\\\\.\\"), false, "COM*");
#elif JUCE_LINUX
  DirectoryIterator it(File("/dev"), false, "ttyUSB*");
#endif
  int index = 1;
  serialPortComboBox->addItem("none", index);
  while(it.next())
    serialPortComboBox->addItem(it.getFile().getFullPathName(), ++index);
  serialPortComboBox->setText(properties->getValue("serialport"));
  serialSpeedComboBox->setText(properties->getValue("serialspeed"));
  presetDirectoryEditor->setText(properties->getValue("presetdirectory"));

  const StringArray& inputs = MidiInput::getDevices();
  midiInputComboBox->addItem("none", ++index);
  for(int i=0; i<inputs.size(); ++i)
    midiInputComboBox->addItem(inputs[i], ++index);
#if ! JUCE_WINDOWS
  midiInputComboBox->addItem("BlipZones", ++index);
#endif
  midiInputComboBox->setText(properties->getValue("midiinput"));

  const StringArray& outputs = MidiOutput::getDevices();
  midiOutputComboBox->addItem("none", ++index);
  for(int i=0; i<outputs.size(); ++i)
    midiOutputComboBox->addItem(outputs[i], ++index);
#if ! JUCE_WINDOWS
  midiOutputComboBox->addItem("BlipZones", ++index);
#endif
  midiOutputComboBox->setText(properties->getValue("midioutput"));

  oscHostEditor->setText(properties->getValue("oschost"));
  oscPortEditor->setText(properties->getValue("oscport"));

  std::cout << "loaded settings from file " << properties->getFile().getFullPathName() << std::endl;
}
开发者ID:,项目名称:,代码行数:40,代码来源:

示例4: flush

void StoredSettings::flush()
{
    if (props != nullptr)
    {
        props->setValue ("recentFiles", recentFiles.toString());

        props->removeValue ("keyMappings");

        if (commandManager != nullptr)
        {
            ScopedPointer <XmlElement> keys (commandManager->getKeyMappings()->createXml (true));

            if (keys != nullptr)
                props->setValue ("keyMappings", (XmlElement*) keys);
        }
    }

    props = nullptr;

    {
        // These settings are used in defining the properties file's location.
        PropertiesFile::Options options;
        options.applicationName     = "Introjucer";
        options.folderName          = "Introjucer";
        options.filenameSuffix      = "settings";
        options.osxLibrarySubFolder = "Application Support";

        props = new PropertiesFile (options);

        // Because older versions of the introjucer saved their settings under a different
        // name, this code is an example of how to migrate your old settings files...
        if (! props->getFile().exists())
        {
            PropertiesFile::Options oldOptions;
            oldOptions.applicationName      = "Jucer2";
            oldOptions.filenameSuffix       = "settings";
            oldOptions.osxLibrarySubFolder  = "Preferences";

            PropertiesFile oldProps (oldOptions);

            if (oldProps.getFile().exists())
                props->addAllPropertiesFrom (oldProps);
        }
    }

    // recent files...
    recentFiles.restoreFromString (props->getValue ("recentFiles"));
    recentFiles.removeNonExistentFiles();

    // swatch colours...
    swatchColours.clear();

    #define COL(col)  Colours::col,

    const Colour colours[] =
    {
        #include "jucer_Colours.h"
        Colours::transparentBlack
    };

    #undef COL

    const int numSwatchColours = 24;

    for (int i = 0; i < numSwatchColours; ++i)
        swatchColours.add (Colour::fromString (props->getValue ("swatchColour" + String (i),
                                                                colours [2 + i].toString())));
}
开发者ID:furio,项目名称:pyplasm,代码行数:68,代码来源:jucer_StoredSettings.cpp


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