The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

725 lines
30KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_XMLELEMENT_JUCEHEADER__
  19. #define __JUCE_XMLELEMENT_JUCEHEADER__
  20. #include "../text/juce_String.h"
  21. #include "../streams/juce_OutputStream.h"
  22. #include "../files/juce_File.h"
  23. #include "../containers/juce_LinkedListPointer.h"
  24. //==============================================================================
  25. /** A handy macro to make it easy to iterate all the child elements in an XmlElement.
  26. The parentXmlElement should be a reference to the parent XML, and the childElementVariableName
  27. will be the name of a pointer to each child element.
  28. E.g. @code
  29. XmlElement* myParentXml = createSomeKindOfXmlDocument();
  30. forEachXmlChildElement (*myParentXml, child)
  31. {
  32. if (child->hasTagName ("FOO"))
  33. doSomethingWithXmlElement (child);
  34. }
  35. @endcode
  36. @see forEachXmlChildElementWithTagName
  37. */
  38. #define forEachXmlChildElement(parentXmlElement, childElementVariableName) \
  39. \
  40. for (juce::XmlElement* childElementVariableName = (parentXmlElement).getFirstChildElement(); \
  41. childElementVariableName != 0; \
  42. childElementVariableName = childElementVariableName->getNextElement())
  43. /** A macro that makes it easy to iterate all the child elements of an XmlElement
  44. which have a specified tag.
  45. This does the same job as the forEachXmlChildElement macro, but only for those
  46. elements that have a particular tag name.
  47. The parentXmlElement should be a reference to the parent XML, and the childElementVariableName
  48. will be the name of a pointer to each child element. The requiredTagName is the
  49. tag name to match.
  50. E.g. @code
  51. XmlElement* myParentXml = createSomeKindOfXmlDocument();
  52. forEachXmlChildElementWithTagName (*myParentXml, child, "MYTAG")
  53. {
  54. // the child object is now guaranteed to be a <MYTAG> element..
  55. doSomethingWithMYTAGElement (child);
  56. }
  57. @endcode
  58. @see forEachXmlChildElement
  59. */
  60. #define forEachXmlChildElementWithTagName(parentXmlElement, childElementVariableName, requiredTagName) \
  61. \
  62. for (juce::XmlElement* childElementVariableName = (parentXmlElement).getChildByName (requiredTagName); \
  63. childElementVariableName != 0; \
  64. childElementVariableName = childElementVariableName->getNextElementWithTagName (requiredTagName))
  65. //==============================================================================
  66. /** Used to build a tree of elements representing an XML document.
  67. An XML document can be parsed into a tree of XmlElements, each of which
  68. represents an XML tag structure, and which may itself contain other
  69. nested elements.
  70. An XmlElement can also be converted back into a text document, and has
  71. lots of useful methods for manipulating its attributes and sub-elements,
  72. so XmlElements can actually be used as a handy general-purpose data
  73. structure.
  74. Here's an example of parsing some elements: @code
  75. // check we're looking at the right kind of document..
  76. if (myElement->hasTagName ("ANIMALS"))
  77. {
  78. // now we'll iterate its sub-elements looking for 'giraffe' elements..
  79. forEachXmlChildElement (*myElement, e)
  80. {
  81. if (e->hasTagName ("GIRAFFE"))
  82. {
  83. // found a giraffe, so use some of its attributes..
  84. String giraffeName = e->getStringAttribute ("name");
  85. int giraffeAge = e->getIntAttribute ("age");
  86. bool isFriendly = e->getBoolAttribute ("friendly");
  87. }
  88. }
  89. }
  90. @endcode
  91. And here's an example of how to create an XML document from scratch: @code
  92. // create an outer node called "ANIMALS"
  93. XmlElement animalsList ("ANIMALS");
  94. for (int i = 0; i < numAnimals; ++i)
  95. {
  96. // create an inner element..
  97. XmlElement* giraffe = new XmlElement ("GIRAFFE");
  98. giraffe->setAttribute ("name", "nigel");
  99. giraffe->setAttribute ("age", 10);
  100. giraffe->setAttribute ("friendly", true);
  101. // ..and add our new element to the parent node
  102. animalsList.addChildElement (giraffe);
  103. }
  104. // now we can turn the whole thing into a text document..
  105. String myXmlDoc = animalsList.createDocument (String::empty);
  106. @endcode
  107. @see XmlDocument
  108. */
  109. class JUCE_API XmlElement
  110. {
  111. public:
  112. //==============================================================================
  113. /** Creates an XmlElement with this tag name. */
  114. explicit XmlElement (const String& tagName) noexcept;
  115. /** Creates a (deep) copy of another element. */
  116. XmlElement (const XmlElement& other);
  117. /** Creates a (deep) copy of another element. */
  118. XmlElement& operator= (const XmlElement& other);
  119. /** Deleting an XmlElement will also delete all its child elements. */
  120. ~XmlElement() noexcept;
  121. //==============================================================================
  122. /** Compares two XmlElements to see if they contain the same text and attiributes.
  123. The elements are only considered equivalent if they contain the same attiributes
  124. with the same values, and have the same sub-nodes.
  125. @param other the other element to compare to
  126. @param ignoreOrderOfAttributes if true, this means that two elements with the
  127. same attributes in a different order will be
  128. considered the same; if false, the attributes must
  129. be in the same order as well
  130. */
  131. bool isEquivalentTo (const XmlElement* other,
  132. bool ignoreOrderOfAttributes) const noexcept;
  133. //==============================================================================
  134. /** Returns an XML text document that represents this element.
  135. The string returned can be parsed to recreate the same XmlElement that
  136. was used to create it.
  137. @param dtdToUse the DTD to add to the document
  138. @param allOnOneLine if true, this means that the document will not contain any
  139. linefeeds, so it'll be smaller but not very easy to read.
  140. @param includeXmlHeader whether to add the "<?xml version..etc" line at the start of the
  141. document
  142. @param encodingType the character encoding format string to put into the xml
  143. header
  144. @param lineWrapLength the line length that will be used before items get placed on
  145. a new line. This isn't an absolute maximum length, it just
  146. determines how lists of attributes get broken up
  147. @see writeToStream, writeToFile
  148. */
  149. String createDocument (const String& dtdToUse,
  150. bool allOnOneLine = false,
  151. bool includeXmlHeader = true,
  152. const String& encodingType = "UTF-8",
  153. int lineWrapLength = 60) const;
  154. /** Writes the document to a stream as UTF-8.
  155. @param output the stream to write to
  156. @param dtdToUse the DTD to add to the document
  157. @param allOnOneLine if true, this means that the document will not contain any
  158. linefeeds, so it'll be smaller but not very easy to read.
  159. @param includeXmlHeader whether to add the "<?xml version..etc" line at the start of the
  160. document
  161. @param encodingType the character encoding format string to put into the xml
  162. header
  163. @param lineWrapLength the line length that will be used before items get placed on
  164. a new line. This isn't an absolute maximum length, it just
  165. determines how lists of attributes get broken up
  166. @see writeToFile, createDocument
  167. */
  168. void writeToStream (OutputStream& output,
  169. const String& dtdToUse,
  170. bool allOnOneLine = false,
  171. bool includeXmlHeader = true,
  172. const String& encodingType = "UTF-8",
  173. int lineWrapLength = 60) const;
  174. /** Writes the element to a file as an XML document.
  175. To improve safety in case something goes wrong while writing the file, this
  176. will actually write the document to a new temporary file in the same
  177. directory as the destination file, and if this succeeds, it will rename this
  178. new file as the destination file (overwriting any existing file that was there).
  179. @param destinationFile the file to write to. If this already exists, it will be
  180. overwritten.
  181. @param dtdToUse the DTD to add to the document
  182. @param encodingType the character encoding format string to put into the xml
  183. header
  184. @param lineWrapLength the line length that will be used before items get placed on
  185. a new line. This isn't an absolute maximum length, it just
  186. determines how lists of attributes get broken up
  187. @returns true if the file is written successfully; false if something goes wrong
  188. in the process
  189. @see createDocument
  190. */
  191. bool writeToFile (const File& destinationFile,
  192. const String& dtdToUse,
  193. const String& encodingType = "UTF-8",
  194. int lineWrapLength = 60) const;
  195. //==============================================================================
  196. /** Returns this element's tag type name.
  197. E.g. for an element such as \<MOOSE legs="4" antlers="2">, this would return
  198. "MOOSE".
  199. @see hasTagName
  200. */
  201. inline const String& getTagName() const noexcept { return tagName; }
  202. /** Tests whether this element has a particular tag name.
  203. @param possibleTagName the tag name you're comparing it with
  204. @see getTagName
  205. */
  206. bool hasTagName (const String& possibleTagName) const noexcept;
  207. //==============================================================================
  208. /** Returns the number of XML attributes this element contains.
  209. E.g. for an element such as \<MOOSE legs="4" antlers="2">, this would
  210. return 2.
  211. */
  212. int getNumAttributes() const noexcept;
  213. /** Returns the name of one of the elements attributes.
  214. E.g. for an element such as \<MOOSE legs="4" antlers="2">, then
  215. getAttributeName(1) would return "antlers".
  216. @see getAttributeValue, getStringAttribute
  217. */
  218. const String& getAttributeName (int attributeIndex) const noexcept;
  219. /** Returns the value of one of the elements attributes.
  220. E.g. for an element such as \<MOOSE legs="4" antlers="2">, then
  221. getAttributeName(1) would return "2".
  222. @see getAttributeName, getStringAttribute
  223. */
  224. const String& getAttributeValue (int attributeIndex) const noexcept;
  225. //==============================================================================
  226. // Attribute-handling methods..
  227. /** Checks whether the element contains an attribute with a certain name. */
  228. bool hasAttribute (const String& attributeName) const noexcept;
  229. /** Returns the value of a named attribute.
  230. @param attributeName the name of the attribute to look up
  231. */
  232. const String& getStringAttribute (const String& attributeName) const noexcept;
  233. /** Returns the value of a named attribute.
  234. @param attributeName the name of the attribute to look up
  235. @param defaultReturnValue a value to return if the element doesn't have an attribute
  236. with this name
  237. */
  238. String getStringAttribute (const String& attributeName,
  239. const String& defaultReturnValue) const;
  240. /** Compares the value of a named attribute with a value passed-in.
  241. @param attributeName the name of the attribute to look up
  242. @param stringToCompareAgainst the value to compare it with
  243. @param ignoreCase whether the comparison should be case-insensitive
  244. @returns true if the value of the attribute is the same as the string passed-in;
  245. false if it's different (or if no such attribute exists)
  246. */
  247. bool compareAttribute (const String& attributeName,
  248. const String& stringToCompareAgainst,
  249. bool ignoreCase = false) const noexcept;
  250. /** Returns the value of a named attribute as an integer.
  251. This will try to find the attribute and convert it to an integer (using
  252. the String::getIntValue() method).
  253. @param attributeName the name of the attribute to look up
  254. @param defaultReturnValue a value to return if the element doesn't have an attribute
  255. with this name
  256. @see setAttribute
  257. */
  258. int getIntAttribute (const String& attributeName,
  259. int defaultReturnValue = 0) const;
  260. /** Returns the value of a named attribute as floating-point.
  261. This will try to find the attribute and convert it to an integer (using
  262. the String::getDoubleValue() method).
  263. @param attributeName the name of the attribute to look up
  264. @param defaultReturnValue a value to return if the element doesn't have an attribute
  265. with this name
  266. @see setAttribute
  267. */
  268. double getDoubleAttribute (const String& attributeName,
  269. double defaultReturnValue = 0.0) const;
  270. /** Returns the value of a named attribute as a boolean.
  271. This will try to find the attribute and interpret it as a boolean. To do this,
  272. it'll return true if the value is "1", "true", "y", etc, or false for other
  273. values.
  274. @param attributeName the name of the attribute to look up
  275. @param defaultReturnValue a value to return if the element doesn't have an attribute
  276. with this name
  277. */
  278. bool getBoolAttribute (const String& attributeName,
  279. bool defaultReturnValue = false) const;
  280. /** Adds a named attribute to the element.
  281. If the element already contains an attribute with this name, it's value will
  282. be updated to the new value. If there's no such attribute yet, a new one will
  283. be added.
  284. Note that there are other setAttribute() methods that take integers,
  285. doubles, etc. to make it easy to store numbers.
  286. @param attributeName the name of the attribute to set
  287. @param newValue the value to set it to
  288. @see removeAttribute
  289. */
  290. void setAttribute (const String& attributeName,
  291. const String& newValue);
  292. /** Adds a named attribute to the element, setting it to an integer value.
  293. If the element already contains an attribute with this name, it's value will
  294. be updated to the new value. If there's no such attribute yet, a new one will
  295. be added.
  296. Note that there are other setAttribute() methods that take integers,
  297. doubles, etc. to make it easy to store numbers.
  298. @param attributeName the name of the attribute to set
  299. @param newValue the value to set it to
  300. */
  301. void setAttribute (const String& attributeName,
  302. int newValue);
  303. /** Adds a named attribute to the element, setting it to a floating-point value.
  304. If the element already contains an attribute with this name, it's value will
  305. be updated to the new value. If there's no such attribute yet, a new one will
  306. be added.
  307. Note that there are other setAttribute() methods that take integers,
  308. doubles, etc. to make it easy to store numbers.
  309. @param attributeName the name of the attribute to set
  310. @param newValue the value to set it to
  311. */
  312. void setAttribute (const String& attributeName,
  313. double newValue);
  314. /** Removes a named attribute from the element.
  315. @param attributeName the name of the attribute to remove
  316. @see removeAllAttributes
  317. */
  318. void removeAttribute (const String& attributeName) noexcept;
  319. /** Removes all attributes from this element.
  320. */
  321. void removeAllAttributes() noexcept;
  322. //==============================================================================
  323. // Child element methods..
  324. /** Returns the first of this element's sub-elements.
  325. see getNextElement() for an example of how to iterate the sub-elements.
  326. @see forEachXmlChildElement
  327. */
  328. XmlElement* getFirstChildElement() const noexcept { return firstChildElement; }
  329. /** Returns the next of this element's siblings.
  330. This can be used for iterating an element's sub-elements, e.g.
  331. @code
  332. XmlElement* child = myXmlDocument->getFirstChildElement();
  333. while (child != nullptr)
  334. {
  335. ...do stuff with this child..
  336. child = child->getNextElement();
  337. }
  338. @endcode
  339. Note that when iterating the child elements, some of them might be
  340. text elements as well as XML tags - use isTextElement() to work this
  341. out.
  342. Also, it's much easier and neater to use this method indirectly via the
  343. forEachXmlChildElement macro.
  344. @returns the sibling element that follows this one, or zero if this is the last
  345. element in its parent
  346. @see getNextElement, isTextElement, forEachXmlChildElement
  347. */
  348. inline XmlElement* getNextElement() const noexcept { return nextListItem; }
  349. /** Returns the next of this element's siblings which has the specified tag
  350. name.
  351. This is like getNextElement(), but will scan through the list until it
  352. finds an element with the given tag name.
  353. @see getNextElement, forEachXmlChildElementWithTagName
  354. */
  355. XmlElement* getNextElementWithTagName (const String& requiredTagName) const;
  356. /** Returns the number of sub-elements in this element.
  357. @see getChildElement
  358. */
  359. int getNumChildElements() const noexcept;
  360. /** Returns the sub-element at a certain index.
  361. It's not very efficient to iterate the sub-elements by index - see
  362. getNextElement() for an example of how best to iterate.
  363. @returns the n'th child of this element, or 0 if the index is out-of-range
  364. @see getNextElement, isTextElement, getChildByName
  365. */
  366. XmlElement* getChildElement (int index) const noexcept;
  367. /** Returns the first sub-element with a given tag-name.
  368. @param tagNameToLookFor the tag name of the element you want to find
  369. @returns the first element with this tag name, or 0 if none is found
  370. @see getNextElement, isTextElement, getChildElement
  371. */
  372. XmlElement* getChildByName (const String& tagNameToLookFor) const noexcept;
  373. //==============================================================================
  374. /** Appends an element to this element's list of children.
  375. Child elements are deleted automatically when their parent is deleted, so
  376. make sure the object that you pass in will not be deleted by anything else,
  377. and make sure it's not already the child of another element.
  378. @see getFirstChildElement, getNextElement, getNumChildElements,
  379. getChildElement, removeChildElement
  380. */
  381. void addChildElement (XmlElement* newChildElement) noexcept;
  382. /** Inserts an element into this element's list of children.
  383. Child elements are deleted automatically when their parent is deleted, so
  384. make sure the object that you pass in will not be deleted by anything else,
  385. and make sure it's not already the child of another element.
  386. @param newChildNode the element to add
  387. @param indexToInsertAt the index at which to insert the new element - if this is
  388. below zero, it will be added to the end of the list
  389. @see addChildElement, insertChildElement
  390. */
  391. void insertChildElement (XmlElement* newChildNode,
  392. int indexToInsertAt) noexcept;
  393. /** Creates a new element with the given name and returns it, after adding it
  394. as a child element.
  395. This is a handy method that means that instead of writing this:
  396. @code
  397. XmlElement* newElement = new XmlElement ("foobar");
  398. myParentElement->addChildElement (newElement);
  399. @endcode
  400. ..you could just write this:
  401. @code
  402. XmlElement* newElement = myParentElement->createNewChildElement ("foobar");
  403. @endcode
  404. */
  405. XmlElement* createNewChildElement (const String& tagName);
  406. /** Replaces one of this element's children with another node.
  407. If the current element passed-in isn't actually a child of this element,
  408. this will return false and the new one won't be added. Otherwise, the
  409. existing element will be deleted, replaced with the new one, and it
  410. will return true.
  411. */
  412. bool replaceChildElement (XmlElement* currentChildElement,
  413. XmlElement* newChildNode) noexcept;
  414. /** Removes a child element.
  415. @param childToRemove the child to look for and remove
  416. @param shouldDeleteTheChild if true, the child will be deleted, if false it'll
  417. just remove it
  418. */
  419. void removeChildElement (XmlElement* childToRemove,
  420. bool shouldDeleteTheChild) noexcept;
  421. /** Deletes all the child elements in the element.
  422. @see removeChildElement, deleteAllChildElementsWithTagName
  423. */
  424. void deleteAllChildElements() noexcept;
  425. /** Deletes all the child elements with a given tag name.
  426. @see removeChildElement
  427. */
  428. void deleteAllChildElementsWithTagName (const String& tagName) noexcept;
  429. /** Returns true if the given element is a child of this one. */
  430. bool containsChildElement (const XmlElement* possibleChild) const noexcept;
  431. /** Recursively searches all sub-elements to find one that contains the specified
  432. child element.
  433. */
  434. XmlElement* findParentElementOf (const XmlElement* elementToLookFor) noexcept;
  435. //==============================================================================
  436. /** Sorts the child elements using a comparator.
  437. This will use a comparator object to sort the elements into order. The object
  438. passed must have a method of the form:
  439. @code
  440. int compareElements (const XmlElement* first, const XmlElement* second);
  441. @endcode
  442. ..and this method must return:
  443. - a value of < 0 if the first comes before the second
  444. - a value of 0 if the two objects are equivalent
  445. - a value of > 0 if the second comes before the first
  446. To improve performance, the compareElements() method can be declared as static or const.
  447. @param comparator the comparator to use for comparing elements.
  448. @param retainOrderOfEquivalentItems if this is true, then items which the comparator
  449. says are equivalent will be kept in the order in which they
  450. currently appear in the array. This is slower to perform, but
  451. may be important in some cases. If it's false, a faster algorithm
  452. is used, but equivalent elements may be rearranged.
  453. */
  454. template <class ElementComparator>
  455. void sortChildElements (ElementComparator& comparator,
  456. bool retainOrderOfEquivalentItems = false)
  457. {
  458. const int num = getNumChildElements();
  459. if (num > 1)
  460. {
  461. HeapBlock <XmlElement*> elems (num);
  462. getChildElementsAsArray (elems);
  463. sortArray (comparator, (XmlElement**) elems, 0, num - 1, retainOrderOfEquivalentItems);
  464. reorderChildElements (elems, num);
  465. }
  466. }
  467. //==============================================================================
  468. /** Returns true if this element is a section of text.
  469. Elements can either be an XML tag element or a secton of text, so this
  470. is used to find out what kind of element this one is.
  471. @see getAllText, addTextElement, deleteAllTextElements
  472. */
  473. bool isTextElement() const noexcept;
  474. /** Returns the text for a text element.
  475. Note that if you have an element like this:
  476. @code<xyz>hello</xyz>@endcode
  477. then calling getText on the "xyz" element won't return "hello", because that is
  478. actually stored in a special text sub-element inside the xyz element. To get the
  479. "hello" string, you could either call getText on the (unnamed) sub-element, or
  480. use getAllSubText() to do this automatically.
  481. Note that leading and trailing whitespace will be included in the string - to remove
  482. if, just call String::trim() on the result.
  483. @see isTextElement, getAllSubText, getChildElementAllSubText
  484. */
  485. const String& getText() const noexcept;
  486. /** Sets the text in a text element.
  487. Note that this is only a valid call if this element is a text element. If it's
  488. not, then no action will be performed. If you're trying to add text inside a normal
  489. element, you probably want to use addTextElement() instead.
  490. */
  491. void setText (const String& newText);
  492. /** Returns all the text from this element's child nodes.
  493. This iterates all the child elements and when it finds text elements,
  494. it concatenates their text into a big string which it returns.
  495. E.g. @code<xyz>hello <x>there</x> world</xyz>@endcode
  496. if you called getAllSubText on the "xyz" element, it'd return "hello there world".
  497. Note that leading and trailing whitespace will be included in the string - to remove
  498. if, just call String::trim() on the result.
  499. @see isTextElement, getChildElementAllSubText, getText, addTextElement
  500. */
  501. String getAllSubText() const;
  502. /** Returns all the sub-text of a named child element.
  503. If there is a child element with the given tag name, this will return
  504. all of its sub-text (by calling getAllSubText() on it). If there is
  505. no such child element, this will return the default string passed-in.
  506. @see getAllSubText
  507. */
  508. String getChildElementAllSubText (const String& childTagName,
  509. const String& defaultReturnValue) const;
  510. /** Appends a section of text to this element.
  511. @see isTextElement, getText, getAllSubText
  512. */
  513. void addTextElement (const String& text);
  514. /** Removes all the text elements from this element.
  515. @see isTextElement, getText, getAllSubText, addTextElement
  516. */
  517. void deleteAllTextElements() noexcept;
  518. /** Creates a text element that can be added to a parent element.
  519. */
  520. static XmlElement* createTextElement (const String& text);
  521. //==============================================================================
  522. private:
  523. struct XmlAttributeNode
  524. {
  525. XmlAttributeNode (const XmlAttributeNode& other) noexcept;
  526. XmlAttributeNode (const String& name, const String& value) noexcept;
  527. LinkedListPointer<XmlAttributeNode> nextListItem;
  528. String name, value;
  529. bool hasName (const String& name) const noexcept;
  530. private:
  531. XmlAttributeNode& operator= (const XmlAttributeNode&);
  532. };
  533. friend class XmlDocument;
  534. friend class LinkedListPointer<XmlAttributeNode>;
  535. friend class LinkedListPointer <XmlElement>;
  536. friend class LinkedListPointer <XmlElement>::Appender;
  537. LinkedListPointer <XmlElement> nextListItem;
  538. LinkedListPointer <XmlElement> firstChildElement;
  539. LinkedListPointer <XmlAttributeNode> attributes;
  540. String tagName;
  541. XmlElement (int) noexcept;
  542. void copyChildrenAndAttributesFrom (const XmlElement& other);
  543. void writeElementAsText (OutputStream& out, int indentationLevel, int lineWrapLength) const;
  544. void getChildElementsAsArray (XmlElement**) const noexcept;
  545. void reorderChildElements (XmlElement**, int) noexcept;
  546. JUCE_LEAK_DETECTOR (XmlElement);
  547. };
  548. #endif // __JUCE_XMLELEMENT_JUCEHEADER__