Represents an enumerated value, with named options.
More...
#include <dumper.h>
|
|
| ChoiceDisplay (std::map< offset_t, std::string > names, std::string default_name, bool missing_on_value, offset_t missing_value, std::shared_ptr< Display< offset_t > > secondary_display) |
| |
|
bool | IsMissing (std::tuple< offset_t > &values) override |
| |
|
void | DisplayValue (Dumper &dump, std::tuple< offset_t > values) override |
| |
|
virtual bool | IsMissing (std::tuple< Ts... > &values) |
| | Returns true if the specified value is such that it should not be displayed.
|
| |
|
virtual void | DisplayValue (Dumper &dump, std::tuple< Ts... > values)=0 |
| | Prints the value through the Dumper, different types of fields can be displayed in different ways.
|
| |
|
| static std::shared_ptr< ChoiceDisplay > | Make (std::map< offset_t, std::string > names, std::string default_name="unknown", std::shared_ptr< Display< offset_t > > secondary_display=nullptr) |
| | Create a choice display.
|
| |
| static std::shared_ptr< ChoiceDisplay > | Make (std::map< offset_t, std::string > names, offset_t missing_value, std::string default_name="unknown", std::shared_ptr< Display< offset_t > > secondary_display=nullptr) |
| | Create a choice display.
|
| |
| static std::shared_ptr< ChoiceDisplay > | Make (std::map< offset_t, std::string > names, std::shared_ptr< Display< offset_t > > secondary_display) |
| | Create a choice display.
|
| |
| static std::shared_ptr< ChoiceDisplay > | Make (std::map< offset_t, std::string > names, offset_t missing_value, std::shared_ptr< Display< offset_t > > secondary_display) |
| | Create a choice display.
|
| |
| static std::shared_ptr< ChoiceDisplay > | Make (std::string on_true, std::string on_false) |
| | Creates a boolean choice.
|
| |
| static std::shared_ptr< ChoiceDisplay > | Make (std::string on_true) |
| | Creates a boolean choice that is either present with name or not present at all.
|
| |
|
|
std::map< offset_t, std::string > | names |
| | Maps values to names.
|
| |
|
std::string | default_name |
| | Name for values not contained in names.
|
| |
|
bool | missing_on_value |
| | If false, any value not listed in names is missing, otherwise only missing_value is missing.
|
| |
|
offset_t | missing_value |
| | The single missing value, only used for missing_on_value true.
|
| |
|
std::shared_ptr< Display< offset_t > > | secondary_display |
| | Alternative representation, appearing in parentheses after the value.
|
| |
Represents an enumerated value, with named options.
◆ Make() [1/6]
| static std::shared_ptr< ChoiceDisplay > Dumper::ChoiceDisplay::Make |
( |
std::map< offset_t, std::string > | names, |
|
|
offset_t | missing_value, |
|
|
std::shared_ptr< Display< offset_t > > | secondary_display ) |
|
inlinestatic |
Create a choice display.
- Parameters
-
| [in] | names | A lookup table that maps certain values to their string representation |
| [in] | missing_value | The value that is considered missing |
| [in] | secondary_display | Displays the value within parentheses after the name. If a secondary display is not provided, only the name is displayed |
- Returns
- A choice display
◆ Make() [2/6]
| static std::shared_ptr< ChoiceDisplay > Dumper::ChoiceDisplay::Make |
( |
std::map< offset_t, std::string > | names, |
|
|
offset_t | missing_value, |
|
|
std::string | default_name = "unknown", |
|
|
std::shared_ptr< Display< offset_t > > | secondary_display = nullptr ) |
|
inlinestatic |
Create a choice display.
- Parameters
-
| [in] | names | A lookup table that maps certain values to their string representation |
| [in] | missing_value | The value that is considered missing |
| [in] | default_name | The string to print when the value cannot be found in the lookup table |
| [in] | secondary_display | Displays the value within parentheses after the name. If a secondary display is not provided, only the name is displayed |
- Returns
- A choice display
◆ Make() [3/6]
| static std::shared_ptr< ChoiceDisplay > Dumper::ChoiceDisplay::Make |
( |
std::map< offset_t, std::string > | names, |
|
|
std::shared_ptr< Display< offset_t > > | secondary_display ) |
|
inlinestatic |
Create a choice display.
- Parameters
-
| [in] | names | A lookup table that maps certain values to their string representation |
| [in] | secondary_display | Displays the value within parentheses after the name. If a secondary display is not provided, only the name is displayed |
- Returns
- A choice display
◆ Make() [4/6]
| static std::shared_ptr< ChoiceDisplay > Dumper::ChoiceDisplay::Make |
( |
std::map< offset_t, std::string > | names, |
|
|
std::string | default_name = "unknown", |
|
|
std::shared_ptr< Display< offset_t > > | secondary_display = nullptr ) |
|
inlinestatic |
Create a choice display.
- Parameters
-
| [in] | names | A lookup table that maps certain values to their string representation |
| [in] | default_name | The string to print when the value cannot be found in the lookup table |
| [in] | secondary_display | Displays the value within parentheses after the name. If a secondary display is not provided, only the name is displayed |
- Returns
- A choice display
◆ Make() [5/6]
| static std::shared_ptr< ChoiceDisplay > Dumper::ChoiceDisplay::Make |
( |
std::string | on_true | ) |
|
|
inlinestatic |
Creates a boolean choice that is either present with name or not present at all.
- Parameters
-
| [in] | on_true | Name to display on 1 |
- Returns
- A choice display
◆ Make() [6/6]
| static std::shared_ptr< ChoiceDisplay > Dumper::ChoiceDisplay::Make |
( |
std::string | on_true, |
|
|
std::string | on_false ) |
|
inlinestatic |
Creates a boolean choice.
- Parameters
-
| [in] | on_true | Name to display on 1 |
| [in] | on_false | Name to display on 0 |
- Returns
- A choice display
The documentation for this class was generated from the following files:
- src/dumper/dumper.h
- src/dumper/dumper.cc