.. index:: pair: class; EE::System::Pak .. _doxid-class_e_e_1_1_system_1_1_pak: class EE::System::Pak ===================== .. toctree:: :hidden: struct_EE_System_Pak_pakEntry.rst struct_EE_System_Pak_pakFile.rst struct_EE_System_Pak_pakHeader.rst Overview ~~~~~~~~ Quake 2 PAK handler. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Pak: public :ref:`EE::System::Pack` { public: // structs struct :ref:`pakEntry`; struct :ref:`pakFile`; struct :ref:`pakHeader`; // construction :target:`~Pak`(); // methods static Pak* :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`(std::vector<:ref:`Uint8`>& data, 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:`isOpen`() const; 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_pak: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Quake 2 PAK handler. Methods ------- .. index:: pair: function; create .. _doxid-class_e_e_1_1_system_1_1_pak_1ac82d437ed224b9be6c6a7ce10cb00094: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool create(const std::string& path) Creates a new :ref:`pakFile ` .. index:: pair: function; open .. _doxid-class_e_e_1_1_system_1_1_pak_1a2c4e990a9b8eae67baa622037ab95642: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool open(const std::string& path) Open a :ref:`pakFile ` .. index:: pair: function; close .. _doxid-class_e_e_1_1_system_1_1_pak_1a4e8847a3f52de446100644dde68a97b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool close() Close the :ref:`pakFile ` .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_system_1_1_pak_1a5e3f360b15a823e1244e871ed57cdf5a: .. 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 :ref:`pakFile ` .. 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_pak_1a9c9ea09b6aa1de73102dfe9694cca46e: .. 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; addFile .. _doxid-class_e_e_1_1_system_1_1_pak_1a8223d85c50719c768e97354a067208cb: .. 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_pak_1a9289d31fbb60542bd2bee907dbf0ec06: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool addFiles(std::map paths) Add a map of files to the :ref:`pakFile ` ( myMap[ myFilepath ] = myInPakFilepath ) .. index:: pair: function; eraseFile .. _doxid-class_e_e_1_1_system_1_1_pak_1a576544e7d696157b4752397866f65449: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFile(const std::string& path) Erase a file from the :ref:`pakFile `. ( This will create a new :ref:`pakFile ` without that file, so, can be slow ) .. index:: pair: function; eraseFiles .. _doxid-class_e_e_1_1_system_1_1_pak_1a5781121bcd97d16761d65a139b59051d: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFiles(const std::vector& paths) Erase all passed files from the :ref:`pakFile `. ( This will create a new :ref:`pakFile ` without that file, so, can be slow ) .. index:: pair: function; extractFile .. _doxid-class_e_e_1_1_system_1_1_pak_1a2c2aeb95089672608c92f998636c92ba: .. 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 :ref:`pakFile ` .. index:: pair: function; extractFileToMemory .. _doxid-class_e_e_1_1_system_1_1_pak_1a73d4ea248d8f3ec7c563b0784a0835fd: .. 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 :ref:`pakFile ` .. index:: pair: function; extractFileToMemory .. _doxid-class_e_e_1_1_system_1_1_pak_1aaef0d101b8723f00e4dda6137b6e47cd: .. 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 :ref:`pakFile ` .. index:: pair: function; exists .. _doxid-class_e_e_1_1_system_1_1_pak_1a3190f95f265bce8d7df9aa28a34a95a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Int32` exists(const std::string& path) Check if a file exists in the :ref:`pakFile ` and return the number of the file, otherwise return -1. .. index:: pair: function; checkPack .. _doxid-class_e_e_1_1_system_1_1_pak_1a100365f6313687640c001f5cabfdd7e8: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Int8` checkPack() Check the integrity of the :ref:`pakFile `. If return 0 integrity OK. -1 wrong indentifier. -2 wrong header. .. index:: pair: function; getFileList .. _doxid-class_e_e_1_1_system_1_1_pak_1ae994abb9eca1f1a4de40786de1973231: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::vector getFileList() .. rubric:: Returns: a vector with all the files inside the :ref:`pakFile ` .. index:: pair: function; isOpen .. _doxid-class_e_e_1_1_system_1_1_pak_1a56a9ee1794e3ab3f452ce6dde169ed7d: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isOpen() const .. rubric:: Returns: If the PAK file is open .. index:: pair: function; getPackPath .. _doxid-class_e_e_1_1_system_1_1_pak_1ab1ab3d3571027db5ef23dbf925f8e599: .. 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_pak_1abf2ec76d7bf45013afdc1134d3120707: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`IOStream`* getFileStream(const std::string& path) Open a file stream for reading