Akonadi::XmlDocument

Search for usage in LXR

Akonadi::XmlDocument Class Reference

#include <xmldocument.h>

Public Member Functions

 XmlDocument ()
 
 XmlDocument (const QString &fileName, const QString &xsdFile={})
 
Collection::List childCollections (const Collection &parentCollection) const
 
Collection collectionByRemoteId (const QString &rid) const
 
QDomElement collectionElement (const Collection &collection) const
 
QDomElement collectionElementByRemoteId (const QString &rid) const
 
Collection::List collections () const
 
QDomDocumentdocument () const
 
bool isValid () const
 
Item itemByRemoteId (const QString &rid, bool includePayload=true) const
 
QDomElement itemElementByRemoteId (const QString &rid) const
 
Item::List items (const Collection &collection, bool includePayload=true) const
 
QString lastError () const
 
bool loadFile (const QString &fileName, const QString &xsdFile={})
 
Tag::List tags () const
 
bool writeToFile (const QString &fileName) const
 

Detailed Description

Represents a document of the KNUT XML serialization format for Akonadi objects.

Definition at line 26 of file xmldocument.h.

Constructor & Destructor Documentation

◆ XmlDocument() [1/2]

XmlDocument::XmlDocument ( )

Creates an empty document.

Definition at line 100 of file xmldocument.cpp.

◆ XmlDocument() [2/2]

XmlDocument::XmlDocument ( const QString & fileName,
const QString & xsdFile = {} )
explicit

Creates a new XmlDocument object and calls loadFile().

See also
loadFile()

Definition at line 107 of file xmldocument.cpp.

Member Function Documentation

◆ childCollections()

Collection::List XmlDocument::childCollections ( const Collection & parentCollection) const
nodiscard

Returns the immediate child collections of parentCollection.

Definition at line 274 of file xmldocument.cpp.

◆ collectionByRemoteId()

Collection XmlDocument::collectionByRemoteId ( const QString & rid) const
nodiscard

Returns the collection with the given remote id.

Definition at line 253 of file xmldocument.cpp.

◆ collectionElement()

QDomElement XmlDocument::collectionElement ( const Collection & collection) const
nodiscard

Returns the DOM element representing collection.

Definition at line 215 of file xmldocument.cpp.

◆ collectionElementByRemoteId()

QDomElement XmlDocument::collectionElementByRemoteId ( const QString & rid) const
nodiscard

Returns the DOM element representing the collection with the given remote id.

Definition at line 248 of file xmldocument.cpp.

◆ collections()

Collection::List XmlDocument::collections ( ) const
nodiscard

Returns the collections defined in this document.

Definition at line 264 of file xmldocument.cpp.

◆ document()

QDomDocument & XmlDocument::document ( ) const

Returns the DOM document for this XML document.

Definition at line 210 of file xmldocument.cpp.

◆ isValid()

bool XmlDocument::isValid ( ) const
nodiscard

Returns true if the document could be parsed successfully.

See also
lastError()

Definition at line 200 of file xmldocument.cpp.

◆ itemByRemoteId()

Item XmlDocument::itemByRemoteId ( const QString & rid,
bool includePayload = true ) const
nodiscard

Returns the item with the given remote id.

Definition at line 259 of file xmldocument.cpp.

◆ itemElementByRemoteId()

QDomElement XmlDocument::itemElementByRemoteId ( const QString & rid) const
nodiscard

Returns the DOM element representing the item with the given remote id.

Definition at line 243 of file xmldocument.cpp.

◆ items()

Item::List XmlDocument::items ( const Collection & collection,
bool includePayload = true ) const
nodiscard

Returns the items in the given collection.

Definition at line 298 of file xmldocument.cpp.

◆ lastError()

QString XmlDocument::lastError ( ) const
nodiscard

Returns the last error occurred during file loading/parsing.

Empty if isValid() returns true.

See also
isValid()

Definition at line 205 of file xmldocument.cpp.

◆ loadFile()

bool Akonadi::XmlDocument::loadFile ( const QString & fileName,
const QString & xsdFile = {} )

Parses the given XML file and validates it.

In case of an error, isValid() will return false and lastError() will return an error message.

See also
isValid(), lastError()

Definition at line 115 of file xmldocument.cpp.

◆ tags()

Tag::List XmlDocument::tags ( ) const
nodiscard

Returns the tags defined in this document.

Definition at line 269 of file xmldocument.cpp.

◆ writeToFile()

bool XmlDocument::writeToFile ( const QString & fileName) const

Writes the current document into the given file.

Definition at line 186 of file xmldocument.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:03:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.