decompiler
1.0.0
|
An in-memory implementation of the CommentDatabase API. More...
#include <comment.hh>
Public Member Functions | |
CommentDatabaseInternal (void) | |
Constructor. | |
virtual void | clear (void) |
Clear all comments from this container. | |
virtual void | clearType (const Address &fad, uint4 tp) |
Clear all comments matching (one of) the indicated types. More... | |
virtual void | addComment (uint4 tp, const Address &fad, const Address &ad, const string &txt) |
Add a new comment to the container. More... | |
virtual bool | addCommentNoDuplicate (uint4 tp, const Address &fad, const Address &ad, const string &txt) |
Add a new comment to the container, making sure there is no duplicate. More... | |
virtual void | deleteComment (Comment *com) |
Remove the given Comment object from the container. More... | |
virtual CommentSet::const_iterator | beginComment (const Address &fad) const |
Get an iterator to the beginning of comments for a single function. More... | |
virtual CommentSet::const_iterator | endComment (const Address &fad) const |
Get an iterator to the ending of comments for a single function. More... | |
virtual void | encode (Encoder &encoder) const |
Encode all comments in the container to a stream. More... | |
virtual void | decode (Decoder &decoder) |
Restore all comments from a <commentdb> element. More... | |
Public Member Functions inherited from ghidra::CommentDatabase | |
CommentDatabase (void) | |
Constructor. | |
virtual | ~CommentDatabase (void) |
Destructor. | |
Private Attributes | |
CommentSet | commentset |
The sorted set of Comment objects. | |
An in-memory implementation of the CommentDatabase API.
All Comment objects are held in memory in a sorted container. This can be used as stand-alone database of comments, or it can act as a cache for some other container.
|
virtual |
Add a new comment to the container.
tp | is a set of properties to associate with the new comment (may be zero) |
fad | is the address of the function to which the comment belongs |
ad | is the address to which the comment is attached |
txt | is the body of the comment |
Implements ghidra::CommentDatabase.
References commentset, and ghidra::Comment::uniq.
Referenced by ghidra::CommentDatabaseGhidra::addComment(), and decode().
|
virtual |
Add a new comment to the container, making sure there is no duplicate.
If there is already a comment at the same address with the same body, no new comment is added.
tp | is a set of properties to associate with the new comment (may be zero) |
fad | is the address of the function to which the comment belongs |
ad | is the address to which the comment is attached |
txt | is the body of the comment |
Implements ghidra::CommentDatabase.
References commentset, and ghidra::Comment::uniq.
Referenced by ghidra::CommentDatabaseGhidra::addCommentNoDuplicate().
|
virtual |
Get an iterator to the beginning of comments for a single function.
fad | is the address of the function |
Implements ghidra::CommentDatabase.
References commentset, and ghidra::Address::m_minimal.
Referenced by ghidra::CommentDatabaseGhidra::beginComment(), and ghidra::CommentDatabaseGhidra::fillCache().
|
virtual |
Clear all comments matching (one of) the indicated types.
Clearing is restricted to comments belonging to a specific function and matching at least one of the given properties
fad | is the address of the owning function |
tp | is a set of one or more properties |
Implements ghidra::CommentDatabase.
References commentset, ghidra::Address::m_maximal, and ghidra::Address::m_minimal.
Referenced by ghidra::CommentDatabaseGhidra::clearType().
|
virtual |
Restore all comments from a <commentdb> element.
decoder | is the stream decoder |
Implements ghidra::CommentDatabase.
References addComment(), ghidra::Decoder::closeElement(), ghidra::Comment::decode(), ghidra::Comment::getAddr(), ghidra::Comment::getFuncAddr(), ghidra::Comment::getText(), ghidra::Comment::getType(), ghidra::Decoder::openElement(), and ghidra::Decoder::peekElement().
Referenced by ghidra::CommentDatabaseGhidra::fillCache().
|
virtual |
Remove the given Comment object from the container.
com | is the given Comment |
Implements ghidra::CommentDatabase.
References commentset.
|
virtual |
Encode all comments in the container to a stream.
Writes a <commentdb> element, with <comment> children for each Comment object.
encoder | is the stream encoder |
Implements ghidra::CommentDatabase.
References ghidra::Encoder::closeElement(), commentset, and ghidra::Encoder::openElement().
|
virtual |
Get an iterator to the ending of comments for a single function.
fad | is the address of the function |
Implements ghidra::CommentDatabase.
References commentset, and ghidra::Address::m_maximal.
Referenced by ghidra::CommentDatabaseGhidra::endComment(), and ghidra::CommentDatabaseGhidra::fillCache().