Class: Assimp::String

Inherits:
FFI::Struct
  • Object
show all
Extended by:
StructAccessors
Defined in:
lib/assimp/types.rb,
lib/assimp/base.rb,
lib/assimp/types.rb

Overview

< FFI::Struct

Constant Summary collapse

MAXLEN =
1024

Instance Method Summary collapse

Methods included from StructAccessors

extended, has_ref?, struct_array_attr_accessor, struct_array_attr_checker, struct_array_attr_reader, struct_array_attr_writer, struct_attr_accessor, struct_attr_reader, struct_attr_writer, struct_ref_array_attr_accessor, struct_ref_array_attr_reader, struct_ref_array_attr_writer

Instance Method Details

#dataObject



46
47
48
# File 'lib/assimp/types.rb', line 46

def data
  (pointer + 4).read_string(length)
end

#data=(str) ⇒ Object



50
51
52
53
54
55
# File 'lib/assimp/types.rb', line 50

def data=(str)
  sz = str.bytesize
  raise "String too long #{sz} > #{MAXLEN-1}!" if sz > MAXLEN-1
  self[:length] = sz
  (pointer + 4).write_string(str+"\x00")
end

#to_sObject



57
58
59
# File 'lib/assimp/types.rb', line 57

def to_s
  data
end