class GL::Registry::NativeType
Describes the native type for a return or parameter value.
Attributes
@return [Symbol] the basic type, excluding any constant constraints, pointer symbols, etc. as a Symbol.
@return [String?] a group that is associated with this type.
@return [String] the full native type, including constant constraints, pointer symbols, etc. @note This is essentially the “raw” and fully-qualified type as it would appear in the C language.
Public Class Methods
Creates a new instance fo the {NativeType} class.
@param type [String] The full native type, including constant constraints, pointer symbols, etc. @param base [String?] The basic type, excluding any constant constraints, pointer symbols, etc. @param group [String?] A group that is associated with this type.
# File lib/opengl/registry/native_type.rb, line 28 def initialize(type, base, group) @type = type.strip @base = base ? base.to_sym : :GLvoid @group = group end
Public Instance Methods
@return [Boolean] `true` if value is a C-style pointer that can not be modified, otherwise `false`.
# File lib/opengl/registry/native_type.rb, line 42 def const? /^const /.match?(@type) end
@return [Boolean] `true` if value is a C-style pointer that may be modified, otherwise `false`.
# File lib/opengl/registry/native_type.rb, line 48 def out? @type.include?('*') && !/\bconst\b/.match?(@type) end
@return [Boolean] `true` if this a C-style pointer type, otherwise `false`.
# File lib/opengl/registry/native_type.rb, line 36 def pointer? @type.include?('*') end
@return [String] the string representation of this object.
# File lib/opengl/registry/native_type.rb, line 54 def to_s @type end