mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
LibIDL+WrapperGenerator: Make it easier to work with IDL::Type classes
Track the kind of Type it is, and use that to provide some convenient `is_foo()` / `as_foo()` methods. While I was at it, made these all classes instead of structs and made their data private.
This commit is contained in:
parent
c4668053d1
commit
7c8ef79898
6 changed files with 288 additions and 217 deletions
|
@ -112,21 +112,21 @@ int main(int argc, char** argv)
|
|||
for (auto& attribute : interface.attributes) {
|
||||
dbgln(" {}{}{} {}",
|
||||
attribute.readonly ? "readonly " : "",
|
||||
attribute.type->name,
|
||||
attribute.type->nullable ? "?" : "",
|
||||
attribute.type->name(),
|
||||
attribute.type->is_nullable() ? "?" : "",
|
||||
attribute.name);
|
||||
}
|
||||
|
||||
dbgln("Functions:");
|
||||
for (auto& function : interface.functions) {
|
||||
dbgln(" {}{} {}",
|
||||
function.return_type->name,
|
||||
function.return_type->nullable ? "?" : "",
|
||||
function.return_type->name(),
|
||||
function.return_type->is_nullable() ? "?" : "",
|
||||
function.name);
|
||||
for (auto& parameter : function.parameters) {
|
||||
dbgln(" {}{} {}",
|
||||
parameter.type->name,
|
||||
parameter.type->nullable ? "?" : "",
|
||||
parameter.type->name(),
|
||||
parameter.type->is_nullable() ? "?" : "",
|
||||
parameter.name);
|
||||
}
|
||||
}
|
||||
|
@ -134,13 +134,13 @@ int main(int argc, char** argv)
|
|||
dbgln("Static Functions:");
|
||||
for (auto& function : interface.static_functions) {
|
||||
dbgln(" static {}{} {}",
|
||||
function.return_type->name,
|
||||
function.return_type->nullable ? "?" : "",
|
||||
function.return_type->name(),
|
||||
function.return_type->is_nullable() ? "?" : "",
|
||||
function.name);
|
||||
for (auto& parameter : function.parameters) {
|
||||
dbgln(" {}{} {}",
|
||||
parameter.type->name,
|
||||
parameter.type->nullable ? "?" : "",
|
||||
parameter.type->name(),
|
||||
parameter.type->is_nullable() ? "?" : "",
|
||||
parameter.name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue