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) #

[View source]

Class Method Detail

def self.alloc : Pointer(Void) #

[View source]
def self.from?(form : Quote) #

[View source]
def self.matches?(value : Cstr) #

[View source]
def self.to_ffi_type : Crystal::FFI::Type #

[View source]
def self.to_s(io) #

[View source]
def self.unbox(box : Pointer(Void)) : ForeignValue #

[View source]

Instance Method Detail

def ==(other : self) #

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

Wraps this value in a void pointer.


[View source]
def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


def to_crystal : String #

Returns the corresponding Crystal string.


[View source]
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.


[View source]
def to_s(io) #

[View source]
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.


[View source]