zorba::XmlDataManager Class Reference

Using the XmlDataManager one can manage documents and collections. More...

#include <zorba/xmldatamanager.h>

List of all members.

Public Member Functions

virtual Collection_t createCollection (const String &aURI)=0
 Create a collection.
virtual bool deleteCollection (const String &aURI)=0
 Delete a collection, if the colection has been created before.
virtual bool deleteDocument (const String &aURI)=0
 Delete the document identified by the given URI.
virtual Collection_t getCollection (const String &aURI)=0
 Get a collection.
virtual Item getDocument (const String &aURI)=0
 Get the document identified by the given URI.
virtual Item loadDocument (const String &aLocalFile)=0
 Load a document from a file.
virtual Item loadDocument (const String &aURI, std::istream &aStream)=0
 Load a document from an input stream.
void registerErrorHandler (ErrorHandler *aErrorHandler)
 Register an ErrorHandler to which errors occuring during the management of documents and collections are reported.

Protected Member Functions

virtual ~XmlDataManager ()
 Destructor.


Detailed Description

Using the XmlDataManager one can manage documents and collections.

The XmlDataManager is a singelton instance. The Zorba object is reponsible for maintaining it's lifetime. The instance can be accessed by calling getXmlDataManager() on the Zorba object. It may not be accessed anymore after Zorba::shutdown() has been called.

XmlDataManager is a thread-safe class.

Examples:

datamanager.cpp.

Definition at line 34 of file xmldatamanager.h.


Constructor & Destructor Documentation

virtual zorba::XmlDataManager::~XmlDataManager (  )  [inline, protected, virtual]

Destructor.

Definition at line 129 of file xmldatamanager.h.


Member Function Documentation

virtual Collection_t zorba::XmlDataManager::createCollection ( const String aURI  )  [pure virtual]

Create a collection.

Parameters:
aURI the URI of the collection to create.
Returns:
Collection_t the collection that was created.
Exceptions:
ZorbaException if an error occurs.
Examples:
datamanager.cpp.

virtual bool zorba::XmlDataManager::deleteCollection ( const String aURI  )  [pure virtual]

Delete a collection, if the colection has been created before.

Parameters:
aURI the URI of the collection to delete.
Returns:
true if the collection was found, false otherwise.
Exceptions:
ZorbaException if an error occurs.

virtual bool zorba::XmlDataManager::deleteDocument ( const String aURI  )  [pure virtual]

Delete the document identified by the given URI.

Parameters:
aURI the URI of the document to delete.
Returns:
true if the document was found, false otherwise.
Exceptions:
ZorbaException if an error occurs.

virtual Collection_t zorba::XmlDataManager::getCollection ( const String aURI  )  [pure virtual]

Get a collection.

Parameters:
aURI the URI of the collection to get.
Returns:
Collection_t the collection identified by the given URI (NULL if the collection was not found).
Exceptions:
ZorbaException if an error occurs.
Examples:
datamanager.cpp.

virtual Item zorba::XmlDataManager::getDocument ( const String aURI  )  [pure virtual]

Get the document identified by the given URI.

Parameters:
aURI the URI of the document to get.
Returns:
Item the document as an Item (NULL if the document was not found).
Exceptions:
ZorbaException if an error occurs.

virtual Item zorba::XmlDataManager::loadDocument ( const String aLocalFile  )  [pure virtual]

Load a document from a file.

This function loads a document from a file. The file name is used as the URI of the document.

Parameters:
aLocalFile the filename of the document as String.
Returns:
Item the document as an Item.
Exceptions:
ZorbaException if an error occurs.

virtual Item zorba::XmlDataManager::loadDocument ( const String aURI,
std::istream &  aStream 
) [pure virtual]

Load a document from an input stream.

This function loads a document from an input stream. The document is identified by the given URI.

Parameters:
aURI the URI of the document as String.
aStream the document given in an input stream.
Returns:
Item the document as an Item.
Exceptions:
ZorbaException if an error occurs.
Examples:
datamanager.cpp.

void zorba::XmlDataManager::registerErrorHandler ( ErrorHandler aErrorHandler  ) 

Register an ErrorHandler to which errors occuring during the management of documents and collections are reported.

If no ErrorHandler has been set using this function then subclasses of the ZorbaException class are thrown to report errors.

Parameters:
aErrorHandler ErrorHandler to which errors are reported. The caller retains ownership over the ErrorHandler passed as parameter.


The documentation for this class was generated from the following file: