ALBA
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
albaXMLStorage Class Reference

#include <albaXMLStorage.h>

Inheritance diagram for albaXMLStorage:
Inheritance graph
[legend]
Collaboration diagram for albaXMLStorage:
Collaboration graph
[legend]

Public Types

enum  XML_IO_ERRORS {
  IO_XML_PARSE_ERROR =IO_LAST_ERROR , IO_DOM_XML_ERROR , IO_RESTORE_ERROR , IO_WRONG_FILE_TYPE ,
  IO_WRONG_FILE_VERSION , IO_WRONG_URL , IO_XML_PARSER_INTERNAL_ERROR
}
 
- Public Types inherited from albaStorage
enum  STORAGE_IO_ERRORS { IO_OK =0 , IO_GENERIC_ERROR , IO_WRONG_OBJECT_TYPE , IO_LAST_ERROR }
 

Public Member Functions

 albaTypeMacro (albaXMLStorage, albaStorage)
 
 albaXMLStorage ()
 
virtual ~albaXMLStorage ()
 
mmuXMLDOMGetXMLDOM ()
 
void SetFileType (const char *filetype)
 
const char * GetFileType ()
 
void SetVersion (const char *version)
 
const char * GetVersion ()
 
const char * GetDocumentVersion ()
 
virtual int ResolveInputURL (const char *url, albaString &filename, albaObserver *observer=NULL)
 
virtual int StoreToURL (const char *filename, const char *url)
 
virtual int ReleaseURL (const char *url)
 
virtual int DeleteURL (const char *url)
 
virtual int OpenDirectory (const char *pathname)
 
virtual void SetURL (const char *name)
 
virtual const char * GetTmpFolder ()
 
virtual void EmptyGarbageCollector ()
 
- Public Member Functions inherited from albaStorage
 albaAbstractTypeMacro (albaStorage, albaObject)
 
 albaStorage ()
 
virtual ~albaStorage ()
 
virtual void SetURL (const char *name)
 
void ForceParserURL ()
 
const char * GetURL ()
 
const char * GetPareserURL ()
 
int Store ()
 
int Restore ()
 
void SetDocument (albaStorable *doc)
 
albaStorableGetDocument ()
 
virtual int ResolveInputURL (const char *url, albaString &filename, albaObserver *observer=NULL)=0
 
virtual int StoreToURL (const char *filename, const char *url=NULL)=0
 
virtual int ReleaseURL (const char *url)=0
 
virtual void GetTmpFile (albaString &filename)
 
void ReleaseTmpFile (const char *filename)
 
bool IsFileInDirectory (const char *filename)
 
virtual void SetTmpFolder (const char *folder)
 
virtual const char * GetTmpFolder ()
 
void SetErrorCode (int err)
 
int GetErrorCode ()
 
bool NeedsUpgrade ()
 
- Public Member Functions inherited from albaObject
 albaObject ()
 
virtual ~albaObject ()
 
virtual void Delete ()
 
virtual const char * GetTypeName () const
 
virtual bool IsA (const char *type_name) const
 
virtual bool IsA (const albaTypeID &type_id) const
 
virtual albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 

Protected Member Functions

virtual int InternalStore ()
 
virtual int InternalRestore ()
 
virtual int InternalStore ()=0
 
virtual int InternalRestore ()=0
 
virtual int OpenDirectory (const char *dir_name)=0
 

Protected Attributes

albaString m_FileType
 
albaString m_Version
 
albaString m_DocumentVersion
 
mmuXMLDOMm_DOM
 
std::set< albaStringm_GarbageCollector
 
albaString m_DefaultTmpFolder
 
- Protected Attributes inherited from albaStorage
bool m_NeedsUpgrade
 
albaStorablem_Document
 
albaStorageElementm_DocumentElement
 
albaString m_URL
 
albaString m_ParserURL
 
albaID m_TmpFileId
 
albaString m_TmpFolder
 
std::set< albaStringm_TmpFileNames
 
std::set< albaStringm_FilesDictionary
 
int m_ErrorCode
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 

Additional Inherited Members

- Static Public Member Functions inherited from albaObject
static const char * GetStaticTypeName ()
 
static bool IsStaticType (const char *type_name)
 
static bool IsStaticType (const albaTypeID &type_id)
 
static const albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 

Detailed Description

Concrete implementation of Storage object using Xerces-C for storing in XML.

This is a concrete implementation of storage object for storing XML documents by means of Xerces-C library (http://xml.apache.org/xerces-c/). This class also defines a function to access to XML/Xerces-C specific objects, stored into a PIMPL class (mmuXMLDOM).

See also
albaStorage albaXMLElement mmuXMLDOM
Todo:
  • remove "IncludeWX.h" inclusion from .cpp
  • add support for NULL destination URL

Definition at line 38 of file albaXMLStorage.h.

Member Enumeration Documentation

◆ XML_IO_ERRORS

Enumerator
IO_XML_PARSE_ERROR 
IO_DOM_XML_ERROR 
IO_RESTORE_ERROR 
IO_WRONG_FILE_TYPE 
IO_WRONG_FILE_VERSION 
IO_WRONG_URL 
IO_XML_PARSER_INTERNAL_ERROR 

Definition at line 43 of file albaXMLStorage.h.

Constructor & Destructor Documentation

◆ albaXMLStorage()

albaXMLStorage::albaXMLStorage ( )

◆ ~albaXMLStorage()

virtual albaXMLStorage::~albaXMLStorage ( )
virtual

Member Function Documentation

◆ albaTypeMacro()

albaXMLStorage::albaTypeMacro ( albaXMLStorage  ,
albaStorage   
)

◆ GetXMLDOM()

mmuXMLDOM * albaXMLStorage::GetXMLDOM ( )
inline

Return the instance of the DOM document used while reading and writing.

This object is created when Store/Restore starts and destroyed when stops.

Definition at line 51 of file albaXMLStorage.h.

◆ SetFileType()

void albaXMLStorage::SetFileType ( const char *  filetype)

The TAG identifying the type (i.e.

format) of file. (e.g. "MSF")

◆ GetFileType()

const char * albaXMLStorage::GetFileType ( )

The TAG identifying the type (i.e.

format) of file. (e.g. "MSF")

◆ SetVersion()

void albaXMLStorage::SetVersion ( const char *  version)

The version of the file format used type of file.

(default "1.1")

◆ GetVersion()

const char * albaXMLStorage::GetVersion ( )

The version of the file format used type of file.

(default "1.1")

◆ GetDocumentVersion()

const char * albaXMLStorage::GetDocumentVersion ( )

Return the version of the opened document.

◆ ResolveInputURL()

virtual int albaXMLStorage::ResolveInputURL ( const char *  url,
albaString filename,
albaObserver observer = NULL 
)
virtual

resolve an URL and provide local filename to be used as input

Implements albaStorage.

◆ StoreToURL()

virtual int albaXMLStorage::StoreToURL ( const char *  filename,
const char *  url 
)
virtual

resolve an URL and provide a local filename to be used as output

Implements albaStorage.

◆ ReleaseURL()

virtual int albaXMLStorage::ReleaseURL ( const char *  url)
virtual

release file from storage.

Actually do not delete, just collect.

Implements albaStorage.

◆ DeleteURL()

virtual int albaXMLStorage::DeleteURL ( const char *  url)
virtual

remove the file from URL

◆ OpenDirectory()

virtual int albaXMLStorage::OpenDirectory ( const char *  pathname)
virtual

populate the list of file in the directory

Implements albaStorage.

◆ SetURL()

virtual void albaXMLStorage::SetURL ( const char *  name)
virtual

Set the URL of the document to be read or written.

Reimplemented from albaStorage.

Reimplemented in albaVMEStorage.

◆ GetTmpFolder()

virtual const char * albaXMLStorage::GetTmpFolder ( )
virtual

return the folder where tmp files are stored

Reimplemented from albaStorage.

◆ EmptyGarbageCollector()

virtual void albaXMLStorage::EmptyGarbageCollector ( )
virtual

empty the garbage collector list deleting old files

◆ InternalStore()

virtual int albaXMLStorage::InternalStore ( )
protectedvirtual

This is called by Store() and must be reimplemented by subclasses.

Implements albaStorage.

◆ InternalRestore()

virtual int albaXMLStorage::InternalRestore ( )
protectedvirtual

This is called by Restore() and must be reimplemented by subclasses.

Implements albaStorage.

Member Data Documentation

◆ m_FileType

albaString albaXMLStorage::m_FileType
protected

The type of file to be opened.

Definition at line 97 of file albaXMLStorage.h.

◆ m_Version

albaString albaXMLStorage::m_Version
protected

Current MSF version.

Definition at line 98 of file albaXMLStorage.h.

◆ m_DocumentVersion

albaString albaXMLStorage::m_DocumentVersion
protected

Open Document version.

Definition at line 99 of file albaXMLStorage.h.

◆ m_DOM

mmuXMLDOM* albaXMLStorage::m_DOM
protected

PIMPL object storing XML objects' pointers.

Definition at line 100 of file albaXMLStorage.h.

◆ m_GarbageCollector

std::set<albaString> albaXMLStorage::m_GarbageCollector
protected

collect URL to be released

Definition at line 101 of file albaXMLStorage.h.

◆ m_DefaultTmpFolder

albaString albaXMLStorage::m_DefaultTmpFolder
protected

used to store the current default tmp folder

Definition at line 102 of file albaXMLStorage.h.


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