LibreOffice Module xmlreader (master) 1
|
#include <xmlreader.hxx>
Classes | |
struct | AttributeData |
struct | ElementData |
struct | NamespaceData |
Public Types | |
enum | { NAMESPACE_NONE = -2 , NAMESPACE_UNKNOWN = -1 , NAMESPACE_XML = 0 } |
enum class | Text { NONE , Raw , Normalized } |
enum class | Result { Begin , End , Text , Done } |
Public Member Functions | |
XmlReader (OUString fileUrl) | |
~XmlReader () | |
int | registerNamespaceIri (Span const &iri) |
Result | nextItem (Text reportText, Span *data, int *nsId) |
bool | nextAttribute (int *nsId, Span *localName) |
Span | getAttributeValue (bool fullyNormalize) |
int | getNamespaceId (Span const &prefix) const |
const OUString & | getUrl () const |
Private Types | |
enum class | State { Content , StartTag , EndTag , EmptyElementTag , Done } |
typedef std::vector< Span > | NamespaceIris |
typedef std::vector< NamespaceData > | NamespaceList |
typedef std::stack< ElementData > | ElementStack |
typedef std::vector< AttributeData > | Attributes |
Private Member Functions | |
XmlReader (const XmlReader &)=delete | |
XmlReader & | operator= (const XmlReader &)=delete |
SAL_DLLPRIVATE char | read () |
SAL_DLLPRIVATE char | peek () const |
SAL_DLLPRIVATE void | normalizeLineEnds (Span const &text) |
SAL_DLLPRIVATE void | skipSpace () |
SAL_DLLPRIVATE bool | skipComment () |
SAL_DLLPRIVATE void | skipProcessingInstruction () |
SAL_DLLPRIVATE void | skipDocumentTypeDeclaration () |
SAL_DLLPRIVATE Span | scanCdataSection () |
SAL_DLLPRIVATE bool | scanName (char const **nameColon) |
SAL_DLLPRIVATE int | scanNamespaceIri (char const *begin, char const *end) |
SAL_DLLPRIVATE char const * | handleReference (char const *position, char const *end) |
SAL_DLLPRIVATE Span | handleAttributeValue (char const *begin, char const *end, bool fullyNormalize) |
SAL_DLLPRIVATE Result | handleStartTag (int *nsId, Span *localName) |
SAL_DLLPRIVATE Result | handleEndTag () |
SAL_DLLPRIVATE void | handleElementEnd () |
SAL_DLLPRIVATE Result | handleSkippedText (Span *data, int *nsId) |
SAL_DLLPRIVATE Result | handleRawText (Span *text) |
SAL_DLLPRIVATE Result | handleNormalizedText (Span *text) |
Static Private Member Functions | |
static SAL_DLLPRIVATE int | toNamespaceId (NamespaceIris::size_type pos) |
Private Attributes | |
OUString const | fileUrl_ |
oslFileHandle | fileHandle_ |
sal_uInt64 | fileSize_ |
void * | fileAddress_ |
NamespaceIris | namespaceIris_ |
NamespaceList | namespaces_ |
ElementStack | elements_ |
char const * | pos_ |
char const * | end_ |
State | state_ |
Attributes | attributes_ |
Attributes::iterator | currentAttribute_ |
bool | firstAttribute_ |
Pad | pad_ |
Definition at line 36 of file xmlreader.hxx.
|
private |
Definition at line 123 of file xmlreader.hxx.
|
private |
Definition at line 104 of file xmlreader.hxx.
|
private |
Definition at line 69 of file xmlreader.hxx.
|
private |
Definition at line 88 of file xmlreader.hxx.
anonymous enum |
Enumerator | |
---|---|
NAMESPACE_NONE | |
NAMESPACE_UNKNOWN | |
NAMESPACE_XML |
Definition at line 42 of file xmlreader.hxx.
|
strong |
Enumerator | |
---|---|
Begin | |
End | |
Text | |
Done |
Definition at line 46 of file xmlreader.hxx.
|
strongprivate |
Enumerator | |
---|---|
Content | |
StartTag | |
EndTag | |
EmptyElementTag | |
Done |
Definition at line 125 of file xmlreader.hxx.
|
strong |
Enumerator | |
---|---|
NONE | |
Raw | |
Normalized |
Definition at line 44 of file xmlreader.hxx.
|
explicit |
Definition at line 56 of file xmlreader.cxx.
References Content, end_, fileAddress_, fileHandle_, fileSize_, fileUrl_, firstAttribute_, NAMESPACE_XML, namespaceIris_, namespaces_, pos_, SAL_WARN, and state_.
xmlreader::XmlReader::~XmlReader | ( | ) |
Definition at line 96 of file xmlreader.cxx.
References fileAddress_, fileHandle_, fileSize_, fileUrl_, and SAL_WARN.
|
privatedelete |
Span xmlreader::XmlReader::getAttributeValue | ( | bool | fullyNormalize | ) |
Definition at line 179 of file xmlreader.cxx.
References currentAttribute_, and handleAttributeValue().
Definition at line 185 of file xmlreader.cxx.
References i, NAMESPACE_UNKNOWN, namespaces_, and prefix.
Referenced by handleStartTag(), and nextAttribute().
|
inline |
Definition at line 63 of file xmlreader.hxx.
|
private |
Definition at line 490 of file xmlreader.cxx.
References xmlreader::Pad::add(), begin, xmlreader::Pad::clear(), end, xmlreader::Pad::get(), handleReference(), p, pad_, peek(), and Space.
Referenced by getAttributeValue(), and scanNamespaceIri().
|
private |
Definition at line 708 of file xmlreader.cxx.
References Content, Done, elements_, end, namespaces_, and state_.
Referenced by handleEndTag(), and nextItem().
|
private |
Definition at line 685 of file xmlreader.cxx.
References elements_, End, fileUrl_, handleElementEnd(), peek(), pos_, scanName(), and skipSpace().
Referenced by handleSkippedText(), and nextItem().
|
private |
Definition at line 803 of file xmlreader.cxx.
References xmlreader::Pad::add(), xmlreader::Pad::clear(), end_, EndTag, fileUrl_, xmlreader::Pad::get(), handleReference(), xmlreader::Span::is(), normalizeLineEnds(), pad_, peek(), pos_, scanCdataSection(), skipComment(), skipDocumentTypeDeclaration(), skipProcessingInstruction(), Space, StartTag, state_, text(), and Text.
Referenced by nextItem().
|
private |
Definition at line 744 of file xmlreader.cxx.
References xmlreader::Pad::add(), begin, xmlreader::Pad::clear(), end_, EndTag, fileUrl_, xmlreader::Pad::get(), handleReference(), xmlreader::Span::is(), normalizeLineEnds(), pad_, peek(), pos_, scanCdataSection(), skipComment(), skipDocumentTypeDeclaration(), skipProcessingInstruction(), StartTag, state_, text(), and Text.
Referenced by nextItem().
|
private |
Definition at line 380 of file xmlreader.cxx.
References xmlreader::Pad::add(), xmlreader::Pad::addEphemeral(), end, fileUrl_, p, pad_, and position().
Referenced by handleAttributeValue(), handleNormalizedText(), and handleRawText().
|
private |
Definition at line 716 of file xmlreader.cxx.
References end_, fileUrl_, handleEndTag(), handleStartTag(), i, peek(), pos_, scanCdataSection(), skipComment(), skipDocumentTypeDeclaration(), and skipProcessingInstruction().
Referenced by nextItem().
|
private |
Definition at line 589 of file xmlreader.cxx.
References attributes_, Begin, Content, elements_, EmptyElementTag, end_, fileUrl_, firstAttribute_, getNamespaceId(), i, NAMESPACE_NONE, namespaces_, p, peek(), pos_, read(), scanName(), scanNamespaceIri(), skipSpace(), and state_.
Referenced by handleSkippedText(), and nextItem().
Definition at line 151 of file xmlreader.cxx.
References attributes_, currentAttribute_, firstAttribute_, getNamespaceId(), and NAMESPACE_NONE.
XmlReader::Result xmlreader::XmlReader::nextItem | ( | Text | reportText, |
Span * | data, | ||
int * | nsId | ||
) |
Definition at line 127 of file xmlreader.cxx.
References Content, Done, EmptyElementTag, End, EndTag, handleElementEnd(), handleEndTag(), handleNormalizedText(), handleRawText(), handleSkippedText(), handleStartTag(), NONE, Raw, StartTag, and state_.
|
private |
Definition at line 196 of file xmlreader.cxx.
References xmlreader::Pad::add(), i, n, p, pad_, and text().
Referenced by handleNormalizedText(), and handleRawText().
|
inlineprivate |
Definition at line 129 of file xmlreader.hxx.
Referenced by handleAttributeValue(), handleEndTag(), handleNormalizedText(), handleRawText(), handleSkippedText(), handleStartTag(), scanName(), and skipSpace().
|
inlineprivate |
Definition at line 127 of file xmlreader.hxx.
Referenced by handleStartTag(), skipComment(), and skipDocumentTypeDeclaration().
Definition at line 113 of file xmlreader.cxx.
References namespaceIris_, namespaces_, and toNamespaceId().
|
private |
Definition at line 327 of file xmlreader.cxx.
References begin, end_, fileUrl_, i, and pos_.
Referenced by handleNormalizedText(), handleRawText(), and handleSkippedText().
|
private |
Definition at line 347 of file xmlreader.cxx.
References begin, peek(), and pos_.
Referenced by handleEndTag(), and handleStartTag().
|
private |
Definition at line 369 of file xmlreader.cxx.
References begin, end, handleAttributeValue(), i, NAMESPACE_UNKNOWN, namespaceIris_, and toNamespaceId().
Referenced by handleStartTag().
|
private |
Definition at line 220 of file xmlreader.cxx.
References end_, fileUrl_, i, pos_, and read().
Referenced by handleNormalizedText(), handleRawText(), handleSkippedText(), and skipDocumentTypeDeclaration().
|
private |
Definition at line 253 of file xmlreader.cxx.
References end_, fileUrl_, i, pos_, read(), skipComment(), skipProcessingInstruction(), and skipSpace().
Referenced by handleNormalizedText(), handleRawText(), and handleSkippedText().
|
private |
Definition at line 243 of file xmlreader.cxx.
References end_, fileUrl_, i, and pos_.
Referenced by handleNormalizedText(), handleRawText(), handleSkippedText(), and skipDocumentTypeDeclaration().
|
private |
Definition at line 214 of file xmlreader.cxx.
Referenced by handleEndTag(), handleStartTag(), and skipDocumentTypeDeclaration().
|
staticprivate |
Definition at line 935 of file xmlreader.cxx.
References pos.
Referenced by registerNamespaceIri(), and scanNamespaceIri().
|
private |
Definition at line 178 of file xmlreader.hxx.
Referenced by handleStartTag(), and nextAttribute().
|
private |
Definition at line 179 of file xmlreader.hxx.
Referenced by getAttributeValue(), and nextAttribute().
|
private |
Definition at line 174 of file xmlreader.hxx.
Referenced by handleElementEnd(), handleEndTag(), and handleStartTag().
|
private |
Definition at line 176 of file xmlreader.hxx.
Referenced by handleNormalizedText(), handleRawText(), handleSkippedText(), handleStartTag(), scanCdataSection(), skipComment(), skipDocumentTypeDeclaration(), skipProcessingInstruction(), and XmlReader().
|
private |
Definition at line 171 of file xmlreader.hxx.
Referenced by XmlReader(), and ~XmlReader().
|
private |
Definition at line 169 of file xmlreader.hxx.
Referenced by XmlReader(), and ~XmlReader().
|
private |
Definition at line 170 of file xmlreader.hxx.
Referenced by XmlReader(), and ~XmlReader().
|
private |
Definition at line 168 of file xmlreader.hxx.
Referenced by handleEndTag(), handleNormalizedText(), handleRawText(), handleReference(), handleSkippedText(), handleStartTag(), scanCdataSection(), skipComment(), skipDocumentTypeDeclaration(), skipProcessingInstruction(), XmlReader(), and ~XmlReader().
|
private |
Definition at line 180 of file xmlreader.hxx.
Referenced by handleStartTag(), nextAttribute(), and XmlReader().
|
private |
Definition at line 172 of file xmlreader.hxx.
Referenced by registerNamespaceIri(), scanNamespaceIri(), and XmlReader().
|
private |
Definition at line 173 of file xmlreader.hxx.
Referenced by getNamespaceId(), handleElementEnd(), handleStartTag(), registerNamespaceIri(), and XmlReader().
|
private |
Definition at line 181 of file xmlreader.hxx.
Referenced by handleAttributeValue(), handleNormalizedText(), handleRawText(), handleReference(), and normalizeLineEnds().
|
private |
Definition at line 175 of file xmlreader.hxx.
Referenced by handleEndTag(), handleNormalizedText(), handleRawText(), handleSkippedText(), handleStartTag(), scanCdataSection(), scanName(), skipComment(), skipDocumentTypeDeclaration(), skipProcessingInstruction(), skipSpace(), and XmlReader().
|
private |
Definition at line 177 of file xmlreader.hxx.
Referenced by handleElementEnd(), handleNormalizedText(), handleRawText(), handleStartTag(), nextItem(), and XmlReader().