IDA Domain
comment.hpp
Go to the documentation of this file.
1 #ifndef IDA_DOMAIN_COMMENT_HPP
2 #define IDA_DOMAIN_COMMENT_HPP
3 
4 #include <vector>
6 
7 #ifndef SWIG
9 {
10 #endif
11  class Database;
12 
15  {
17  const Database &m_database;
18 
20  Comments() = delete;
21 
22  public:
25  {
27  const Database &m_database;
28 
30  const bool include_repeatable = false;
31 
33  Iterator() = delete;
34 
36  ea_t m_current_ea = 0;
37 
38  public:
42  Iterator(const Database &database, bool include_repeatable = false)
43  : m_database(database), include_repeatable(include_repeatable)
44  {
45  }
46 
49  std::pair<ea_t, std::string> get_first();
50 
53  std::pair<ea_t, std::string> get_next();
54  };
55 
56  public:
59  Comments(const Database &database) : m_database(database)
60  {
61  }
62 
66  std::pair<bool, std::string> get(const ea_t ea) const;
67 
72  bool set(const ea_t ea, const std::string &comment) const;
73 
77  Iterator get_all(bool include_repeatable) const
78  {
79  return Iterator(m_database, include_repeatable);
80  }
81  };
82 #ifndef SWIG
83 }
84 #endif
85 
86 #endif // IDA_DOMAIN_COMMENT_HPP
Iterator for user-defined comments in the IDA database.
Definition: comment.hpp:25
Iterator(const Database &database, bool include_repeatable=false)
Constructs a comment iterator for the given database.
Definition: comment.hpp:42
std::pair< ea_t, std::string > get_next()
Retrieves the next comment in the database.
std::pair< ea_t, std::string > get_first()
Retrieves the first comment in the database.
Provides access to user-defined comments in the IDA database.
Definition: comment.hpp:15
bool set(const ea_t ea, const std::string &comment) const
Sets a comment at the specified address.
std::pair< bool, std::string > get(const ea_t ea) const
Retrieves the comment at the specified address.
Comments(const Database &database)
Constructs a comment manager for the given database.
Definition: comment.hpp:59
Iterator get_all(bool include_repeatable) const
Creates an iterator for all comments in the database.
Definition: comment.hpp:77
Provides access and control over the loaded IDA database.
Definition: database.hpp:25
#define IDA_API
Definition: common_defines.hpp:11
#define ABI_VERSION_NS
Definition: version.hpp:17