16#ifndef __albaStorage_h__
17#define __albaStorage_h__
58 virtual void SetURL(
const char *name);
92 virtual int StoreToURL(
const char *filename,
const char *url=NULL) = 0;
long albaID
type for IDs inside ALBA
Abstract superclass for all ALBA classes implementing RTTI APIs.
Interface implementing the Observer of the Subject/Observer design pattern.
albaStorable is an interface for serializable objects.
Abstract class representing the interface for the unit of information stored in the storage.
Abstract class for an abject mastering the storing/restoring of objects This is an abstract class pro...
albaStorageElement * m_DocumentElement
document stored element
void ForceParserURL()
Force Copy storage URL to parser URL (used by the ALBA1.x importer)
virtual void GetTmpFile(albaString &filename)
Return a name of file to be used as tmp file during store/restore.
virtual int ReleaseURL(const char *url)=0
Remove a file from the specified URL.
virtual int InternalStore()=0
This is called by Store() and must be reimplemented by subclasses.
albaStorable * GetDocument()
return the document object restored
virtual int StoreToURL(const char *filename, const char *url=NULL)=0
resolve an URL and provide a local filename to be used as output
virtual int OpenDirectory(const char *dir_name)=0
populate the list of files in the storage folder
const char * GetPareserURL()
Return the name of the last read file, this is internally used when writing to a new file to read and...
std::set< albaString > m_FilesDictionary
list of files in the storage folder: to be populated by OpenDirectory()
albaString m_TmpFolder
folder where to store tmp files
const char * GetURL()
Return the URL of the document to be read or written.
albaStorable * m_Document
document object to be stored, or being restored
int Store()
perform storing.
void SetDocument(albaStorable *doc)
set the document element to be stored
virtual int ResolveInputURL(const char *url, albaString &filename, albaObserver *observer=NULL)=0
resolve an URL and provide local filename to be used as input
bool IsFileInDirectory(const char *filename)
Check if a file is present in the storage directory.
albaID m_TmpFileId
counter for unique tmp file naming
std::set< albaString > m_TmpFileNames
name of tmp files in the MSF dir
virtual void SetURL(const char *name)
Set the URL of the document to be read or written.
virtual void SetTmpFolder(const char *folder)
Set the folder where to store tmp files.
int m_ErrorCode
the error code 0==OK
virtual const char * GetTmpFolder()
return the folder where tmp files are stored
albaAbstractTypeMacro(albaStorage, albaObject)
albaString m_URL
name of the file being accessed
void ReleaseTmpFile(const char *filename)
remove the tmp file
albaString m_ParserURL
name of the last parsed file (used for SaveAs)
virtual int InternalRestore()=0
This is called by Restore() and must be reimplemented by subclasses.
bool m_NeedsUpgrade
Flag used to enable or not the upgrade mechanism.
int Restore()
perform restoring.
void SetErrorCode(int err)
albaString - performs common string operations on c-strings.