Murl::Resource::IPackageFactory Interface Referenceabstract
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 IPackage * | CreatePackageFromFile (const String &id, const String &fileName, IEnums::FileCategory fileCategory, Result &result) const =0 |
Create a resource package from a file. More... | |
virtual IPackage * | CreatePackageFromMemory (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 IFactory * | GetResourceFactory () 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::ClassInfo * | GetRegisteredPackageClassInfo (UInt32 index) const =0 |
Get the ClassInfo structure of a registered package class. More... | |
virtual const String & | GetRegisteredPackageClassInfoFileNamePattern (UInt32 index) const =0 |
Get the file name pattern of a registered package class. More... | |
virtual const IObjectFactory * | GetRegisteredPackageClassInfoObjectFactory (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 PropertyInfo * | GetPropertyInfo () |
Get the class' property info struct. More... | |
static const AttributeInfo * | GetAttributeInfo () |
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()
|
pure virtual |
Initialize the factory.
- Returns
- true if successful.
◆ DeInit()
|
pure virtual |
Deinitialize the factory.
- Returns
- true if successful.
◆ CreatePackageFromFile()
|
pure virtual |
Create a resource package from a file.
- Parameters
-
id The internal package ID. fileName The name of the package file, relative to the given file category below. fileCategory The file system category where to look for the given file. result The object to receive the result of the operation.
- Returns
- The newly created package, or null if failed.
◆ CreatePackageFromMemory()
|
pure virtual |
Create a resource package from a block of memory.
- Parameters
-
id The internal package ID. fileName The file name of the package, relative to which any individual file sub-resources/-packages are accessed from the file system. fileCategory The file system category to prepend to the file name. data The binary package data. dataCanBeDisposed A 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(). result The object to receive the result of the operation.
- Returns
- The newly created package, or null if failed.
◆ DestroyPackage()
|
pure virtual |
Destroy a previously created package.
- Parameters
-
package A reference to a pointer holding the package to destroy.
- Returns
- true if successful.
◆ QueryPackageFromFile() [1/2]
|
pure virtual |
Query information about a package file.
- Parameters
-
fileName The name of the package file, relative to the given file category below. fileCategory The file system category where to look for the given file. id An optional pointer to receive the package ID, if present. revision An optional pointer to receive the user-defined package revision, if present. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check. isChecksumValid An 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]
|
pure virtual |
Query information about a package file.
- Parameters
-
fileName The name of the package file, relative to the given file category below. fileCategory The file system category where to look for the given file. resourceType An optional pointer to receive the package resource type. fileType An optional pointer to receive the package file type. id An optional pointer to receive the package ID, if present. revision An optional pointer to receive the user-defined package revision, if present. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check. isChecksumValid An 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]
|
pure virtual |
Query information about a package in memory.
- Parameters
-
data The binary package data. id An optional pointer to receive the package ID, if present. revision An optional pointer to receive the user-defined package revision, if present. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check. isChecksumValid An 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]
|
pure virtual |
Query information about a package in memory.
- Parameters
-
data The binary package data. resourceType An optional pointer to receive the package resource type. fileType An optional pointer to receive the package file type. id An optional pointer to receive the package ID, if present. revision An optional pointer to receive the user-defined package revision, if present. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check. isChecksumValid An 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()
|
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