.. index:: pair: class; EE::System::Pack .. _doxid-class_e_e_1_1_system_1_1_pack: class EE::System::Pack ====================== .. toctree:: :hidden: Overview ~~~~~~~~ Base class for all packing classes. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Pack: protected :ref:`EE::System::Mutex` { public: // construction virtual :target:`~Pack`(); // methods 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; }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods void :ref:`lock`(); void :ref:`unlock`(); int :ref:`tryLock`(); .. _details-class_e_e_1_1_system_1_1_pack: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Base class for all packing classes. Methods ------- .. index:: pair: function; create .. _doxid-class_e_e_1_1_system_1_1_pack_1adf472a7bf740760c77d74767f5d42692: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool create(const std::string& path) = 0 Creates a new pack file .. index:: pair: function; open .. _doxid-class_e_e_1_1_system_1_1_pack_1aed0793a72e3106e2433d35eb81f328da: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool open(const std::string& path) = 0 Open a pack file .. index:: pair: function; close .. _doxid-class_e_e_1_1_system_1_1_pack_1a09431ae31c018bfad51890a9226f6429: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool close() = 0 Close the pack file .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_system_1_1_pack_1a24cb5e4e53638611e1ee1c81ac87a6ec: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFile(const std::string& path, const std::string& inpack) = 0 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_pack_1acc2f92227713852bf490e977123132d3: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFile(std::vector<:ref:`Uint8`>& data, const std::string& inpack) = 0 Add a new file from memory .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_system_1_1_pack_1a37f456af4450f9d31387959746061a6c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFile(const :ref:`Uint8`* data, const :ref:`Uint32`& dataSize, const std::string& inpack) = 0 Add a new file from memory .. index:: pair: function; addFiles .. _doxid-class_e_e_1_1_system_1_1_pack_1ab2b2fc964d416f2dd7817dcb50476c77: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFiles(std::map paths) = 0 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_pack_1ad54698893530a7cdb05bef53de28462e: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFile(const std::string& path) = 0 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_pack_1a558ffa048fd0c157d6dd3f68529f3884: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFiles(const std::vector& paths) = 0 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_pack_1ab10624b65e4cafd9701f7fd146353b56: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool extractFile(const std::string& path, const std::string& dest) = 0 Extract a file from the pack file .. index:: pair: function; extractFileToMemory .. _doxid-class_e_e_1_1_system_1_1_pack_1a5b910ff3d68d6cedf6bb442343247006: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool extractFileToMemory(const std::string& path, std::vector<:ref:`Uint8`>& data) = 0 Extract a file to memory from the pack file .. index:: pair: function; extractFileToMemory .. _doxid-class_e_e_1_1_system_1_1_pack_1a599cc41ad900e4d2431951acbce70ec0: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool extractFileToMemory(const std::string& path, :ref:`ScopedBuffer`& data) = 0 Extract a file to memory from the pack file .. index:: pair: function; exists .. _doxid-class_e_e_1_1_system_1_1_pack_1ad4334eb35179ce974596743e9afbe93b: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Int32` exists(const std::string& path) = 0 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_pack_1ae9662bd03436b56b8a9ba9b8f8004a6c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Int8` checkPack() = 0 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_pack_1a55966a8a38c75711b79f4f5c90e09867: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::vector getFileList() = 0 .. rubric:: Returns: a vector with all the files inside the pack file .. index:: pair: function; isOpen .. _doxid-class_e_e_1_1_system_1_1_pack_1a83f78b2345786f7ac8664db062d88ff8: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isOpen() const .. rubric:: Returns: If the pack file is open .. index:: pair: function; getPackPath .. _doxid-class_e_e_1_1_system_1_1_pack_1a89025033f565644a68693e6762707f50: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::string getPackPath() = 0 .. rubric:: Returns: The file path of the opened package .. index:: pair: function; getFileStream .. _doxid-class_e_e_1_1_system_1_1_pack_1ab86a4a316ed9da12208a21aab716044c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`IOStream`* getFileStream(const std::string& path) = 0 Open a file stream for reading