Browse Source

ValueTree::toXmlString method.

tags/2021-05-28
jules 13 years ago
parent
commit
e73b49e220
2 changed files with 11 additions and 0 deletions
  1. +6
    -0
      modules/juce_data_structures/values/juce_ValueTree.cpp
  2. +5
    -0
      modules/juce_data_structures/values/juce_ValueTree.h

+ 6
- 0
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -976,6 +976,12 @@ ValueTree ValueTree::fromXml (const XmlElement& xml)
return v;
}
String ValueTree::toXmlString() const
{
const ScopedPointer<XmlElement> xml (createXml());
return xml != nullptr ? xml->createDocument (String::empty) : String::empty;
}
//==============================================================================
void ValueTree::writeToStream (OutputStream& output) const
{


+ 5
- 0
modules/juce_data_structures/values/juce_ValueTree.h View File

@@ -334,6 +334,11 @@ public:
*/
static ValueTree fromXml (const XmlElement& xml);
/** This returns a string containing an XML representation of the tree.
This is quite handy for debugging purposes, as it provides a quick way to view a tree.
*/
String toXmlString() const;
//==============================================================================
/** Stores this tree (and all its children) in a binary format.


Loading…
Cancel
Save