ezEngine  Milestone 7
ezResourceLoaderFromFile Class Reference

A default implementation of ezResourceTypeLoader for standard file loading. More...

#include <ResourceTypeLoader.h>

Inheritance diagram for ezResourceLoaderFromFile:

Public Member Functions

virtual ezResourceLoadData OpenDataStream (const ezResourceBase *pResource) override
 Override this function to implement the resource loading. More...
 
virtual void CloseDataStream (const ezResourceBase *pResource, const ezResourceLoadData &LoaderData) override
 This function is called when the resource has been updated with the data from the resource loader and the loader can deallocate any temporary memory.
 
virtual bool IsResourceOutdated (const ezResourceBase *pResource) const override
 If this function returns true, a resource is unloaded and loaded again to update its content. More...
 

Detailed Description

A default implementation of ezResourceTypeLoader for standard file loading.

The loader will interpret the ezResourceBase 'resource ID' as a path, read that full file into a memory stream. The file modification data is stored as well. Resources that use this loader can update their data as if they were reading the file directly.

Member Function Documentation

bool ezResourceLoaderFromFile::IsResourceOutdated ( const ezResourceBase pResource) const
overridevirtual

If this function returns true, a resource is unloaded and loaded again to update its content.

Call ezResourceBase::GetLoadedFileModificationTime() to query the file modification time that was returned through ezResourceLoadData::m_LoadedFileModificationDate.

Reimplemented from ezResourceTypeLoader.

ezResourceLoadData ezResourceLoaderFromFile::OpenDataStream ( const ezResourceBase pResource)
overridevirtual

Override this function to implement the resource loading.

This function should take the information from pResource, e.g. which file to load, and do the loading work. It should allocate temporary storage for the loaded data and encode it in a memory stream, such that the resource can read all necessary information from the stream.

See Also
ezResourceLoadData

Implements ezResourceTypeLoader.


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