Gamedev Framework (gf)  0.2.0 A C++11 framework for 2D games
gf::AssetManager Class Reference

An asset manager. More...

#include <gf/AssetManager.h>

Inheritance diagram for gf::AssetManager:
[legend]

## Public Member Functions

Path getAbsolutePath (const Path &relativePath) const
Search a file in the search directories. More...

## Detailed Description

An asset manager.

gf::AssetManager is a base class for searching files in some seach directories. If you are looking for some more sophisticated manager, you should look at gf::ResourceManager.

ResourceManager

## Member Function Documentation

 void gf::AssetManager::addSearchDir ( Path path )

If the provided path is not a directory, it is not added to the current search directories.

Parameters
 path The path of the directory
 Path gf::AssetManager::getAbsolutePath ( const Path & relativePath ) const

Search a file in the search directories.

This function tries to build absolute paths by joining a search directory and the relative path to the file.

If the provided path is absolute, then it is returned without searching in the search directories.

Parameters
 relativePath A path to the file, relative to a search directory
Returns
The absolute path to the file if it has been found or an empty path otherwise