Add serialization example
This commit is contained in:
parent
b69e7bfacd
commit
9329fc75ec
6 changed files with 174 additions and 26 deletions
|
|
@ -16,8 +16,9 @@ void generate_to_string(const cppast::cpp_file& file)
|
|||
{
|
||||
cppast::visit(file,
|
||||
[](const cppast::cpp_entity& e) {
|
||||
// only visit enums that have the attribute set
|
||||
// only visit enum definitions that have the attribute set
|
||||
return (e.kind() == cppast::cpp_entity_kind::enum_t
|
||||
&& cppast::is_definition(e)
|
||||
&& cppast::has_attribute(e, "generate::to_string"))
|
||||
// or all namespaces
|
||||
|| e.kind() == cppast::cpp_entity_kind::namespace_t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue