Sha256: deb0f297113cb9fdbc44ffe003d116afc51babb17fa21d796f5640df644903bb

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2010, by Jari Bakken.
# Copyright, 2012, by Hal Brodigan.
# Copyright, 2013-2022, by Samuel Williams.

module FFI
	module Clang
		module Lib
			class CXString < FFI::Struct
				layout(
					:data, :pointer,
					:private_flags, :uint
				)
			end

			attach_function :get_string, :clang_getCString, [CXString.by_value], :string
			attach_function :dispose_string, :clang_disposeString, [CXString.by_value], :void

			def self.extract_string(cxstring)
				result = get_string(cxstring)
				dispose_string cxstring

				return result
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffi-clang-0.8.0 lib/ffi/clang/lib/string.rb