.. index:: pair: class; EE::System::PackRegistry .. _doxid-class_e_e_1_1_system_1_1_pack_registry: class EE::System::PackRegistry ============================== .. toctree:: :hidden: Overview ~~~~~~~~ The :ref:`Pack ` Registry keep track of the instantiated Packs. It's used to find files from any open pack. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class PackRegistry: protected :ref:`EE::System::Container` { public: // construction virtual :target:`~PackRegistry`(); // methods :ref:`Pack`* :ref:`exists`(std::string& path); :ref:`Pack`* :ref:`getPackByPath`(std::string path); const bool& :ref:`isFallbackToPacksActive`() const; void :ref:`setFallbackToPacks`(const bool& fallback); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods T* :ref:`add`(T* resource); bool :ref:`remove`(T* resource); :ref:`Uint32` :ref:`count`(); .. _details-class_e_e_1_1_system_1_1_pack_registry: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The :ref:`Pack ` Registry keep track of the instantiated Packs. It's used to find files from any open pack. Methods ------- .. index:: pair: function; exists .. _doxid-class_e_e_1_1_system_1_1_pack_registry_1a36b9acc11d4ae2b6a7f7588fd6e021d3: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Pack`* exists(std::string& path) Searches for the filepath in the packs, if the file is found it will return the pack that belongs to. \*. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - path - The file path to search. .. rubric:: Returns: The pack where the file exists. If the file is not found, returns NULL. \* .. index:: pair: function; getPackByPath .. _doxid-class_e_e_1_1_system_1_1_pack_registry_1ac15063501975884650891fd6ca06f795: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Pack`* getPackByPath(std::string path) Search for a pack by its path. .. rubric:: Returns: The pack instance if found, otherwise returns NULL. .. index:: pair: function; isFallbackToPacksActive .. _doxid-class_e_e_1_1_system_1_1_pack_registry_1aaac09a46de61b900b091593e8fd88a31: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& isFallbackToPacksActive() const .. rubric:: Returns: If the packs opened are being used as a fallback in case of a file wasn't found in the file system path. .. index:: pair: function; setFallbackToPacks .. _doxid-class_e_e_1_1_system_1_1_pack_registry_1a4d2355b5aec516965023be7826cb921b: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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.