LMMS
Loading...
Searching...
No Matches
XmlDocument.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the Water library.
5 Copyright (c) 2016 ROLI Ltd.
6 Copyright (C) 2017-2022 Filipe Coelho <falktx@falktx.com>
7
8 Permission is granted to use this software under the terms of the ISC license
9 http://www.isc.org/downloads/software-support-policy/isc-license/
10
11 Permission to use, copy, modify, and/or distribute this software for any
12 purpose with or without fee is hereby granted, provided that the above
13 copyright notice and this permission notice appear in all copies.
14
15 THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
16 TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
18 OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
19 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
21 OF THIS SOFTWARE.
22
23 ==============================================================================
24*/
25
26#ifndef WATER_XMLDOCUMENT_H_INCLUDED
27#define WATER_XMLDOCUMENT_H_INCLUDED
28
29#include "../text/StringArray.h"
30
31#include "CarlaScopeUtils.hpp"
32
33namespace water {
34
35//==============================================================================
72{
73public:
74 //==============================================================================
78 XmlDocument (const String& documentText);
79
83 XmlDocument (const File& file);
84
87
88 //==============================================================================
108 XmlElement* getDocumentElement (bool onlyReadOuterDocumentElement = false);
109
114 const String& getLastParseError() const noexcept;
115
127 void setInputSource (FileInputSource* newSource) noexcept;
128
136 void setEmptyTextElementsIgnored (bool shouldBeIgnored) noexcept;
137
138 //==============================================================================
143 static XmlElement* parse (const File& file);
144
149 static XmlElement* parse (const String& xmlData);
150
151
152 //==============================================================================
153private:
157
161 CarlaScopedPointer<FileInputSource> inputSource;
162
164 void setLastError (const String&, bool carryOn);
165 bool parseHeader();
166 bool parseDTD();
167 void skipNextWhiteSpace();
169 XmlElement* readNextElement (bool alsoParseSubElements);
171 void readQuotedString (String&);
172 void readEntity (String&);
173
178
180};
181
182}
183
184#endif // WATER_XMLDOCUMENT_H_INCLUDED
#define CARLA_DECLARE_NON_COPYABLE(ClassName)
Definition CarlaDefines.h:242
#define noexcept
Definition DistrhoDefines.h:72
Definition CharPointer_UTF8.h:45
Definition File.h:50
Definition FileInputSource.h:40
Definition StringArray.h:41
Definition String.h:48
bool parseDTD()
Definition XmlDocument.cpp:251
CharPointer_UTF8 input
Definition XmlDocument.h:155
XmlElement * readNextElement(bool alsoParseSubElements)
Definition XmlDocument.cpp:377
String dtdText
Definition XmlDocument.h:158
void setLastError(const String &, bool carryOn)
Definition XmlDocument.cpp:153
StringArray tokenisedDTD
Definition XmlDocument.h:159
static XmlElement * parse(const File &file)
Definition XmlDocument.cpp:59
String getFileContents(const String &) const
Definition XmlDocument.cpp:159
void skipNextWhiteSpace()
Definition XmlDocument.cpp:277
bool parseHeader()
Definition XmlDocument.cpp:218
void setInputSource(FileInputSource *newSource) noexcept
Definition XmlDocument.cpp:71
~XmlDocument()
Definition XmlDocument.cpp:55
String getParameterEntity(const String &)
Definition XmlDocument.cpp:865
void readQuotedString(String &)
Definition XmlDocument.cpp:328
const String & getLastParseError() const noexcept
Definition XmlDocument.cpp:148
bool errorOccurred
Definition XmlDocument.h:156
bool ignoreEmptyTextElements
Definition XmlDocument.h:160
void setEmptyTextElementsIgnored(bool shouldBeIgnored) noexcept
Definition XmlDocument.cpp:76
void readEntity(String &)
Definition XmlDocument.cpp:646
String expandExternalEntity(const String &)
Definition XmlDocument.cpp:773
bool outOfData
Definition XmlDocument.h:156
CarlaScopedPointer< FileInputSource > inputSource
Definition XmlDocument.h:161
void readChildElements(XmlElement &)
Definition XmlDocument.cpp:481
water_uchar readNextChar() noexcept
Definition XmlDocument.cpp:172
String originalText
Definition XmlDocument.h:154
String lastError
Definition XmlDocument.h:158
bool needToLoadDTD
Definition XmlDocument.h:160
XmlDocument(const String &documentText)
Definition XmlDocument.cpp:35
XmlElement * parseDocumentElement(CharPointer_UTF8, bool outer)
Definition XmlDocument.cpp:185
XmlElement * getDocumentElement(bool onlyReadOuterDocumentElement=false)
Definition XmlDocument.cpp:120
String expandEntity(const String &)
Definition XmlDocument.cpp:748
Definition XmlElement.h:145
Definition AudioSampleBuffer.h:33
uint32 water_uchar
Definition CharacterFunctions.h:38
struct zdirent * file
Definition win32.c:1500
#define const
Definition zconf.h:137