IDA Domain
type.hpp
Go to the documentation of this file.
1 #ifndef IDA_DOMAIN_TYPE_HPP
2 #define IDA_DOMAIN_TYPE_HPP
3 
5 #include <typeinf.hpp>
6 #include <string>
7 #include <vector>
8 
9 #ifndef SWIG
11 {
12 #endif
13  class Database;
14 
16  class IDA_API Types
17  {
19  const Database &m_database;
20 
22  Types() = delete;
23 
24  public:
27  {
29  const Database &m_database;
30 
32  int m_current_index = 0;
33 
35  std::string m_current_named_type;
36 
38  Iterator() = delete;
39 
40  public:
43  Iterator(const Database &database) : m_database(database)
44  {
45  }
46 
49  std::pair<bool, tinfo_t> get_first();
50 
53  std::pair<bool, tinfo_t> get_next();
54  };
55 
56  public:
59  Types(const Database &database) : m_database(database)
60  {
61  }
62 
66  std::pair<bool, std::string> get_type_name(const ea_t ea) const;
67 
72  bool apply_named_type(const ea_t ea, const std::string &type) const;
73 
76  Iterator get_all() const
77  {
78  return Iterator(m_database);
79  }
80  };
81 #ifndef SWIG
82 }
83 #endif
84 
85 #endif // IDA_DOMAIN_TYPE_HPP
Provides access and control over the loaded IDA database.
Definition: database.hpp:25
Iterator for user-defined types in the IDA type system.
Definition: type.hpp:27
Iterator(const Database &database)
Constructs a type iterator for the given database.
Definition: type.hpp:43
std::pair< bool, tinfo_t > get_next()
Retrieves the next user-defined type in the database.
std::pair< bool, tinfo_t > get_first()
Retrieves the first user-defined type in the database.
Provides access to type information and manipulation in the IDA database.
Definition: type.hpp:17
std::pair< bool, std::string > get_type_name(const ea_t ea) const
Retrieves the type information of the item at the given address.
Types(const Database &database)
Constructs a types handler for the given database.
Definition: type.hpp:59
bool apply_named_type(const ea_t ea, const std::string &type) const
Applies a named type to the given address.
Iterator get_all() const
Retrieves an iterator over all user-defined types in the database.
Definition: type.hpp:76
#define IDA_API
Definition: common_defines.hpp:11
#define ABI_VERSION_NS
Definition: version.hpp:17