The IPackageFactory interface. More...

#include "murl_resource_i_package_factory.h"

Inheritance diagram for Murl::Resource::IPackageFactory:

Public Member Functions

virtual Bool Init ()=0
 Initialize the factory. More...
 
virtual Bool DeInit ()=0
 Deinitialize the factory. More...
 
virtual IPackageCreatePackageFromFile (const String &id, const String &fileName, IEnums::FileCategory fileCategory, Result &result) const =0
 Create a resource package from a file. More...
 
virtual IPackageCreatePackageFromMemory (const String &id, const String &fileName, IEnums::FileCategory fileCategory, const ConstData &data, Bool &dataCanBeDisposed, Result &result) const =0
 Create a resource package from a block of memory. More...
 
virtual Bool DestroyPackage (IPackage *&package) const =0
 Destroy a previously created package. More...
 
virtual Bool QueryPackageFromFile (const String &fileName, IEnums::FileCategory fileCategory, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0
 Query information about a package file. More...
 
virtual Bool QueryPackageFromFile (const String &fileName, IEnums::FileCategory fileCategory, IEnums::ResourceType *resourceType, IEnums::FileType *fileType, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0
 Query information about a package file. More...
 
virtual Bool QueryPackageFromMemory (const ConstData &data, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0
 Query information about a package in memory. More...
 
virtual Bool QueryPackageFromMemory (const ConstData &data, IEnums::ResourceType *resourceType, IEnums::FileType *fileType, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0
 Query information about a package in memory. More...
 
virtual const IFactoryGetResourceFactory () const =0
 Get the main resource factory. More...
 
- Public Member Functions inherited from Murl::IFactoryObject< IPackageFactory >
 ~IFactoryObject () override
 The destructor.
 
virtual const ClassInfo * GetObjectClassInfo () const=0
 Get the object instance's class info, if present. More...
 
virtual void ResetObjectProperties ()=0
 Reset the object instance's properties to their default values.
 
- Public Member Functions inherited from Murl::Resource::IPackageFactoryRegistry
virtual Bool RegisterPackageClass (const IPackage::ClassInfo &packageClassInfo, const IObjectFactory *objectFactory, const String &fileNamePattern)=0
 Register a package class. More...
 
virtual Bool UnregisterPackageClass (const IPackage::ClassInfo &packageClassInfo, const IObjectFactory *objectFactory, const String &fileNamePattern)=0
 Unregister a previously registered package class/object factory/file name pattern combination. More...
 
virtual SInt32 GetRegisteredPackageClassInfoIndex (const IPackage::ClassInfo &classInfo) const =0
 Query the first index of a registered package class, by its ClassInfo structure. More...
 
virtual SInt32 GetRegisteredPackageClassInfoIndex (const String &className) const =0
 Query the first index of a registered package class, by its class name. More...
 
virtual UInt32 GetNumberOfRegisteredPackageClassInfos () const =0
 Get the total number of registered package classes. More...
 
virtual const IPackage::ClassInfoGetRegisteredPackageClassInfo (UInt32 index) const =0
 Get the ClassInfo structure of a registered package class. More...
 
virtual const StringGetRegisteredPackageClassInfoFileNamePattern (UInt32 index) const =0
 Get the file name pattern of a registered package class. More...
 
virtual const IObjectFactoryGetRegisteredPackageClassInfoObjectFactory (UInt32 index) const =0
 Get the associated object factory of a registered package class. More...
 

Additional Inherited Members

- Public Types inherited from Murl::IFactoryObject< IPackageFactory >
using ClassInfoArray = Array< const ClassInfo * >
 Definition of an array of ClassInfo objects.
 
- Static Public Member Functions inherited from Murl::IFactoryObject< IPackageFactory >
static const PropertyInfoGetPropertyInfo ()
 Get the class' property info struct. More...
 
static const AttributeInfoGetAttributeInfo ()
 Get the class' attribute info struct. More...
 
static void ResetProperties (IFactoryObject< IPackageFactory > *object)
 Reset an object instance's properties to their default values. More...
 

Detailed Description

The IPackageFactory interface.

Member Function Documentation

◆ Init()

virtual Bool Murl::Resource::IPackageFactory::Init ( )
pure virtual

Initialize the factory.

Returns
true if successful.

◆ DeInit()

virtual Bool Murl::Resource::IPackageFactory::DeInit ( )
pure virtual

Deinitialize the factory.

Returns
true if successful.

◆ CreatePackageFromFile()

virtual IPackage* Murl::Resource::IPackageFactory::CreatePackageFromFile ( const String id,
const String fileName,
IEnums::FileCategory  fileCategory,
Result result 
) const
pure virtual

Create a resource package from a file.

Parameters
idThe internal package ID.
fileNameThe name of the package file, relative to the given file category below.
fileCategoryThe file system category where to look for the given file.
resultThe object to receive the result of the operation.
Returns
The newly created package, or null if failed.

◆ CreatePackageFromMemory()

virtual IPackage* Murl::Resource::IPackageFactory::CreatePackageFromMemory ( const String id,
const String fileName,
IEnums::FileCategory  fileCategory,
const ConstData data,
Bool dataCanBeDisposed,
Result result 
) const
pure virtual

Create a resource package from a block of memory.

Parameters
idThe internal package ID.
fileNameThe file name of the package, relative to which any individual file sub-resources/-packages are accessed from the file system.
fileCategoryThe file system category to prepend to the file name.
dataThe binary package data.
dataCanBeDisposedA reference to a Bool variable receiving true whenever it is safe to delete the input data right after package creation. If this value receives false, the input data must be kept until the package is destroyed using DestroyPackage().
resultThe object to receive the result of the operation.
Returns
The newly created package, or null if failed.

◆ DestroyPackage()

virtual Bool Murl::Resource::IPackageFactory::DestroyPackage ( IPackage *&  package) const
pure virtual

Destroy a previously created package.

Parameters
packageA reference to a pointer holding the package to destroy.
Returns
true if successful.

◆ QueryPackageFromFile() [1/2]

virtual Bool Murl::Resource::IPackageFactory::QueryPackageFromFile ( const String fileName,
IEnums::FileCategory  fileCategory,
String id,
UInt32 revision,
Bool isDataValid,
Bool isVersionValid,
Bool isChecksumValid 
) const
pure virtual

Query information about a package file.

Parameters
fileNameThe name of the package file, relative to the given file category below.
fileCategoryThe file system category where to look for the given file.
idAn optional pointer to receive the package ID, if present.
revisionAn optional pointer to receive the user-defined package revision, if present.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn optional pointer to receive the result of the version check.
isChecksumValidAn optional pointer to receive the result of the checksum comparison, if the package does include one.
Returns
true if the package could be loaded in the first place.

◆ QueryPackageFromFile() [2/2]

virtual Bool Murl::Resource::IPackageFactory::QueryPackageFromFile ( const String fileName,
IEnums::FileCategory  fileCategory,
IEnums::ResourceType resourceType,
IEnums::FileType fileType,
String id,
UInt32 revision,
Bool isDataValid,
Bool isVersionValid,
Bool isChecksumValid 
) const
pure virtual

Query information about a package file.

Parameters
fileNameThe name of the package file, relative to the given file category below.
fileCategoryThe file system category where to look for the given file.
resourceTypeAn optional pointer to receive the package resource type.
fileTypeAn optional pointer to receive the package file type.
idAn optional pointer to receive the package ID, if present.
revisionAn optional pointer to receive the user-defined package revision, if present.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn optional pointer to receive the result of the version check.
isChecksumValidAn optional pointer to receive the result of the checksum comparison, if the package does include one.
Returns
true if the package could be loaded in the first place.

◆ QueryPackageFromMemory() [1/2]

virtual Bool Murl::Resource::IPackageFactory::QueryPackageFromMemory ( const ConstData data,
String id,
UInt32 revision,
Bool isDataValid,
Bool isVersionValid,
Bool isChecksumValid 
) const
pure virtual

Query information about a package in memory.

Parameters
dataThe binary package data.
idAn optional pointer to receive the package ID, if present.
revisionAn optional pointer to receive the user-defined package revision, if present.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn optional pointer to receive the result of the version check.
isChecksumValidAn optional pointer to receive the result of the checksum comparison, if the package does include one.
Returns
true if the package could be loaded in the first place.

◆ QueryPackageFromMemory() [2/2]

virtual Bool Murl::Resource::IPackageFactory::QueryPackageFromMemory ( const ConstData data,
IEnums::ResourceType resourceType,
IEnums::FileType fileType,
String id,
UInt32 revision,
Bool isDataValid,
Bool isVersionValid,
Bool isChecksumValid 
) const
pure virtual

Query information about a package in memory.

Parameters
dataThe binary package data.
resourceTypeAn optional pointer to receive the package resource type.
fileTypeAn optional pointer to receive the package file type.
idAn optional pointer to receive the package ID, if present.
revisionAn optional pointer to receive the user-defined package revision, if present.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn optional pointer to receive the result of the version check.
isChecksumValidAn optional pointer to receive the result of the checksum comparison, if the package does include one.
Returns
true if the package could be loaded in the first place.

◆ GetResourceFactory()

virtual const IFactory* Murl::Resource::IPackageFactory::GetResourceFactory ( ) const
pure virtual

Get the main resource factory.

Returns
A pointer to the main resource factory.

The documentation for this interface was generated from the following file:
  • murl_resource_i_package_factory.h


Copyright © 2011-2024 Spraylight GmbH.