.. index:: pair: class; EE::System::Zip .. _doxid-class_e_e_1_1_system_1_1_zip: class EE::System::Zip ===================== .. toctree:: :hidden: Overview ~~~~~~~~ :ref:`Zip ` files package manager. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Zip: public :ref:`EE::System::Pack` { public: // construction :target:`~Zip`(); // methods static Zip* :target:`New`(); virtual bool :ref:`create`(const std::string& path); virtual bool :ref:`open`(const std::string& path); virtual bool :ref:`close`(); virtual bool :ref:`addFile`(const std::string& path, const std::string& inpack); virtual bool :ref:`addFile`(const :ref:`Uint8`* data, const :ref:`Uint32`& dataSize, const std::string& inpack); virtual bool :ref:`addFiles`(std::map paths); virtual bool :ref:`eraseFile`(const std::string& path); virtual bool :ref:`eraseFiles`(const std::vector& paths); virtual bool :ref:`extractFile`(const std::string& path, const std::string& dest); virtual bool :ref:`extractFileToMemory`(const std::string& path, std::vector<:ref:`Uint8`>& data); virtual bool :ref:`extractFileToMemory`(const std::string& path, :ref:`ScopedBuffer`& data); virtual :ref:`Int32` :ref:`exists`(const std::string& path); virtual :ref:`Int8` :ref:`checkPack`(); virtual std::vector :ref:`getFileList`(); virtual bool :ref:`addFile`(std::vector<:ref:`Uint8`>& data, const std::string& inpack); virtual std::string :ref:`getPackPath`(); virtual :ref:`IOStream`* :ref:`getFileStream`(const std::string& path); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods void :ref:`lock`(); void :ref:`unlock`(); int :ref:`tryLock`(); virtual bool :ref:`create`(const std::string& path) = 0; virtual bool :ref:`open`(const std::string& path) = 0; virtual bool :ref:`close`() = 0; virtual bool :ref:`addFile`(const std::string& path, const std::string& inpack) = 0; virtual bool :ref:`addFile`(std::vector<:ref:`Uint8`>& data, const std::string& inpack) = 0; virtual bool :ref:`addFile`(const :ref:`Uint8`* data, const :ref:`Uint32`& dataSize, const std::string& inpack) = 0; virtual bool :ref:`addFiles`(std::map paths) = 0; virtual bool :ref:`eraseFile`(const std::string& path) = 0; virtual bool :ref:`eraseFiles`(const std::vector& paths) = 0; virtual bool :ref:`extractFile`(const std::string& path, const std::string& dest) = 0; virtual bool :ref:`extractFileToMemory`(const std::string& path, std::vector<:ref:`Uint8`>& data) = 0; virtual bool :ref:`extractFileToMemory`(const std::string& path, :ref:`ScopedBuffer`& data) = 0; virtual :ref:`Int32` :ref:`exists`(const std::string& path) = 0; virtual :ref:`Int8` :ref:`checkPack`() = 0; virtual std::vector :ref:`getFileList`() = 0; virtual bool :ref:`isOpen`() const; virtual std::string :ref:`getPackPath`() = 0; virtual :ref:`IOStream`* :ref:`getFileStream`(const std::string& path) = 0; .. _details-class_e_e_1_1_system_1_1_zip: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ :ref:`Zip ` files package manager. Methods ------- .. index:: pair: function; create .. _doxid-class_e_e_1_1_system_1_1_zip_1abeef1c7cbc994209b87fa1d0b3dff6dd: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool create(const std::string& path) Creates a new pack file .. index:: pair: function; open .. _doxid-class_e_e_1_1_system_1_1_zip_1ab28860745cb9192813300d15ee56544c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool open(const std::string& path) Open a pack file .. index:: pair: function; close .. _doxid-class_e_e_1_1_system_1_1_zip_1a4828566ff367f78bbe4ef7e4da26c479: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool close() Close the pack file .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_system_1_1_zip_1a19c40e8d28130b95ac98b0c06bd3315a: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFile(const std::string& path, const std::string& inpack) Add a file to the pack file .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - path - Path to the file in the disk * - inpack - Path that will have the file inside the pak .. rubric:: Returns: True if success .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_system_1_1_zip_1abc399eb4d53ecb8cb94bb19bdfab1186: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFile(const :ref:`Uint8`* data, const :ref:`Uint32`& dataSize, const std::string& inpack) Add a new file from memory .. index:: pair: function; addFiles .. _doxid-class_e_e_1_1_system_1_1_zip_1a0f0ac0faea9c04ed2e45321993d0bb02: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFiles(std::map paths) Add a map of files to the pack file ( myMap[ myFilepath ] = myInPackFilepath ) .. index:: pair: function; eraseFile .. _doxid-class_e_e_1_1_system_1_1_zip_1a62f3f477e639c0b712dd994f7b78d035: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFile(const std::string& path) Erase a file from the pack file. ( This will create a new pack file without that file, so, can be slow ) .. index:: pair: function; eraseFiles .. _doxid-class_e_e_1_1_system_1_1_zip_1a5fdb62f4227fdc87cdcedbdcbaea53e5: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFiles(const std::vector& paths) Erase all passed files from the pack file. ( This will create a new pack file without that file, so, can be slow ) .. index:: pair: function; extractFile .. _doxid-class_e_e_1_1_system_1_1_zip_1a10e91b3815a446ac9954c6790fbd26c1: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool extractFile(const std::string& path, const std::string& dest) Extract a file from the pack file .. index:: pair: function; extractFileToMemory .. _doxid-class_e_e_1_1_system_1_1_zip_1aecd71d0354ef00495b5b40874c2cc4cc: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool extractFileToMemory(const std::string& path, std::vector<:ref:`Uint8`>& data) Extract a file to memory from the pack file .. index:: pair: function; extractFileToMemory .. _doxid-class_e_e_1_1_system_1_1_zip_1a22e2df5a6d6faf314993305707b2a301: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool extractFileToMemory(const std::string& path, :ref:`ScopedBuffer`& data) Extract a file to memory from the pakFile .. index:: pair: function; exists .. _doxid-class_e_e_1_1_system_1_1_zip_1a847d8eb4be6935d84aaf1e6b6b85cdb9: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Int32` exists(const std::string& path) Check if a file exists in the pack file and return the number of the file, otherwise return -1. .. index:: pair: function; checkPack .. _doxid-class_e_e_1_1_system_1_1_zip_1a5913a82f08a96969a9b14900f678dd9f: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Int8` checkPack() Check the integrity of the pack file. If return 0 integrity OK. -1 wrong indentifier. -2 wrong header. .. index:: pair: function; getFileList .. _doxid-class_e_e_1_1_system_1_1_zip_1a0282b2df27ed9f6a4c98946c7dab3e87: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::vector getFileList() .. rubric:: Returns: a vector with all the files inside the pack file .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_system_1_1_zip_1aa7aeec21042f67ddc51b1470775c45be: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFile(std::vector<:ref:`Uint8`>& data, const std::string& inpack) Add a new file from memory .. index:: pair: function; getPackPath .. _doxid-class_e_e_1_1_system_1_1_zip_1a9f4bdaf3e2a7cb03489fa40ac047eb79: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::string getPackPath() .. rubric:: Returns: The file path of the opened package .. index:: pair: function; getFileStream .. _doxid-class_e_e_1_1_system_1_1_zip_1a28bc7aa509f80cdcefcb1d79507eb215: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`IOStream`* getFileStream(const std::string& path) Open a file stream for reading