ROSE 0.11.145.192
|
Base class for printing table cells.
Three kinds of callback are defined:
Subclasses almost always override the data content callback, but seldom override the others. The default heading and separator callback knows how to print a properly formatted column heading, and the default before and after callback does nothing, but could be used to print keys, footnotes, etc.
If a callback has no column name and zero width, then its header and content callback is not invoked; its content callback is still invoked but should not produce any output.
Definition at line 329 of file AsmFunctionIndex.h.
#include <Rose/BinaryAnalysis/AsmFunctionIndex.h>
Classes | |
struct | BeforeAfterArgs |
Arguments for before-and after. More... | |
struct | DataArgs |
Arguments for column cells. More... | |
struct | GeneralArgs |
Base class for callback arguments. More... | |
struct | HeadingArgs |
Arguments for column heading callbacks. More... | |
Public Member Functions | |
OutputCallback (const std::string &name, size_t width, const std::string description="") | |
Constructor. | |
void | set_prefix (const std::string &header, const std::string &separator=" ", const std::string &data=" ") |
Set prefix characters. | |
virtual bool | operator() (bool enabled, const BeforeAfterArgs &) |
Callback for before and after the table. | |
virtual bool | operator() (bool enabled, const HeadingArgs &) |
Callback to print a column heading. | |
virtual bool | operator() (bool enabled, const DataArgs &) |
Callback to print data for a table cell. | |
Protected Member Functions | |
std::string | center (const std::string &, size_t width) |
Center s in a string of length width . | |
Protected Attributes | |
std::string | name |
Column name used when printing table headers. | |
std::string | desc |
Optional description to appear in footnote. | |
size_t | width |
Minimum width of column header or data. | |
std::string | header_prefix |
Character(s) to print before headings. | |
std::string | separator_prefix |
Character(s) to print before line separators. | |
std::string | data_prefix |
Character(s) to print before data cells. | |
|
inline |
Constructor.
Every column must have a name and non-zero width. If a column is given a description then the column name will reference a footnote containing the description. The footnote is added by the default HeadingArgs callback, so subclasses should take care to add their own footnote if necessary.
Definition at line 366 of file AsmFunctionIndex.h.
|
inlinevirtual |
Definition at line 371 of file AsmFunctionIndex.h.
|
virtual |
Callback for before and after the table.
The default does nothing, but subclasses can override this to do things like print descriptions, footnotes, etc.
Reimplemented in Rose::BinaryAnalysis::AsmFunctionIndex::FootnotesCallback.
|
virtual |
Callback to print a column heading.
The base class implementation prints the column name using the specified column width. Subclasses probably don't need to override this method.
Reimplemented in Rose::BinaryAnalysis::AsmFunctionIndex::ReasonCallback, and Rose::BinaryAnalysis::AsmFunctionIndex::StackDeltaCallback.
|
virtual |
Callback to print data for a table cell.
The base class implementation prints white space only, so subclasses almost certainly want to override this method.
Reimplemented in Rose::BinaryAnalysis::AsmFunctionIndex::RowIdCallback, Rose::BinaryAnalysis::AsmFunctionIndex::EntryAddrCallback, Rose::BinaryAnalysis::AsmFunctionIndex::BeginAddrCallback, Rose::BinaryAnalysis::AsmFunctionIndex::EndAddrCallback, Rose::BinaryAnalysis::AsmFunctionIndex::SizeInsnsCallback, Rose::BinaryAnalysis::AsmFunctionIndex::SizeBytesCallback, Rose::BinaryAnalysis::AsmFunctionIndex::ReasonCallback, Rose::BinaryAnalysis::AsmFunctionIndex::CallingConventionCallback, Rose::BinaryAnalysis::AsmFunctionIndex::MayReturnCallback, Rose::BinaryAnalysis::AsmFunctionIndex::StackDeltaCallback, and Rose::BinaryAnalysis::AsmFunctionIndex::NameCallback.
|
protected |
Column name used when printing table headers.
Definition at line 391 of file AsmFunctionIndex.h.
Referenced by OutputCallback().
|
protected |
Optional description to appear in footnote.
Definition at line 392 of file AsmFunctionIndex.h.
|
protected |
Minimum width of column header or data.
Definition at line 393 of file AsmFunctionIndex.h.
Referenced by OutputCallback().
|
protected |
Character(s) to print before headings.
Definition at line 394 of file AsmFunctionIndex.h.
|
protected |
Character(s) to print before line separators.
Definition at line 395 of file AsmFunctionIndex.h.
|
protected |
Character(s) to print before data cells.
Definition at line 396 of file AsmFunctionIndex.h.