#pragma once #include #include #include #include #include namespace llo { /// /// lloiff class which contains all of the information for representing a file format in a IL format... /// class lloiff_t { public: /// /// iff section struct containing IL information about a section... /// struct iff_section_t { /// /// section name, hashed so that there can be multiple... /// llo::utils::hash_t< std::string > section_name; /// /// vector of raw bytes containing the original bytes of this section... /// std::vector< std::uint8_t > raw; }; /// /// explicit constructor, must pass a name and the original file as a vector of bytes... /// /// name for this iff object... /// vector of raw bytes containing the original file... explicit lloiff_t( const std::string &name, const std::vector< std::uint8_t > &raw ) : name( name ), raw( raw ) { } /// /// makes a shared pointer containing a llo::lloiff_t... /// /// name of the file... /// vector of bytes containing the raw file... /// returns a shared pointer of the new object... static std::shared_ptr< llo::lloiff_t > make( const std::string &name, const std::vector< std::uint8_t > &raw ) { return std::make_shared< llo::lloiff_t >( name, raw ); } /// /// name of the iff file, hashed so there can be unique objects... /// llo::utils::hash_t< std::string > name; /// /// vector of iff sections... /// std::vector< iff_section_t > sections; /// /// vector of bytes containing the entire original file... /// std::vector< std::uint8_t > raw; /// /// some file formats contain multiple other files inside of them such as LIB... /// which is just an archive of OBJ's... /// std::vector< std::shared_ptr< llo::lloiff_t > > children; }; } // namespace llo