PixelLightAPI
.
|
#include <LoadableManager.h>
Public Member Functions | |
uint32 | GetNumOfTypes () |
Returns the number of loadable types. | |
LoadableType * | GetTypeByIndex (uint32 nIndex) |
Returns a loadable type by using an index. | |
LoadableType * | GetTypeByName (const String &sName) |
Returns a loadable type by using it's name. | |
LoadableType * | GetTypeByExtension (const String &sExtension) |
Returns a loadable type by using a loadable extension. | |
PLCORE_API void | GetTypesByExtension (const String &sExtension, Array< LoadableType * > &lstTypes) |
Returns loadable types by using a loadable extension. | |
uint32 | GetNumOfLoaders () |
Returns the number of loaders. | |
Loader * | GetLoaderByIndex (uint32 nIndex) |
Returns a loader by using an index. | |
Loader * | GetLoaderByExtension (const String &sExtension) |
Returns a loader by using a loadable extension. | |
PLCORE_API void | GetLoadersByExtension (const String &sExtension, Array< Loader * > &lstLoaders) |
Returns loaders by using a loadable extension. | |
uint32 | GetNumOfFormats () |
Returns the number of supported formats. | |
String | GetFormat (uint32 nIndex) |
Returns a supported format. | |
PLCORE_API bool | IsFormatLoadSupported (const String &sExtension, const String &sType="") |
Returns whether loading is supported for the given format. | |
PLCORE_API bool | IsFormatSaveSupported (const String &sExtension, const String &sType="") |
Returns whether saving is supported for the given format. | |
uint32 | GetNumOfBaseDirs () const |
Returns the number of base directories. | |
String | GetBaseDir (uint32 nNum) const |
Returns one of the base directories. | |
PLCORE_API bool | IsBaseDir (const String &sPath) const |
Checks whether the given path is a base directory. | |
PLCORE_API bool | AddBaseDir (const String &sPath) |
Adds a base directory. | |
PLCORE_API bool | SetBaseDirPriority (const String &sFirstPath, const String &sSecondPath) |
Set the priority of base directories. | |
PLCORE_API bool | RemoveBaseDir (const String &sPath) |
Remove a base directory. | |
PLCORE_API bool | RemoveBaseDir (uint32 nNum) |
Remove a base directory. | |
bool | ClearBaseDirs () |
Removes all base directories. | |
PLCORE_API String | GetRelativeFilename (const String &sFilename) |
Gets the relative version of an absolute filename. | |
PLCORE_API bool | ScanPackages (const String &sPath, const String &sExtension="*.zip") |
Scan a directory for data packages and add them as base paths to the loadable manager. | |
PLCORE_API bool | OpenFile (File &cFile, const String &sFilename, bool bCreate=false, String::EFormat nStringFormat=String::ASCII) const |
Opens a file by using base directories. | |
PLCORE_API String | LoadStringFromFile (const String &sFilename, String::EFormat nStringFormat=String::ASCII) const |
Loads in a string by using a file. | |
Static Public Member Functions | |
static PLCORE_API LoadableManager * | GetInstance () |
static PLCORE_API bool | HasInstance () |
Protected Member Functions | |
PLCORE_API | LoadableManager () |
Constructor. | |
virtual PLCORE_API | ~LoadableManager () |
Destructor. |
Loadable manager.
Example:
PLCORE_API PLCore::LoadableManager::LoadableManager | ( | ) | [protected] |
virtual PLCORE_API PLCore::LoadableManager::~LoadableManager | ( | ) | [protected, virtual] |
Destructor.
static PLCORE_API LoadableManager* PLCore::LoadableManager::GetInstance | ( | ) | [static] |
static PLCORE_API bool PLCore::LoadableManager::HasInstance | ( | ) | [static] |
uint32 PLCore::LoadableManager::GetNumOfTypes | ( | ) | [inline] |
Returns the number of loadable types.
LoadableType * PLCore::LoadableManager::GetTypeByIndex | ( | uint32 | nIndex | ) | [inline] |
Returns a loadable type by using an index.
[in] | nIndex | Loadable type index |
LoadableType * PLCore::LoadableManager::GetTypeByName | ( | const String & | sName | ) | [inline] |
Returns a loadable type by using it's name.
[in] | sName | Loadable type name |
LoadableType * PLCore::LoadableManager::GetTypeByExtension | ( | const String & | sExtension | ) | [inline] |
Returns a loadable type by using a loadable extension.
[in] | sExtension | Extension of loadable |
PLCORE_API void PLCore::LoadableManager::GetTypesByExtension | ( | const String & | sExtension, |
Array< LoadableType * > & | lstTypes | ||
) |
Returns loadable types by using a loadable extension.
[in] | sExtension | Extension of loadable |
[out] | lstTypes | Receives the list of matching loadable types (list is not cleared before new entries are added), there can be multiple candidates |
uint32 PLCore::LoadableManager::GetNumOfLoaders | ( | ) | [inline] |
Returns the number of loaders.
Loader * PLCore::LoadableManager::GetLoaderByIndex | ( | uint32 | nIndex | ) | [inline] |
Returns a loader by using an index.
[in] | nIndex | Loader index |
Loader * PLCore::LoadableManager::GetLoaderByExtension | ( | const String & | sExtension | ) | [inline] |
Returns a loader by using a loadable extension.
Returns a loader by using a extension.
[in] | sExtension | Extension of loadable |
PLCORE_API void PLCore::LoadableManager::GetLoadersByExtension | ( | const String & | sExtension, |
Array< Loader * > & | lstLoaders | ||
) |
Returns loaders by using a loadable extension.
[in] | sExtension | Extension of loadable |
[out] | lstLoaders | Receives the list of matching loaders (list is not cleared before new entries are added), there can be multiple candidates |
uint32 PLCore::LoadableManager::GetNumOfFormats | ( | ) | [inline] |
Returns the number of supported formats.
String PLCore::LoadableManager::GetFormat | ( | uint32 | nIndex | ) | [inline] |
Returns a supported format.
[in] | nIndex | Format index |
PLCORE_API bool PLCore::LoadableManager::IsFormatLoadSupported | ( | const String & | sExtension, |
const String & | sType = "" |
||
) |
Returns whether loading is supported for the given format.
[in] | sExtension | Extension of the format |
[in] | sType | Required loadable type, if empty string ignore loadable type |
PLCORE_API bool PLCore::LoadableManager::IsFormatSaveSupported | ( | const String & | sExtension, |
const String & | sType = "" |
||
) |
Returns whether saving is supported for the given format.
[in] | sExtension | Extension of the format |
[in] | sType | Required loadable type, if empty string ignore loadable type |
uint32 PLCore::LoadableManager::GetNumOfBaseDirs | ( | ) | const [inline] |
Returns the number of base directories.
String PLCore::LoadableManager::GetBaseDir | ( | uint32 | nNum | ) | const [inline] |
Returns one of the base directories.
[in] | nNum | Number of the base directory to get |
PLCORE_API bool PLCore::LoadableManager::IsBaseDir | ( | const String & | sPath | ) | const |
Checks whether the given path is a base directory.
[in] | sPath | Path to the base directory |
PLCORE_API bool PLCore::LoadableManager::AddBaseDir | ( | const String & | sPath | ) |
Adds a base directory.
[in] | sPath | Path to the base directory |
PLCORE_API bool PLCore::LoadableManager::SetBaseDirPriority | ( | const String & | sFirstPath, |
const String & | sSecondPath | ||
) |
Set the priority of base directories.
[in] | sFirstPath | Path to the first base directory |
[in] | sSecondPath | Path to the second base directory |
PLCORE_API bool PLCore::LoadableManager::RemoveBaseDir | ( | const String & | sPath | ) |
Remove a base directory.
[in] | sPath | Base directory to remove |
PLCORE_API bool PLCore::LoadableManager::RemoveBaseDir | ( | uint32 | nNum | ) |
Remove a base directory.
[in] | nNum | Number of the base directory to remove |
bool PLCore::LoadableManager::ClearBaseDirs | ( | ) | [inline] |
Removes all base directories.
PLCORE_API String PLCore::LoadableManager::GetRelativeFilename | ( | const String & | sFilename | ) |
Gets the relative version of an absolute filename.
[in] | sFilename | Absolute filename to get the relative version from |
PLCORE_API bool PLCore::LoadableManager::ScanPackages | ( | const String & | sPath, |
const String & | sExtension = "*.zip" |
||
) |
Scan a directory for data packages and add them as base paths to the loadable manager.
[in] | sPath | Directory to search in |
[in] | sExtension | Extension of the archives to add (e.g. 'zip' or 'pak') |
PLCORE_API bool PLCore::LoadableManager::OpenFile | ( | File & | cFile, |
const String & | sFilename, | ||
bool | bCreate = false , |
||
String::EFormat | nStringFormat = String::ASCII |
||
) | const |
Opens a file by using base directories.
[in] | cFile | File object |
[in] | sFilename | Filename of the file to open |
[in] | bCreate | Create the file if it doesn't exist? |
[in] | nStringFormat | String encoding format to use when dealing with string functions (not supported by all file implementations) |
PLCORE_API String PLCore::LoadableManager::LoadStringFromFile | ( | const String & | sFilename, |
String::EFormat | nStringFormat = String::ASCII |
||
) | const |
Loads in a string by using a file.
[in] | sFilename | Name of the file to read the string from |
[in] | nStringFormat | String encoding format to use when dealing with string functions (not supported by all file implementations) |
|