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.

730 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 != nullptr; \
  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 != nullptr; \
  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. #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
  120. XmlElement (XmlElement&& other) noexcept;
  121. XmlElement& operator= (XmlElement&& other) noexcept;
  122. #endif
  123. /** Deleting an XmlElement will also delete all its child elements. */
  124. ~XmlElement() noexcept;
  125. //==============================================================================
  126. /** Compares two XmlElements to see if they contain the same text and attiributes.
  127. The elements are only considered equivalent if they contain the same attiributes
  128. with the same values, and have the same sub-nodes.
  129. @param other the other element to compare to
  130. @param ignoreOrderOfAttributes if true, this means that two elements with the
  131. same attributes in a different order will be
  132. considered the same; if false, the attributes must
  133. be in the same order as well
  134. */
  135. bool isEquivalentTo (const XmlElement* other,
  136. bool ignoreOrderOfAttributes) const noexcept;
  137. //==============================================================================
  138. /** Returns an XML text document that represents this element.
  139. The string returned can be parsed to recreate the same XmlElement that
  140. was used to create it.
  141. @param dtdToUse the DTD to add to the document
  142. @param allOnOneLine if true, this means that the document will not contain any
  143. linefeeds, so it'll be smaller but not very easy to read.
  144. @param includeXmlHeader whether to add the "<?xml version..etc" line at the start of the
  145. document
  146. @param encodingType the character encoding format string to put into the xml
  147. header
  148. @param lineWrapLength the line length that will be used before items get placed on
  149. a new line. This isn't an absolute maximum length, it just
  150. determines how lists of attributes get broken up
  151. @see writeToStream, writeToFile
  152. */
  153. String createDocument (const String& dtdToUse,
  154. bool allOnOneLine = false,
  155. bool includeXmlHeader = true,
  156. const String& encodingType = "UTF-8",
  157. int lineWrapLength = 60) const;
  158. /** Writes the document to a stream as UTF-8.
  159. @param output the stream to write to
  160. @param dtdToUse the DTD to add to the document
  161. @param allOnOneLine if true, this means that the document will not contain any
  162. linefeeds, so it'll be smaller but not very easy to read.
  163. @param includeXmlHeader whether to add the "<?xml version..etc" line at the start of the
  164. document
  165. @param encodingType the character encoding format string to put into the xml
  166. header
  167. @param lineWrapLength the line length that will be used before items get placed on
  168. a new line. This isn't an absolute maximum length, it just
  169. determines how lists of attributes get broken up
  170. @see writeToFile, createDocument
  171. */
  172. void writeToStream (OutputStream& output,
  173. const String& dtdToUse,
  174. bool allOnOneLine = false,
  175. bool includeXmlHeader = true,
  176. const String& encodingType = "UTF-8",
  177. int lineWrapLength = 60) const;
  178. /** Writes the element to a file as an XML document.
  179. To improve safety in case something goes wrong while writing the file, this
  180. will actually write the document to a new temporary file in the same
  181. directory as the destination file, and if this succeeds, it will rename this
  182. new file as the destination file (overwriting any existing file that was there).
  183. @param destinationFile the file to write to. If this already exists, it will be
  184. overwritten.
  185. @param dtdToUse the DTD to add to the document
  186. @param encodingType the character encoding format string to put into the xml
  187. header
  188. @param lineWrapLength the line length that will be used before items get placed on
  189. a new line. This isn't an absolute maximum length, it just
  190. determines how lists of attributes get broken up
  191. @returns true if the file is written successfully; false if something goes wrong
  192. in the process
  193. @see createDocument
  194. */
  195. bool writeToFile (const File& destinationFile,
  196. const String& dtdToUse,
  197. const String& encodingType = "UTF-8",
  198. int lineWrapLength = 60) const;
  199. //==============================================================================
  200. /** Returns this element's tag type name.
  201. E.g. for an element such as \<MOOSE legs="4" antlers="2">, this would return
  202. "MOOSE".
  203. @see hasTagName
  204. */
  205. inline const String& getTagName() const noexcept { return tagName; }
  206. /** Tests whether this element has a particular tag name.
  207. @param possibleTagName the tag name you're comparing it with
  208. @see getTagName
  209. */
  210. bool hasTagName (const String& possibleTagName) const noexcept;
  211. //==============================================================================
  212. /** Returns the number of XML attributes this element contains.
  213. E.g. for an element such as \<MOOSE legs="4" antlers="2">, this would
  214. return 2.
  215. */
  216. int getNumAttributes() const noexcept;
  217. /** Returns the name of one of the elements attributes.
  218. E.g. for an element such as \<MOOSE legs="4" antlers="2">, then
  219. getAttributeName(1) would return "antlers".
  220. @see getAttributeValue, getStringAttribute
  221. */
  222. const String& getAttributeName (int attributeIndex) const noexcept;
  223. /** Returns the value of one of the elements attributes.
  224. E.g. for an element such as \<MOOSE legs="4" antlers="2">, then
  225. getAttributeName(1) would return "2".
  226. @see getAttributeName, getStringAttribute
  227. */
  228. const String& getAttributeValue (int attributeIndex) const noexcept;
  229. //==============================================================================
  230. // Attribute-handling methods..
  231. /** Checks whether the element contains an attribute with a certain name. */
  232. bool hasAttribute (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. */
  236. const String& getStringAttribute (const String& attributeName) const noexcept;
  237. /** Returns the value of a named attribute.
  238. @param attributeName the name of the attribute to look up
  239. @param defaultReturnValue a value to return if the element doesn't have an attribute
  240. with this name
  241. */
  242. String getStringAttribute (const String& attributeName,
  243. const String& defaultReturnValue) const;
  244. /** Compares the value of a named attribute with a value passed-in.
  245. @param attributeName the name of the attribute to look up
  246. @param stringToCompareAgainst the value to compare it with
  247. @param ignoreCase whether the comparison should be case-insensitive
  248. @returns true if the value of the attribute is the same as the string passed-in;
  249. false if it's different (or if no such attribute exists)
  250. */
  251. bool compareAttribute (const String& attributeName,
  252. const String& stringToCompareAgainst,
  253. bool ignoreCase = false) const noexcept;
  254. /** Returns the value of a named attribute as an integer.
  255. This will try to find the attribute and convert it to an integer (using
  256. the String::getIntValue() method).
  257. @param attributeName the name of the attribute to look up
  258. @param defaultReturnValue a value to return if the element doesn't have an attribute
  259. with this name
  260. @see setAttribute
  261. */
  262. int getIntAttribute (const String& attributeName,
  263. int defaultReturnValue = 0) const;
  264. /** Returns the value of a named attribute as floating-point.
  265. This will try to find the attribute and convert it to an integer (using
  266. the String::getDoubleValue() method).
  267. @param attributeName the name of the attribute to look up
  268. @param defaultReturnValue a value to return if the element doesn't have an attribute
  269. with this name
  270. @see setAttribute
  271. */
  272. double getDoubleAttribute (const String& attributeName,
  273. double defaultReturnValue = 0.0) const;
  274. /** Returns the value of a named attribute as a boolean.
  275. This will try to find the attribute and interpret it as a boolean. To do this,
  276. it'll return true if the value is "1", "true", "y", etc, or false for other
  277. values.
  278. @param attributeName the name of the attribute to look up
  279. @param defaultReturnValue a value to return if the element doesn't have an attribute
  280. with this name
  281. */
  282. bool getBoolAttribute (const String& attributeName,
  283. bool defaultReturnValue = false) const;
  284. /** Adds a named attribute to the element.
  285. If the element already contains an attribute with this name, it's value will
  286. be updated to the new value. If there's no such attribute yet, a new one will
  287. be added.
  288. Note that there are other setAttribute() methods that take integers,
  289. doubles, etc. to make it easy to store numbers.
  290. @param attributeName the name of the attribute to set
  291. @param newValue the value to set it to
  292. @see removeAttribute
  293. */
  294. void setAttribute (const String& attributeName,
  295. const String& newValue);
  296. /** Adds a named attribute to the element, setting it to an integer value.
  297. If the element already contains an attribute with this name, it's value will
  298. be updated to the new value. If there's no such attribute yet, a new one will
  299. be added.
  300. Note that there are other setAttribute() methods that take integers,
  301. doubles, etc. to make it easy to store numbers.
  302. @param attributeName the name of the attribute to set
  303. @param newValue the value to set it to
  304. */
  305. void setAttribute (const String& attributeName,
  306. int newValue);
  307. /** Adds a named attribute to the element, setting it to a floating-point value.
  308. If the element already contains an attribute with this name, it's value will
  309. be updated to the new value. If there's no such attribute yet, a new one will
  310. be added.
  311. Note that there are other setAttribute() methods that take integers,
  312. doubles, etc. to make it easy to store numbers.
  313. @param attributeName the name of the attribute to set
  314. @param newValue the value to set it to
  315. */
  316. void setAttribute (const String& attributeName,
  317. double newValue);
  318. /** Removes a named attribute from the element.
  319. @param attributeName the name of the attribute to remove
  320. @see removeAllAttributes
  321. */
  322. void removeAttribute (const String& attributeName) noexcept;
  323. /** Removes all attributes from this element.
  324. */
  325. void removeAllAttributes() noexcept;
  326. //==============================================================================
  327. // Child element methods..
  328. /** Returns the first of this element's sub-elements.
  329. see getNextElement() for an example of how to iterate the sub-elements.
  330. @see forEachXmlChildElement
  331. */
  332. XmlElement* getFirstChildElement() const noexcept { return firstChildElement; }
  333. /** Returns the next of this element's siblings.
  334. This can be used for iterating an element's sub-elements, e.g.
  335. @code
  336. XmlElement* child = myXmlDocument->getFirstChildElement();
  337. while (child != nullptr)
  338. {
  339. ...do stuff with this child..
  340. child = child->getNextElement();
  341. }
  342. @endcode
  343. Note that when iterating the child elements, some of them might be
  344. text elements as well as XML tags - use isTextElement() to work this
  345. out.
  346. Also, it's much easier and neater to use this method indirectly via the
  347. forEachXmlChildElement macro.
  348. @returns the sibling element that follows this one, or zero if this is the last
  349. element in its parent
  350. @see getNextElement, isTextElement, forEachXmlChildElement
  351. */
  352. inline XmlElement* getNextElement() const noexcept { return nextListItem; }
  353. /** Returns the next of this element's siblings which has the specified tag
  354. name.
  355. This is like getNextElement(), but will scan through the list until it
  356. finds an element with the given tag name.
  357. @see getNextElement, forEachXmlChildElementWithTagName
  358. */
  359. XmlElement* getNextElementWithTagName (const String& requiredTagName) const;
  360. /** Returns the number of sub-elements in this element.
  361. @see getChildElement
  362. */
  363. int getNumChildElements() const noexcept;
  364. /** Returns the sub-element at a certain index.
  365. It's not very efficient to iterate the sub-elements by index - see
  366. getNextElement() for an example of how best to iterate.
  367. @returns the n'th child of this element, or 0 if the index is out-of-range
  368. @see getNextElement, isTextElement, getChildByName
  369. */
  370. XmlElement* getChildElement (int index) const noexcept;
  371. /** Returns the first sub-element with a given tag-name.
  372. @param tagNameToLookFor the tag name of the element you want to find
  373. @returns the first element with this tag name, or 0 if none is found
  374. @see getNextElement, isTextElement, getChildElement
  375. */
  376. XmlElement* getChildByName (const String& tagNameToLookFor) const noexcept;
  377. //==============================================================================
  378. /** Appends an element to this element's list of children.
  379. Child elements are deleted automatically when their parent is deleted, so
  380. make sure the object that you pass in will not be deleted by anything else,
  381. and make sure it's not already the child of another element.
  382. @see getFirstChildElement, getNextElement, getNumChildElements,
  383. getChildElement, removeChildElement
  384. */
  385. void addChildElement (XmlElement* newChildElement) noexcept;
  386. /** Inserts an element into this element's list of children.
  387. Child elements are deleted automatically when their parent is deleted, so
  388. make sure the object that you pass in will not be deleted by anything else,
  389. and make sure it's not already the child of another element.
  390. @param newChildNode the element to add
  391. @param indexToInsertAt the index at which to insert the new element - if this is
  392. below zero, it will be added to the end of the list
  393. @see addChildElement, insertChildElement
  394. */
  395. void insertChildElement (XmlElement* newChildNode,
  396. int indexToInsertAt) noexcept;
  397. /** Creates a new element with the given name and returns it, after adding it
  398. as a child element.
  399. This is a handy method that means that instead of writing this:
  400. @code
  401. XmlElement* newElement = new XmlElement ("foobar");
  402. myParentElement->addChildElement (newElement);
  403. @endcode
  404. ..you could just write this:
  405. @code
  406. XmlElement* newElement = myParentElement->createNewChildElement ("foobar");
  407. @endcode
  408. */
  409. XmlElement* createNewChildElement (const String& tagName);
  410. /** Replaces one of this element's children with another node.
  411. If the current element passed-in isn't actually a child of this element,
  412. this will return false and the new one won't be added. Otherwise, the
  413. existing element will be deleted, replaced with the new one, and it
  414. will return true.
  415. */
  416. bool replaceChildElement (XmlElement* currentChildElement,
  417. XmlElement* newChildNode) noexcept;
  418. /** Removes a child element.
  419. @param childToRemove the child to look for and remove
  420. @param shouldDeleteTheChild if true, the child will be deleted, if false it'll
  421. just remove it
  422. */
  423. void removeChildElement (XmlElement* childToRemove,
  424. bool shouldDeleteTheChild) noexcept;
  425. /** Deletes all the child elements in the element.
  426. @see removeChildElement, deleteAllChildElementsWithTagName
  427. */
  428. void deleteAllChildElements() noexcept;
  429. /** Deletes all the child elements with a given tag name.
  430. @see removeChildElement
  431. */
  432. void deleteAllChildElementsWithTagName (const String& tagName) noexcept;
  433. /** Returns true if the given element is a child of this one. */
  434. bool containsChildElement (const XmlElement* possibleChild) const noexcept;
  435. /** Recursively searches all sub-elements to find one that contains the specified
  436. child element.
  437. */
  438. XmlElement* findParentElementOf (const XmlElement* elementToLookFor) noexcept;
  439. //==============================================================================
  440. /** Sorts the child elements using a comparator.
  441. This will use a comparator object to sort the elements into order. The object
  442. passed must have a method of the form:
  443. @code
  444. int compareElements (const XmlElement* first, const XmlElement* second);
  445. @endcode
  446. ..and this method must return:
  447. - a value of < 0 if the first comes before the second
  448. - a value of 0 if the two objects are equivalent
  449. - a value of > 0 if the second comes before the first
  450. To improve performance, the compareElements() method can be declared as static or const.
  451. @param comparator the comparator to use for comparing elements.
  452. @param retainOrderOfEquivalentItems if this is true, then items which the comparator
  453. says are equivalent will be kept in the order in which they
  454. currently appear in the array. This is slower to perform, but
  455. may be important in some cases. If it's false, a faster algorithm
  456. is used, but equivalent elements may be rearranged.
  457. */
  458. template <class ElementComparator>
  459. void sortChildElements (ElementComparator& comparator,
  460. bool retainOrderOfEquivalentItems = false)
  461. {
  462. const int num = getNumChildElements();
  463. if (num > 1)
  464. {
  465. HeapBlock <XmlElement*> elems ((size_t) num);
  466. getChildElementsAsArray (elems);
  467. sortArray (comparator, (XmlElement**) elems, 0, num - 1, retainOrderOfEquivalentItems);
  468. reorderChildElements (elems, num);
  469. }
  470. }
  471. //==============================================================================
  472. /** Returns true if this element is a section of text.
  473. Elements can either be an XML tag element or a secton of text, so this
  474. is used to find out what kind of element this one is.
  475. @see getAllText, addTextElement, deleteAllTextElements
  476. */
  477. bool isTextElement() const noexcept;
  478. /** Returns the text for a text element.
  479. Note that if you have an element like this:
  480. @code<xyz>hello</xyz>@endcode
  481. then calling getText on the "xyz" element won't return "hello", because that is
  482. actually stored in a special text sub-element inside the xyz element. To get the
  483. "hello" string, you could either call getText on the (unnamed) sub-element, or
  484. use getAllSubText() to do this automatically.
  485. Note that leading and trailing whitespace will be included in the string - to remove
  486. if, just call String::trim() on the result.
  487. @see isTextElement, getAllSubText, getChildElementAllSubText
  488. */
  489. const String& getText() const noexcept;
  490. /** Sets the text in a text element.
  491. Note that this is only a valid call if this element is a text element. If it's
  492. not, then no action will be performed. If you're trying to add text inside a normal
  493. element, you probably want to use addTextElement() instead.
  494. */
  495. void setText (const String& newText);
  496. /** Returns all the text from this element's child nodes.
  497. This iterates all the child elements and when it finds text elements,
  498. it concatenates their text into a big string which it returns.
  499. E.g. @code<xyz>hello <x>there</x> world</xyz>@endcode
  500. if you called getAllSubText on the "xyz" element, it'd return "hello there world".
  501. Note that leading and trailing whitespace will be included in the string - to remove
  502. if, just call String::trim() on the result.
  503. @see isTextElement, getChildElementAllSubText, getText, addTextElement
  504. */
  505. String getAllSubText() const;
  506. /** Returns all the sub-text of a named child element.
  507. If there is a child element with the given tag name, this will return
  508. all of its sub-text (by calling getAllSubText() on it). If there is
  509. no such child element, this will return the default string passed-in.
  510. @see getAllSubText
  511. */
  512. String getChildElementAllSubText (const String& childTagName,
  513. const String& defaultReturnValue) const;
  514. /** Appends a section of text to this element.
  515. @see isTextElement, getText, getAllSubText
  516. */
  517. void addTextElement (const String& text);
  518. /** Removes all the text elements from this element.
  519. @see isTextElement, getText, getAllSubText, addTextElement
  520. */
  521. void deleteAllTextElements() noexcept;
  522. /** Creates a text element that can be added to a parent element.
  523. */
  524. static XmlElement* createTextElement (const String& text);
  525. //==============================================================================
  526. private:
  527. struct XmlAttributeNode
  528. {
  529. XmlAttributeNode (const XmlAttributeNode&) noexcept;
  530. XmlAttributeNode (const String& name, const String& value) noexcept;
  531. LinkedListPointer<XmlAttributeNode> nextListItem;
  532. String name, value;
  533. bool hasName (const String&) const noexcept;
  534. private:
  535. XmlAttributeNode& operator= (const XmlAttributeNode&);
  536. };
  537. friend class XmlDocument;
  538. friend class LinkedListPointer <XmlAttributeNode>;
  539. friend class LinkedListPointer <XmlElement>;
  540. friend class LinkedListPointer <XmlElement>::Appender;
  541. LinkedListPointer <XmlElement> nextListItem;
  542. LinkedListPointer <XmlElement> firstChildElement;
  543. LinkedListPointer <XmlAttributeNode> attributes;
  544. String tagName;
  545. XmlElement (int) noexcept;
  546. void copyChildrenAndAttributesFrom (const XmlElement&);
  547. void writeElementAsText (OutputStream&, int indentationLevel, int lineWrapLength) const;
  548. void getChildElementsAsArray (XmlElement**) const noexcept;
  549. void reorderChildElements (XmlElement**, int) noexcept;
  550. JUCE_LEAK_DETECTOR (XmlElement);
  551. };
  552. #endif // __JUCE_XMLELEMENT_JUCEHEADER__