cprover
Loading...
Searching...
No Matches
java_class_loader_base.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9#ifndef CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_BASE_H
10#define CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_BASE_H
11
12#include <util/irep.h>
13#include <util/optional.h>
14
15#include "jar_pool.h"
16
19
22{
23public:
26 {
28 }
29
34 void add_classpath_entry(const std::string &, message_handlert &);
35
36 static std::string file_to_class_name(const std::string &);
37 static std::string class_name_to_os_file(const irep_idt &);
38 static std::string class_name_to_jar_file(const irep_idt &);
39
42
43protected:
46 {
47 using kindt = enum { JAR, DIRECTORY };
49 std::string path;
50
51 classpath_entryt(kindt _kind, const std::string &_path)
52 : kind(_kind), path(_path)
53 {
54 }
55 };
56
58 std::list<classpath_entryt> classpath_entries;
59
62 const irep_idt &class_name,
63 const classpath_entryt &,
65
68 const irep_idt &class_name,
69 const std::string &jar_file,
71
74 const irep_idt &class_name,
75 const std::string &path,
77};
78
79#endif // CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_BASE_H
virtual void clear()
Reset the abstract state.
Definition ai.h:266
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:563
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:39
A chache for jar_filet objects, by file name.
Definition jar_pool.h:19
Base class for maintaining classpath.
void add_classpath_entry(const std::string &, message_handlert &)
Appends an entry to the class path, used for loading classes.
optionalt< java_bytecode_parse_treet > get_class_from_jar(const irep_idt &class_name, const std::string &jar_file, message_handlert &)
attempt to load a class from a given jar file
optionalt< java_bytecode_parse_treet > load_class(const irep_idt &class_name, const classpath_entryt &, message_handlert &)
attempt to load a class from a classpath_entry
void clear_classpath()
Clear all classpath entries.
jar_poolt jar_pool
a cache for jar_filet, by path name
static std::string class_name_to_os_file(const irep_idt &)
Convert a class name to a file name, with OS-dependent syntax.
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.
std::list< classpath_entryt > classpath_entries
List of entries in the classpath.
static std::string file_to_class_name(const std::string &)
Convert a file name to the class name.
optionalt< java_bytecode_parse_treet > get_class_from_directory(const irep_idt &class_name, const std::string &path, message_handlert &)
attempt to load a class from a given directory
classpath_entryt(kindt _kind, const std::string &_path)