Akonadi::XmlDocument

Akonadi::XmlDocument Class Reference

#include <xmldocument.h>

Public Member Functions

 XmlDocument ()
 
 XmlDocument (const QString &fileName)
 
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)
 
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 25 of file xmldocument.h.

Constructor & Destructor Documentation

XmlDocument::XmlDocument ( )

Creates an empty document.

Definition at line 97 of file xmldocument.cpp.

XmlDocument::XmlDocument ( const QString fileName)
explicit

Creates a new XmlDocument object and calls loadFile().

See also
loadFile()

Definition at line 104 of file xmldocument.cpp.

Member Function Documentation

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

Returns the immediate child collections of parentCollection.

Definition at line 274 of file xmldocument.cpp.

Collection XmlDocument::collectionByRemoteId ( const QString rid) const

Returns the collection with the given remote id.

Definition at line 253 of file xmldocument.cpp.

QDomElement XmlDocument::collectionElement ( const Collection collection) const

Returns the DOM element representing collection.

Definition at line 215 of file xmldocument.cpp.

QDomElement XmlDocument::collectionElementByRemoteId ( const QString rid) const

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

Definition at line 248 of file xmldocument.cpp.

Collection::List XmlDocument::collections ( ) const

Returns the collections defined in this document.

Definition at line 264 of file xmldocument.cpp.

QDomDocument & XmlDocument::document ( ) const

Returns the DOM document for this XML document.

Definition at line 210 of file xmldocument.cpp.

bool XmlDocument::isValid ( ) const

Returns true if the document could be parsed successfully.

See also
lastError()

Definition at line 200 of file xmldocument.cpp.

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

Returns the item with the given remote id.

Definition at line 259 of file xmldocument.cpp.

QDomElement XmlDocument::itemElementByRemoteId ( const QString rid) const

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

Definition at line 243 of file xmldocument.cpp.

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

Returns the items in the given collection.

Definition at line 298 of file xmldocument.cpp.

QString XmlDocument::lastError ( ) const

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.

bool Akonadi::XmlDocument::loadFile ( const QString fileName)

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.

Tag::List XmlDocument::tags ( ) const

Returns the tags defined in this document.

Definition at line 269 of file xmldocument.cpp.

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-2020 The KDE developers.
Generated on Mon Jul 6 2020 23:15:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.