mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Some additions and fixes to plugin scanning.
This commit is contained in:
parent
3e1c6b6a65
commit
5f4c27d0c2
5 changed files with 57 additions and 12 deletions
|
|
@ -215,18 +215,18 @@ bool PropertiesFile::loadAsXml()
|
|||
bool PropertiesFile::saveAsXml()
|
||||
{
|
||||
XmlElement doc (PropertyFileConstants::fileTag);
|
||||
const StringPairArray& props = getAllProperties();
|
||||
|
||||
for (int i = 0; i < getAllProperties().size(); ++i)
|
||||
for (int i = 0; i < props.size(); ++i)
|
||||
{
|
||||
XmlElement* const e = doc.createNewChildElement (PropertyFileConstants::valueTag);
|
||||
e->setAttribute (PropertyFileConstants::nameAttribute, getAllProperties().getAllKeys() [i]);
|
||||
e->setAttribute (PropertyFileConstants::nameAttribute, props.getAllKeys() [i]);
|
||||
|
||||
// if the value seems to contain xml, store it as such..
|
||||
if (XmlElement* const childElement = XmlDocument::parse (getAllProperties().getAllValues() [i]))
|
||||
if (XmlElement* const childElement = XmlDocument::parse (props.getAllValues() [i]))
|
||||
e->addChildElement (childElement);
|
||||
else
|
||||
e->setAttribute (PropertyFileConstants::valueAttribute,
|
||||
getAllProperties().getAllValues() [i]);
|
||||
e->setAttribute (PropertyFileConstants::valueAttribute, props.getAllValues() [i]);
|
||||
}
|
||||
|
||||
ProcessScopedLock pl (createProcessLock());
|
||||
|
|
@ -311,14 +311,17 @@ bool PropertiesFile::saveAsBinary()
|
|||
out->writeInt (PropertyFileConstants::magicNumber);
|
||||
}
|
||||
|
||||
const int numProperties = getAllProperties().size();
|
||||
const StringPairArray& props = getAllProperties();
|
||||
const int numProperties = props.size();
|
||||
const StringArray& keys = props.getAllKeys();
|
||||
const StringArray& values = props.getAllValues();
|
||||
|
||||
out->writeInt (numProperties);
|
||||
|
||||
for (int i = 0; i < numProperties; ++i)
|
||||
{
|
||||
out->writeString (getAllProperties().getAllKeys() [i]);
|
||||
out->writeString (getAllProperties().getAllValues() [i]);
|
||||
out->writeString (keys[i]);
|
||||
out->writeString (values[i]);
|
||||
}
|
||||
|
||||
out = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue