lib/vulkan/conversions.rb
# Converts a byte array (array of numbers) representing a null-terminated
# C-string into a Ruby string.
Converts a byte array (array of numbers) representing a null-terminated
C-string into a Ruby string.
Converts a byte array ( array of numbers ) representing a null - terminated C - string into a Ruby string .
def cstr_to_rbstr(byte_array_or_ptr)
      case byte_array_or_ptr
      when Fiddle::Pointer then byte_array_or_ptr.to_s
      else byte_array_or_ptr.pack('C*').sub(/\x00*\z/, '')
      end
    end
def cstr_to_rbstr ( byte_array_or_ptr ) case byte_array_or_ptr when Fiddle :: Pointer then byte_array_or_ptr . to_s else byte_array_or_ptr . pack ( 'C*' ) . sub ( / \x00 * \z / , '' ) end end
Converts a byte array (array of numbers) representing a null-terminated
C-string into a Ruby string.
Converts a byte array ( array of numbers ) representing a null - terminated C - string into a Ruby string .
byte_array_or_ptr
<not_specific>