lib-ruby-parser (C bindings)  4.0.4+ruby-3.1.1
C bindings for lib-ruby-parser library
String

Classes

struct  LIB_RUBY_PARSER_String
 
struct  LIB_RUBY_PARSER_MaybeString
 

Functions

LIB_RUBY_PARSER_String LIB_RUBY_PARSER_new_string_owned (char *s, size_t len)
 
LIB_RUBY_PARSER_String LIB_RUBY_PARSER_new_string_from_cstr (const char *s)
 
void LIB_RUBY_PARSER_drop_string (LIB_RUBY_PARSER_String *string)
 
bool LIB_RUBY_PARSER_maybe_string_is_some (const LIB_RUBY_PARSER_MaybeString *maybe_string)
 
bool LIB_RUBY_PARSER_maybe_string_is_none (const LIB_RUBY_PARSER_MaybeString *maybe_string)
 
void LIB_RUBY_PARSER_drop_maybe_string (LIB_RUBY_PARSER_MaybeString *maybe_string)
 

Detailed Description

Function Documentation

◆ LIB_RUBY_PARSER_drop_maybe_string()

void LIB_RUBY_PARSER_drop_maybe_string ( LIB_RUBY_PARSER_MaybeString maybe_string)

MaybeString destructor. Just like Rust/C++ destructor it performs cleanup of "embedded" resources. i.e. it doesn't call free on a given pointer.

◆ LIB_RUBY_PARSER_drop_string()

void LIB_RUBY_PARSER_drop_string ( LIB_RUBY_PARSER_String string)

String destructor. Just like Rust/C++ destructor it performs cleanup of "embedded" resources. i.e. it doesn't call free on a given pointer.

◆ LIB_RUBY_PARSER_maybe_string_is_none()

bool LIB_RUBY_PARSER_maybe_string_is_none ( const LIB_RUBY_PARSER_MaybeString maybe_string)

Returns true if given pointer is None

◆ LIB_RUBY_PARSER_maybe_string_is_some()

bool LIB_RUBY_PARSER_maybe_string_is_some ( const LIB_RUBY_PARSER_MaybeString maybe_string)

Returns true if given pointer is Some(String)

◆ LIB_RUBY_PARSER_new_string_from_cstr()

LIB_RUBY_PARSER_String LIB_RUBY_PARSER_new_string_from_cstr ( const char *  s)

Construts String from a constant NULL-terminated C stirng. Copies the data, useful for testing.

◆ LIB_RUBY_PARSER_new_string_owned()

LIB_RUBY_PARSER_String LIB_RUBY_PARSER_new_string_owned ( char *  s,
size_t  len 
)

Constructs String from ptr+length. Takes ownership, zero-copy.