diff --git a/lib/ffi/upskirt/buffer.rb b/lib/ffi/upskirt/buffer.rb index dec7e03..c991c98 100644 --- a/lib/ffi/upskirt/buffer.rb +++ b/lib/ffi/upskirt/buffer.rb @@ -1,4 +1,4 @@ -require 'ffi' +require 'ffi/upskirt/upskirt' module FFI module Upskirt @@ -10,6 +10,16 @@ class Buffer < FFI::Struct :unit, :size_t, :ref, :int + def to_smartypants + smart_buffer = Upskirt.bufnew(128) + + Upskirt.upshtml_smartypants(smart_buffer,self) + result = smart_buffer.data.get_string(0,smart_buffer.size) + + smart_buffer.free + return result + end + end end end