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

Returns the immediate child collections of parentCollection.

Definition at line 275 of file xmldocument.cpp.

◆ collectionByRemoteId()

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

Returns the collection with the given remote id.

Definition at line 254 of file xmldocument.cpp.

◆ collectionElement()

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

Returns the DOM element representing collection.

Definition at line 216 of file xmldocument.cpp.

◆ collectionElementByRemoteId()

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

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

Definition at line 249 of file xmldocument.cpp.

◆ collections()

Collection::List XmlDocument::collections ( ) const

Returns the collections defined in this document.

Definition at line 265 of file xmldocument.cpp.

◆ document()

QDomDocument & XmlDocument::document ( ) const

Returns the DOM document for this XML document.

Definition at line 211 of file xmldocument.cpp.

◆ isValid()

bool XmlDocument::isValid ( ) const

Returns true if the document could be parsed successfully.

See also
lastError()

Definition at line 201 of file xmldocument.cpp.

◆ itemByRemoteId()

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

Returns the item with the given remote id.

Definition at line 260 of file xmldocument.cpp.

◆ itemElementByRemoteId()

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

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

Definition at line 244 of file xmldocument.cpp.

◆ items()

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

Returns the items in the given collection.

Definition at line 299 of file xmldocument.cpp.

◆ lastError()

QString XmlDocument::lastError ( ) const

Returns the last error occurred during file loading/parsing.

Empty if isValid() returns true.

See also
isValid()

Definition at line 206 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

Returns the tags defined in this document.

Definition at line 270 of file xmldocument.cpp.

◆ writeToFile()

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

Writes the current document into the given file.

Definition at line 187 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 Tue Mar 26 2024 11:13:39 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.