Nebula
Loading...
Searching...
No Matches
IO::ArchiveFileSystemBase Class Reference

#include <archivefilesystembase.h>

Inherits Core::RefCounted.

Inherited by IO::ZipFileSystem.

Public Member Functions

 ArchiveFileSystemBase ()
 constructor
 
virtual ~ArchiveFileSystemBase ()
 destructor
 
void Setup ()
 setup the archive file system
 
void Discard ()
 discard the archive file system
 
bool IsValid () const
 return true if archive file system has been setup
 
virtual Ptr< ArchiveMount (const URI &uri)
 mount an archive
 
virtual Ptr< ArchiveMountEmbedded (const URI &uri, const Util::String &rootPath)
 mount an embedded archive
 
virtual void Unmount (const URI &uri)
 unmount an archive by URI
 
virtual void Unmount (const Ptr< Archive > &archive)
 unmount an archive by pointer
 
bool IsMounted (const URI &uri) const
 return true if an archive is mounted
 
bool HasArchives () const
 Any archives mounted?
 
Util::Array< Ptr< Archive > > GetMountedArchives () const
 get an array of all mounted archives
 
Ptr< ArchiveFindArchive (const URI &uri) const
 find a zip archive by its URI, returns invalid ptr if not mounted
 
virtual Ptr< ArchiveFindArchiveWithFile (const URI &fileUri) const
 find first archive which contains the file path
 
virtual Ptr< ArchiveFindArchiveWithDir (const URI &dirUri) const
 find first archive which contains the directory path
 
URI ConvertFileToArchiveURIIfExists (const URI &uri) const
 transparently convert a URI pointing to a file into a matching archive URI
 
URI ConvertDirToArchiveURIIfExists (const URI &uri) const
 transparently convert a URI pointing to a directory into a matching archive URI

 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Protected Attributes

Threading::CriticalSection critSect
 
Util::Dictionary< Util::String, Ptr< Archive > > archives
 
bool isValid
 

Private Member Functions

 __DeclareClass (ArchiveFileSystemBase)
 
 __DeclareInterfaceSingleton (ArchiveFileSystemBase)
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Constructor & Destructor Documentation

◆ ArchiveFileSystemBase()

IO::ArchiveFileSystemBase::ArchiveFileSystemBase ( )

constructor

◆ ~ArchiveFileSystemBase()

IO::ArchiveFileSystemBase::~ArchiveFileSystemBase ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

IO::ArchiveFileSystemBase::__DeclareClass ( ArchiveFileSystemBase )
private

◆ __DeclareInterfaceSingleton()

IO::ArchiveFileSystemBase::__DeclareInterfaceSingleton ( ArchiveFileSystemBase )
private

◆ ConvertDirToArchiveURIIfExists()

URI IO::ArchiveFileSystemBase::ConvertDirToArchiveURIIfExists ( const URI & uri) const

transparently convert a URI pointing to a directory into a matching archive URI

This method is the directory version of ConvertFileToArchiveURIIfExists().

◆ ConvertFileToArchiveURIIfExists()

URI IO::ArchiveFileSystemBase::ConvertFileToArchiveURIIfExists ( const URI & uri) const

transparently convert a URI pointing to a file into a matching archive URI

This method should check if the provided URI is located in any of the mounted archives, and if yes, return a converted the URI which describes how the file in the archive is accessed.

This method must be overriden in a subclass, the base class implementation will always return the original URI!

◆ Discard()

void IO::ArchiveFileSystemBase::Discard ( )

discard the archive file system

Discard the archive file system.

◆ FindArchive()

Ptr< Archive > IO::ArchiveFileSystemBase::FindArchive ( const URI & uri) const

find a zip archive by its URI, returns invalid ptr if not mounted

Resolve an archive path into an Archive pointer.

Returns 0 if no archive with that name exists. The filename will be resolved into an absolute path internally before the lookup happens.

◆ FindArchiveWithDir()

Ptr< Archive > IO::ArchiveFileSystemBase::FindArchiveWithDir ( const URI & uri) const
virtual

find first archive which contains the directory path

This method should return the archive which contains the provided directory URI.

Override this method in a derived class!

Reimplemented in IO::ZipFileSystem.

◆ FindArchiveWithFile()

Ptr< Archive > IO::ArchiveFileSystemBase::FindArchiveWithFile ( const URI & uri) const
virtual

find first archive which contains the file path

This method should return the archive which contains the provided file URI.

Override this method in a derived class!

Reimplemented in IO::ZipFileSystem.

◆ GetMountedArchives()

Array< Ptr< Archive > > IO::ArchiveFileSystemBase::GetMountedArchives ( ) const

get an array of all mounted archives

Return all currently mounted archives.

◆ HasArchives()

bool IO::ArchiveFileSystemBase::HasArchives ( ) const

Any archives mounted?

◆ IsMounted()

bool IO::ArchiveFileSystemBase::IsMounted ( const URI & uri) const

return true if an archive is mounted

◆ IsValid()

bool IO::ArchiveFileSystemBase::IsValid ( ) const
inline

return true if archive file system has been setup

◆ Mount()

Ptr< Archive > IO::ArchiveFileSystemBase::Mount ( const URI & uri)
virtual

mount an archive

This "mounts" an archive file by creating a new Archive object and adding it to the archive dictionary.

If mounting fails, an invalid pointer will be returned!

◆ MountEmbedded()

Ptr< Archive > IO::ArchiveFileSystemBase::MountEmbedded ( const URI & uri,
const Util::String & rootPath )
virtual

mount an embedded archive

This "mounts" an archive file by creating a new Archive object and adding it to the archive dictionary.

If mounting fails, an invalid pointer will be returned!

◆ Setup()

void IO::ArchiveFileSystemBase::Setup ( )

setup the archive file system

Setup the archive file system.

Subclasses may register their archive stream classes with the SchemeRegistry here.

◆ Unmount() [1/2]

void IO::ArchiveFileSystemBase::Unmount ( const Ptr< Archive > & archive)
virtual

unmount an archive by pointer

Unmount a zip archive, this will remove the archive from the internal archive registry, and call the Discard() method on it.

◆ Unmount() [2/2]

void IO::ArchiveFileSystemBase::Unmount ( const URI & uri)
virtual

unmount an archive by URI

Unmount an archive by the archive's URI.

Member Data Documentation

◆ archives

Util::Dictionary<Util::String, Ptr<Archive> > IO::ArchiveFileSystemBase::archives
protected

◆ critSect

Threading::CriticalSection IO::ArchiveFileSystemBase::critSect
protected

◆ isValid

bool IO::ArchiveFileSystemBase::isValid
protected

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