openshot-audio  0.1.2
juce_XmlDocument.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the juce_core module of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission to use, copy, modify, and/or distribute this software for any purpose with
8  or without fee is hereby granted, provided that the above copyright notice and this
9  permission notice appear in all copies.
10 
11  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12  TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
13  NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
15  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 
18  ------------------------------------------------------------------------------
19 
20  NOTE! This permissive ISC license applies ONLY to files within the juce_core module!
21  All other JUCE modules are covered by a dual GPL/commercial license, so if you are
22  using any other modules, be sure to check that you also comply with their license.
23 
24  For more details, visit www.juce.com
25 
26  ==============================================================================
27 */
28 
29 #ifndef JUCE_XMLDOCUMENT_H_INCLUDED
30 #define JUCE_XMLDOCUMENT_H_INCLUDED
31 
32 
33 //==============================================================================
70 {
71 public:
72  //==============================================================================
76  XmlDocument (const String& documentText);
77 
81  XmlDocument (const File& file);
82 
84  ~XmlDocument();
85 
86  //==============================================================================
106  XmlElement* getDocumentElement (bool onlyReadOuterDocumentElement = false);
107 
112  const String& getLastParseError() const noexcept;
113 
125  void setInputSource (InputSource* newSource) noexcept;
126 
134  void setEmptyTextElementsIgnored (bool shouldBeIgnored) noexcept;
135 
136  //==============================================================================
141  static XmlElement* parse (const File& file);
142 
147  static XmlElement* parse (const String& xmlData);
148 
149 
150  //==============================================================================
151 private:
152  String originalText;
153  String::CharPointerType input;
154  bool outOfData, errorOccurred;
155 
156  String lastError, dtdText;
157  StringArray tokenisedDTD;
158  bool needToLoadDTD, ignoreEmptyTextElements;
159  ScopedPointer<InputSource> inputSource;
160 
161  XmlElement* parseDocumentElement (String::CharPointerType, bool outer);
162  void setLastError (const String&, bool carryOn);
163  bool parseHeader();
164  bool parseDTD();
165  void skipNextWhiteSpace();
166  juce_wchar readNextChar() noexcept;
167  XmlElement* readNextElement (bool alsoParseSubElements);
168  void readChildElements (XmlElement&);
169  void readQuotedString (String&);
170  void readEntity (String&);
171 
172  String getFileContents (const String&) const;
173  String expandEntity (const String&);
174  String expandExternalEntity (const String&);
175  String getParameterEntity (const String&);
176 
178 };
179 
180 
181 #endif // JUCE_XMLDOCUMENT_H_INCLUDED
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_XmlElement.h:142
Definition: juce_XmlDocument.h:69
Definition: juce_StringArray.h:39
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_File.h:45
wchar_t juce_wchar
Definition: juce_CharacterFunctions.h:49
Definition: juce_InputSource.h:42