The Nebula Device 3: IO::IoServer Class Reference

The Nebula Device 3

IO::IoServer Class Reference

#include <ioserver.h>

Inheritance diagram for IO::IoServer:

Core::RefCounted


Detailed Description

The central server object of the IO subsystem offers the following services:

associate stream classes with URI schemes create the right stream object for a given URI transparant ZIP archive support path assign management global filesystem manipulation and query methods

(C) 2006 Radon Labs GmbH

Public Member Functions

 IoServer ()
 constructor
virtual ~IoServer ()
 destructor
void RegisterUriScheme (const Util::String &uriScheme, const Core::Rtti &classRtti)
 associate an uri scheme with a stream class
void UnregisterUriScheme (const Util::String &uriScheme)
 unregister an uri scheme
bool IsUriSchemeRegistered (const Util::String &uriScheme) const
 return true if an uri scheme has been registered
const Core::RttiGetStreamClassByUriScheme (const Util::String &uriScheme) const
 get the registered stream class for an uri scheme
Util::Array
< Util::String
GetAllRegisteredUriSchemes () const
 get an array of all registered schemes
Ptr< StreamCreateStream (const URI &uri) const
 create a stream object for the given uri
bool MountZipArchive (const URI &uri)
 mount a zip file archive
void UnmountZipArchive (const URI &uri)
 unmount a zip file archive
bool IsZipArchiveMounted (const URI &uri) const
 return true if a zip archive is mounted
void SetZipFileSystemEnabled (bool b)
 enable/disable transparent zip filesystem layering (default is yes)
bool IsZipFileSystemEnabled () const
 return true if transparent zip filesystem is enabled
void SetAssign (const Assign &assign)
 define a directory assign
bool HasAssign (const Util::String &assignName) const
 return true if an assign exists
const Util::StringGetAssign (const Util::String &assignName) const
 get an assign
void ClearAssign (const Util::String &assignName)
 clear an assign
Util::Array< AssignGetAllAssigns () const
 return an array of all currently defined assigns
URI ResolveAssigns (const URI &uri) const
 resolve any assigns in an URI
Util::String ResolveAssignsInString (const Util::String &uriString) const
 resolve any assigns in a string (must have URI form)
bool CreateDirectory (const URI &uri) const
 create all missing directories in the path
bool DeleteDirectory (const URI &path) const
 delete an empty directory
bool DirectoryExists (const URI &path) const
 return true if directory exists
bool CopyFile (const URI &from, const URI &to) const
 copy a file
bool DeleteFile (const URI &path) const
 delete a file
bool FileExists (const URI &path) const
 return true if file exists
void SetReadOnly (const URI &path, bool b) const
 set the readonly status of a file
bool IsReadOnly (const URI &path) const
 return read only status of a file
unsigned int ComputeFileCrc (const URI &path) const
 get the CRC checksum of a file
FileTime GetFileWriteTime (const URI &path) const
 return the last write-time of a file
Util::Array
< Util::String
ListFiles (const URI &dir, const Util::String &pattern) const
 list all files matching a pattern in a directory
Util::Array
< Util::String
ListDirectories (const URI &dir, const Util::String &pattern) const
 list all subdirectories matching a pattern in a directory
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

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Member Function Documentation

void IO::IoServer::RegisterUriScheme ( const Util::String uriScheme,
const Core::Rtti classRtti 
)

associate an uri scheme with a stream class

Associates an URI scheme with a stream class. If the same URI scheme is already registered, the old association will be overwritten.

URI IO::IoServer::ResolveAssigns ( const URI uri  )  const

resolve any assigns in an URI

Resolves all assigns from an URI returning an URI. It is allowed to "stack" assigns, which means, defining an assign as pointing to another assign.

String IO::IoServer::ResolveAssignsInString ( const Util::String uriString  )  const

resolve any assigns in a string (must have URI form)

Resolves all assigns from a URI. It is allowed to "stack" assigns, which means, defining an assign as pointing to another assign.

bool IO::IoServer::CreateDirectory ( const URI uri  )  const

create all missing directories in the path

This method creates all missing directories in a path.

bool IO::IoServer::CopyFile ( const URI fromUri,
const URI toUri 
) const

copy a file

This copies a file to another file.

unsigned int IO::IoServer::ComputeFileCrc ( const URI uri  )  const

get the CRC checksum of a file

This method computes the CRC checksum for a file.

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.