Class: RLTK::CG::ConstantString
- Inherits:
-
ConstantArray
- Object
- Value
- User
- Constant
- ConstantAggregate
- ConstantArray
- RLTK::CG::ConstantString
- Defined in:
- lib/rltk/cg/value.rb
Overview
A sub-class of ConstantArray specifically for holding strings.
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#initialize(string, null_terminate = true, context = nil) ⇒ ConstantString
constructor
Create a new constant string value.
Methods inherited from ConstantAggregate
Methods included from AbstractClass
Methods inherited from Constant
#bitcast_to, #get_element_ptr, #get_element_ptr_in_bounds
Methods inherited from User
Methods inherited from Value
#==, #attributes, #bitcast, #constant?, #dump, #hash, #name, #name=, #null?, #print, #trunc, #trunc_or_bitcast, #type, #undefined?, #zextend, #zextend_or_bitcast
Methods included from BindingClass
Constructor Details
#initialize(string, null_terminate = true, context = nil) ⇒ ConstantString
Create a new constant string value.
434 435 436 437 438 439 440 441 442 443 |
# File 'lib/rltk/cg/value.rb', line 434 def initialize(string, null_terminate = true, context = nil) @type = ArrayType.new(Int8Type) @ptr = if context Bindings.const_string_in_context(check_type(context, Context, 'context'), string, string.length, null_terminate.to_i) else Bindings.const_string(string, string.length, null_terminate.to_i) end end |