ROSE  0.9.9.109
BinaryDemangler.h
1 #ifndef ROSE_BinaryAnalysis_Demangler_H
2 #define ROSE_BinaryAnalysis_Demangler_H
3 
4 namespace Rose {
5 namespace BinaryAnalysis {
6 
7 class Demangler {
8 public:
9  typedef Sawyer::Container::Map<std::string /*mangled*/, std::string /*non-mangled*/> NameMap;
10 
11 private:
12  boost::filesystem::path cxxFiltExe_; // name or path of the c++filt command ($PATH is used to search)
13  NameMap nameMap_; // cache of de-mangled names
14  std::string compiler_; // format of mangled names
15 
16 public:
23  const boost::filesystem::path& cxxFiltExe() const { return cxxFiltExe_; }
24  void cxxFiltExe(const boost::filesystem::path &p) { cxxFiltExe_ = p; }
45  const std::string& compiler() const { return compiler_; }
46  void compiler(const std::string &s) { compiler_ = s; }
53  void fillCache(const std::vector<std::string> &mangledNames);
54 
62  std::string demangle(const std::string &mangledName);
63 
65  void clear() { nameMap_.clear(); }
66 
68  size_t size() const { return nameMap_.size(); }
69 
71  const NameMap& allNames() const { return nameMap_; }
72 
76  void insert(const std::string &mangledName, const std::string &demangledName);
77 };
78 
79 } // namespace
80 } // namespace
81 
82 #endif
void insert(const std::string &mangledName, const std::string &demangledName)
Insert a mangled/demangled pair.
void fillCache(const std::vector< std::string > &mangledNames)
Demangle lots of names.
Main namespace for the ROSE library.
Map & clear()
Remove all nodes.
Definition: Sawyer/Map.h:616
void clear()
Clear the cache.
std::string demangle(const std::string &mangledName)
Demangle one name.
const boost::filesystem::path & cxxFiltExe() const
Property: Name of c++filt program.
const NameMap & allNames() const
Map of all cached names.
void cxxFiltExe(const boost::filesystem::path &p)
Property: Name of c++filt program.
size_t size() const
Number of items in the cache.
const std::string & compiler() const
Property: Format of mangled names.
void compiler(const std::string &s)
Property: Format of mangled names.
size_t size() const
Number of nodes, keys, or values in this container.
Definition: Sawyer/Map.h:322
Container associating values with keys.
Definition: Sawyer/Map.h:64