9 #ifndef CPROVER_JAVA_BYTECODE_JAR_FILE_H
10 #define CPROVER_JAVA_BYTECODE_JAR_FILE_H
16 #include <unordered_map>
27 explicit jar_filet(
const std::string &filename);
44 std::optional<std::string>
get_entry(
const std::string &filename);
48 std::unordered_map<std::string, std::string>
get_manifest();
51 std::vector<std::string>
filenames()
const;
Class representing a .jar archive.
mz_zip_archivet m_zip_archive
jar_filet & operator=(const jar_filet &)=delete
jar_filet(const jar_filet &)=delete
std::unordered_map< std::string, size_t > m_name_to_index
Map of filename to the file index in the zip archive.
std::optional< std::string > get_entry(const std::string &filename)
Get contents of a file in the jar archive.
std::vector< std::string > filenames() const
Get list of filenames in the archive.
jar_filet(const std::string &filename)
Open java file for reading.
std::unordered_map< std::string, std::string > get_manifest()
Get contents of the Manifest file in the jar archive as a key-value map (both as strings)
void initialize_file_index()
Loads the fileindex (m_name_to_index) with a map of loaded files to indices.
Thin object-oriented wrapper around the MZ Zip library Zip file reader and extractor.