pyGAP / game / engine / io / fs / pack.h

#ifndef __IO_FS_PACK_H__
#define __IO_FS_PACK_H__

#include <map>
#include <string>
#include <stdint.h>


namespace formats { namespace pack {
    class Header;
    class File;
    class MFT;
} /* namespace pack */ } /* namespace formats */

namespace io { namespace file {
    class Decoder;
    class Base;
} /* namespace file */

namespace fs {

class Base;


class Pack : public Base {
    friend Base* open(const char* filename);

protected:
    Pack();

public:
    virtual ~Pack();

    void init(::io::file::Base* pack);

    virtual ::io::file::Base* open(const char* filename, const char* mode="rb") const;
    virtual uint8_t* read(const char* filename, const char* mode="rb") const;
    virtual uint8_t* read(const uint32_t& h, const char* mode="rb") const;

private:
    Pack(const Pack&);
    Pack operator=(const Pack&);

    uint32_t hash(const std::string& str) const;

    typedef std::map<uint32_t, ::formats::pack::File*>   map_files_t;

    map_files_t                 files_;
    ::formats::pack::Header*    header_;
    ::formats::pack::MFT*       mft_;
    ::io::file::Base*           pack_;
    ::io::file::Decoder*        decoder_;
};


} /* namespace fs */ } /* namespace io */


#endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.