struct Novika::FFI::Cstr

Overview

Type-side and value-side representation of C string (a u8 pointer). In Novika, C string is represented by a quote.

Included Modules

Extended Modules

Defined in:

novika/ffi.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Novika::FFI::ForeignValue

box : Pointer(Void) box, must_be_of(type : ForeignType) must_be_of, to_form? : Form | Nil to_form?, write_to!(base : Pointer(Void)) : Pointer(Void) write_to!

Constructor Detail

def self.new(string : String) #

Class Method Detail

def self.alloc : Pointer(Void) #

def self.from?(form : Quote) #

def self.matches?(value : Cstr) #

def self.to_ffi_type : Crystal::FFI::Type #

def self.to_s(io) #

def self.unbox(box : Pointer(Void)) : ForeignValue #

Instance Method Detail

def ==(other : self) #

def box : Pointer(Void) #
Description copied from module Novika::FFI::ForeignValue

Wraps this value in a void pointer.


def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


def to_crystal : String #

Returns the corresponding Crystal string.


def to_form? : Form | Nil #
Description copied from module Novika::FFI::ForeignValue

Determines the best form type to represent this foreign value, then builds and returns a form of that type.

Returns nil if value is nothing.


def to_s(io) #

def write_to!(base : Pointer(Void)) : Pointer(Void) #
Description copied from module Novika::FFI::ForeignValue

Writes this value starting at the given base pointer. Returns the base pointer.