Browse Source

ValueTree constness tweak.

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

+ 3
- 4
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -972,7 +972,7 @@ ValueTree ValueTree::fromXml (const XmlElement& xml)
} }
//============================================================================== //==============================================================================
void ValueTree::writeToStream (OutputStream& output)
void ValueTree::writeToStream (OutputStream& output) const
{ {
SharedObject::writeObjectToStream (output, object); SharedObject::writeObjectToStream (output, object);
} }
@@ -994,8 +994,7 @@ ValueTree ValueTree::readFromStream (InputStream& input)
return v; return v;
} }
int i;
for (i = 0; i < numProps; ++i)
for (int i = 0; i < numProps; ++i)
{ {
const String name (input.readString()); const String name (input.readString());
jassert (name.isNotEmpty()); jassert (name.isNotEmpty());
@@ -1005,7 +1004,7 @@ ValueTree ValueTree::readFromStream (InputStream& input)
const int numChildren = input.readCompressedInt(); const int numChildren = input.readCompressedInt();
for (i = 0; i < numChildren; ++i)
for (int i = 0; i < numChildren; ++i)
{ {
ValueTree child (readFromStream (input)); ValueTree child (readFromStream (input));


+ 1
- 1
modules/juce_data_structures/values/juce_ValueTree.h View File

@@ -342,7 +342,7 @@ public:
It's much faster to load/save your tree in binary form than as XML, but It's much faster to load/save your tree in binary form than as XML, but
obviously isn't human-readable. obviously isn't human-readable.
*/ */
void writeToStream (OutputStream& output);
void writeToStream (OutputStream& output) const;
/** Reloads a tree from a stream that was written with writeToStream(). */ /** Reloads a tree from a stream that was written with writeToStream(). */
static ValueTree readFromStream (InputStream& input); static ValueTree readFromStream (InputStream& input);


Loading…
Cancel
Save