class Bindgen::Parser::Argument

Overview

Describes a method argument.

Included Modules

Defined in:

bindgen/parser/argument.cr

Constructors

Instance Method Summary

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) : Type
substitute(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

def self.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) #

[View source]
def self.new(name : String, type : Type, has_default : Bool = false, value : Bool | Float64 | Int64 | String | UInt64 | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

Describes a method argument.


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def defaults_to_nil? : Bool #

If this is a pointer-type, does it default to nullptr in C++?


[View source]
def has_default? : Bool #

[View source]
def has_exposed_default? #

Does this argument have an exposed default value?


[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def merge(other : Argument) #

Merges this argument with other. Only merges defaultness, its value and nil-ability. For the value, this argument takes precedence over other.


[View source]
def name : String #

Name of this argument.


[View source]
def nilable? : Bool #

Assume that if the argument defaults to nullptr, that it is nilable.


[View source]
def substitute_type(name : String, with type : Type) : Argument #

Substitutes all uses of name on the type part of this argument with the given type.


[View source]
def substitute_type(replacements : Hash(String, Type)) : Argument #

Performs type substitution on the type part of this argument using the given replacements.


[View source]
def type_equals?(other : Type) #

Checks if the type-part of this equals the type-part of other.


[View source]
def value : DefaultValueTypes | Nil #

[View source]
def variadic? : Bool #

[View source]
def without_default : Argument #

Returns a copy of this argument without a default value.


[View source]