Extended generation of method attributes (#142)
This commit is contained in:
@@ -54,12 +54,19 @@ void to_json(nlohmann::json &j, const class_method &c)
|
||||
{
|
||||
j = dynamic_cast<const class_element &>(c);
|
||||
|
||||
j["is_static"] = c.is_static();
|
||||
j["is_const"] = c.is_const();
|
||||
j["is_defaulted"] = c.is_defaulted();
|
||||
j["is_pure_virtual"] = c.is_pure_virtual();
|
||||
j["is_virtual"] = c.is_virtual();
|
||||
j["is_implicit"] = c.is_implicit();
|
||||
j["is_const"] = c.is_const();
|
||||
j["is_defaulted"] = c.is_defaulted();
|
||||
j["is_deleted"] = c.is_deleted();
|
||||
j["is_static"] = c.is_static();
|
||||
j["is_noexcept"] = c.is_noexcept();
|
||||
j["is_constexpr"] = c.is_constexpr();
|
||||
j["is_consteval"] = c.is_consteval();
|
||||
j["is_constructor"] = c.is_constructor();
|
||||
j["is_move_assignment"] = c.is_move_assignment();
|
||||
j["is_copy_assignment"] = c.is_copy_assignment();
|
||||
j["is_operator"] = c.is_operator();
|
||||
|
||||
j["parameters"] = c.parameters();
|
||||
}
|
||||
|
||||
@@ -189,9 +189,17 @@ void generator::generate(const class_ &c, std::ostream &ostr) const
|
||||
}
|
||||
ostr << ")";
|
||||
|
||||
if (m.is_constexpr())
|
||||
ostr << " constexpr";
|
||||
else if (m.is_consteval())
|
||||
ostr << " consteval";
|
||||
|
||||
if (m.is_const())
|
||||
ostr << " const";
|
||||
|
||||
if (m.is_noexcept())
|
||||
ostr << " noexcept";
|
||||
|
||||
assert(!(m.is_pure_virtual() && m.is_defaulted()));
|
||||
|
||||
if (m.is_pure_virtual())
|
||||
@@ -199,6 +207,8 @@ void generator::generate(const class_ &c, std::ostream &ostr) const
|
||||
|
||||
if (m.is_defaulted())
|
||||
ostr << " = default";
|
||||
else if (m.is_deleted())
|
||||
ostr << " = deleted";
|
||||
|
||||
ostr << " : " << type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user