class EE::System::PackManager

Overview

The Pack Manager keep track of the instanciated Packs. It’s used to find files from any open pack. More…

#include <packmanager.hpp>

class PackManager: protected EE::System::Container {
public:
    // construction

    virtual ~PackManager();

    // methods

    Pack* exists(std::string& path);
    Pack* getPackByPath(std::string path);
    const bool& isFallbackToPacksActive() const;
    void setFallbackToPacks(const bool& fallback);
};

Inherited Members

public:
    // methods

    T* add(T* resource);
    bool remove(T* resource);
    Uint32 count();

Detailed Documentation

The Pack Manager keep track of the instanciated Packs. It’s used to find files from any open pack.

Methods

Pack* exists(std::string& path)

Searchs for the filepath in the packs, if the file is found it will return the pack that belongs to. *.

Parameters:

path

The file path to search.

Returns:

The pack where the file exists. If the file is not found, returns NULL. *

Pack* getPackByPath(std::string path)

Search for a pack by its path.

Returns:

The pack instance if found, otherwise returns NULL.

const bool& isFallbackToPacksActive() const

Returns:

If the packs opened are being used as a fallback in case of a file wasn’t found in the file system path.

void setFallbackToPacks(const bool& fallback)

Sets if the files that failed to be loaded from the file system should try to be loaded from the currently open packs. For example if you try to load a texture from the file system a fails it will search the same path in the opened packs, and load it from there. * TextureFactory::instance()->loadFromFile( “mytexture.png” ); If the file is not in the file system, it will be searched in the opened packs, and loaded if is found. * In case that the process path is appended to the path… like Sys::GetProcessPath() + “mytexture.png”, the process path will be removed from the file path.