58 for(std::string::iterator it =
result.begin(); it !=
result.end(); it++)
75 for(std::string::iterator it =
result.begin(); it !=
result.end(); it++)
94 for(std::string::iterator it =
result.begin(); it !=
result.end(); it++)
115 switch(cp_entry.
kind)
117 case classpath_entryt::JAR:
120 case classpath_entryt::DIRECTORY:
134 const std::string &jar_file)
141 if(!
data.has_value())
144 debug() <<
"Getting class `" << class_name <<
"' from JAR " << jar_file
147 std::istringstream istream(*
data);
150 catch(
const std::runtime_error &)
152 error() <<
"failed to open JAR file `" << jar_file <<
"'" <<
eom;
164 const std::string &path)
170 if(std::ifstream(full_path))
172 debug() <<
"Getting class `" << class_name <<
"' from file " << full_path
std::string concat_dir_file(const std::string &directory, const std::string &file_name)
std::list< classpath_entryt > classpath_entries
List of entries in the classpath.
const std::string & id2string(const irep_idt &d)
void add_classpath_entry(const std::string &)
Appends an entry to the class path, used for loading classes.
optionalt< java_bytecode_parse_treet > load_class(const irep_idt &class_name, const classpath_entryt &)
attempt to load a class from a classpath_entry
static std::string class_name_to_os_file(const irep_idt &)
Convert a class name to a file name, with OS-dependent syntax.
optionalt< java_bytecode_parse_treet > get_class_from_directory(const irep_idt &class_name, const std::string &path)
attempt to load a class from a given directory
nonstd::optional< T > optionalt
static std::string file_to_class_name(const std::string &)
Convert a file name to the class name.
bool has_prefix(const std::string &s, const std::string &prefix)
An entry in the classpath.
jar_poolt jar_pool
a cache for jar_filet, by path name
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
optionalt< java_bytecode_parse_treet > java_bytecode_parse(std::istream &istream, message_handlert &message_handler, bool skip_instructions)
Attempt to parse a Java class from the given stream.
message_handlert & get_message_handler()
mstreamt & result() const
#define UNREACHABLE
This should be used to mark dead code.
static std::string class_name_to_jar_file(const irep_idt &)
Convert a class name to a file name, does the inverse of file_to_class_name.
bool has_suffix(const std::string &s, const std::string &suffix)
optionalt< java_bytecode_parse_treet > get_class_from_jar(const irep_idt &class_name, const std::string &jar_file)
attempt to load a class from a given jar file