.. index:: pair: class; EE::System::DirectoryPack .. _doxid-class_e_e_1_1_system_1_1_directory_pack: class EE::System::DirectoryPack =============================== .. toctree:: :hidden: Overview ~~~~~~~~ A local file system directory. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class DirectoryPack: public :ref:`EE::System::Pack` { public: // construction :target:`~DirectoryPack`(); // methods static DirectoryPack* :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:`addFile`(std::vector<:ref:`Uint8`>& data, 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 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_directory_pack: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A local file system directory. Methods ------- .. index:: pair: function; create .. _doxid-class_e_e_1_1_system_1_1_directory_pack_1a302bbe219d0d9d5a62b8d444ad1178a4: .. 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_directory_pack_1a0ffc0fb58db055c5b935f77fb5be56fd: .. 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_directory_pack_1adb27fc825e0745eabfb1cc607dc0b446: .. 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_directory_pack_1a4605c5cb101b546de2ea43ee5800e66a: .. 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_directory_pack_1a5a80c9d1fcefbcc718190cb53da07c80: .. 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; addFile .. _doxid-class_e_e_1_1_system_1_1_directory_pack_1aeacc0228169c5b6a18226140d4c97eb6: .. 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; addFiles .. _doxid-class_e_e_1_1_system_1_1_directory_pack_1a54fe797028d02e65759a1551dda2e3bc: .. 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_directory_pack_1a4ee21156db3c71315d69a800ac791860: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFile(const std::string& path) Erase a file from the pack file. .. index:: pair: function; eraseFiles .. _doxid-class_e_e_1_1_system_1_1_directory_pack_1ad0bfbd174b3f3ced54dde603fa7de271: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool eraseFiles(const std::vector& paths) Erase all passed files from the pack file. .. index:: pair: function; extractFile .. _doxid-class_e_e_1_1_system_1_1_directory_pack_1adea609b58274efa87420f1632adda541: .. 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_directory_pack_1a049e960447e4208bb5d8f8b6693c26f8: .. 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_directory_pack_1abf3994bdbf00b877d2f5817c3e9a8943: .. 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_directory_pack_1a5fb74bc817cedb95dab5b132b5665efd: .. 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_directory_pack_1aeb7142900f368c61180aa086a595ebbc: .. 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_directory_pack_1ae47f96d3e6a10fcc217052755db1641b: .. 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; getPackPath .. _doxid-class_e_e_1_1_system_1_1_directory_pack_1acdd3af33ce80706fa3cd2c4b52d03958: .. 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_directory_pack_1a8ea2014ce00ae80d7370d56e0a32b6be: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`IOStream`* getFileStream(const std::string& path) Open a file stream for reading