Browse Source

Added a setTagName method to XmlElement

tags/2021-05-28
hogliux 7 years ago
parent
commit
736a07e4ce
2 changed files with 11 additions and 0 deletions
  1. +6
    -0
      modules/juce_core/xml/juce_XmlElement.cpp
  2. +5
    -0
      modules/juce_core/xml/juce_XmlElement.h

+ 6
- 0
modules/juce_core/xml/juce_XmlElement.cpp View File

@@ -439,6 +439,12 @@ XmlElement* XmlElement::getNextElementWithTagName (StringRef requiredTagName) co
return e; return e;
} }
void XmlElement::setTagName (StringRef newTagName)
{
jassert (isValidXmlName (newTagName));
tagName = StringPool::getGlobalPool().getPooledString (newTagName);
}
//============================================================================== //==============================================================================
int XmlElement::getNumAttributes() const noexcept int XmlElement::getNumAttributes() const noexcept
{ {


+ 5
- 0
modules/juce_core/xml/juce_XmlElement.h View File

@@ -278,6 +278,11 @@ public:
*/ */
bool hasTagNameIgnoringNamespace (StringRef possibleTagName) const; bool hasTagNameIgnoringNamespace (StringRef possibleTagName) const;
/** Changes this elements tag name.
@see getTagName
*/
void setTagName (StringRef newTagName);
//============================================================================== //==============================================================================
/** Returns the number of XML attributes this element contains. /** Returns the number of XML attributes this element contains.


Loading…
Cancel
Save