Module: RDF::Raptor::FFI::V1

Extended by:
FFI::Library
Defined in:
lib/rdf/raptor/ffi/v1.rb,
lib/rdf/raptor/ffi/v1/uri.rb,
lib/rdf/raptor/ffi/v1/parser.rb,
lib/rdf/raptor/ffi/v1/iostream.rb,
lib/rdf/raptor/ffi/v1/statement.rb,
lib/rdf/raptor/ffi/v1/serializer.rb,
lib/rdf/raptor/ffi/v1/iostream_handler.rb

Overview

A foreign-function interface (FFI) to libraptor 1.4.x.

Defined Under Namespace

Classes: IOStream, IOStreamHandler, Parser, Serializer, Statement, URI

Constant Summary collapse

RAPTOR_IDENTIFIER_TYPE_UNKNOWN =

TODO: Ideally this would be an enum, but the JRuby FFI (as of version 1.4.0) has problems with enums as part of structs: Unknown field type: #<FFI::Enum> (ArgumentError)

0
RAPTOR_IDENTIFIER_TYPE_RESOURCE =
1
RAPTOR_IDENTIFIER_TYPE_ANONYMOUS =
2
RAPTOR_IDENTIFIER_TYPE_LITERAL =
5

Class Method Summary collapse

Class Method Details

.raptor_free_stringObject



130
# File 'lib/rdf/raptor/ffi/v1.rb', line 130

alias_method :raptor_free_string, :raptor_free_memory

.raptor_new_string(str) ⇒ FFI::Pointer

Allocates memory for the string str inside libraptor, copying the string into the newly-allocated buffer.

The buffer should later be deallocated using raptor_free_string.

Returns:

  • (FFI::Pointer)


123
124
125
126
127
# File 'lib/rdf/raptor/ffi/v1.rb', line 123

def raptor_new_string(str)
  ptr = V1.raptor_alloc_memory(str.bytesize + 1)
  ptr.put_string(0, str)
  ptr
end