ComparatorLibs: Add stringify to hierarchy for easy printing
This commit is contained in:
@@ -32,6 +32,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string stringify() const
|
||||
{
|
||||
return name + " (" + typeId.stringify() + ")";
|
||||
}
|
||||
|
||||
public:
|
||||
std::string name;
|
||||
ComparatorTypeId typeId;
|
||||
@@ -56,6 +61,20 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string stringify() const
|
||||
{
|
||||
std::string result = "Name: " + name + "\n";
|
||||
result += "Exported Comparator Types:\n";
|
||||
for (size_t i = 0; i < exportedComparatorTypes.size(); ++i)
|
||||
{
|
||||
result += " - " + exportedComparatorTypes[i].stringify();
|
||||
if (i + 1 < exportedComparatorTypes.size()) {
|
||||
result += "\n";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public:
|
||||
std::string name;
|
||||
std::vector<ExportedComparatorTypeDesc> exportedComparatorTypes;
|
||||
|
||||
Reference in New Issue
Block a user