class Bindgen::Parser::Argument
- Bindgen::Parser::Argument
- Bindgen::Parser::Type
- Reference
- Object
Overview
Describes a method argument.
Included Modules
- JSON::Serializable
Defined in:
bindgen/parser/argument.crConstructors
- .new(name : String, base_name, full_name, const, reference, move, builtin, void, pointer, template, kind = Type::Kind::Class, has_default : Bool = false, value : Bool | Float64 | Int64 | String | UInt64 | Nil = nil, nilable = false, variadic : Bool = false)
- .new(name : String, type : Type, has_default : Bool = false, value : Bool | Float64 | Int64 | String | UInt64 | Nil = nil)
-
.new(pull : JSON::PullParser)
Describes a method argument.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. -
#defaults_to_nil? : Bool
If this is a pointer-type, does it default to
nullptr
in C++? - #has_default? : Bool
-
#has_exposed_default?
Does this argument have an exposed default value?
-
#hash(hasher)
See
Object#hash(hasher)
-
#merge(other : Argument)
Merges this argument with other.
-
#name : String
Name of this argument.
-
#nilable? : Bool
Assume that if the argument defaults to
nullptr
, that it is nilable. -
#substitute_type(name : String, with type : Type) : Argument
Substitutes all uses of name on the type part of this argument with the given type.
-
#substitute_type(replacements : Hash(String, Type)) : Argument
Performs type substitution on the type part of this argument using the given replacements.
-
#type_equals?(other : Type)
Checks if the type-part of this equals the type-part of other.
- #value : DefaultValueTypes | Nil
- #variadic? : Bool
-
#without_default : Argument
Returns a copy of this argument without a default value.
Instance methods inherited from class Bindgen::Parser::Type
==(other : self)
==,
base_name : String
base_name,
builtin? : Bool
builtin?,
const? : Bool
const?,
decayed : Type | Nil
decayed,
equals_except_nil?(other : Type)
equals_except_nil?,
full_name : String
full_name,
hash(hasher)
hash,
kind : Bindgen::Parser::Type::Kind
kind,
make_pointer_nilable : Type | Nil
make_pointer_nilable,
mangled_name
mangled_name,
move? : Bool
move?,
nilable? : Bool
nilable?,
pointer : Int32
pointer,
pure_void?
pure_void?,
reference? : Bool
reference?,
substitute(name : String, with type : Type) : Typesubstitute(replacements : Hash(String, Type)) : Type
substitute(replacements : Tuple(String, Type)) : Type substitute, template : Template | Nil template, uses_typename?(name : String) uses_typename?, void? : Bool void?
Constructor methods inherited from class Bindgen::Parser::Type
new(base_name : String, full_name : String, const : Bool, reference : Bool, pointer : Int32, move : Bool = false, builtin : Bool = false, void : Bool = false, kind : Bindgen::Parser::Type::Kind = Kind::Class, template : Nil | Bindgen::Parser::Template = nil, nilable : Bool = false)new(pull : JSON::PullParser) new
Class methods inherited from class Bindgen::Parser::Type
builtin_type(cpp_name : String, pointer = 0, reference = false)
builtin_type,
parse(type_name : String, pointer_depth = 0)
parse,
proc(return_type : Type, arguments : Enumerable(Type))
proc
Constructor Detail
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.
Merges this argument with other. Only merges defaultness, its value and nil-ability. For the value, this argument takes precedence over other.
Substitutes all uses of name on the type part of this argument with the given type.
Performs type substitution on the type part of this argument using the given replacements.
Checks if the type-part of this equals the type-part of other.
Returns a copy of this argument without a default value.