mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
c_string.h File Reference

mruby/c String class More...

#include "value.h"
Include dependency graph for c_string.h:

Go to the source code of this file.

Data Structures

struct  RString
 String object. More...

Macros

#define MRBC_STRING_SIZE_T   uint16_t
#define RSTRING_LEN(str)
#define RSTRING_PTR(str)

Typedefs

typedef struct RString mrbc_string
 String object.

Functions

static mrbc_value mrbc_string_new_cstr (struct VM *vm, const char *src)
static int mrbc_string_compare (const mrbc_value *v1, const mrbc_value *v2)
static int mrbc_string_size (const mrbc_value *str)
static char * mrbc_string_cstr (const mrbc_value *v)
static int mrbc_string_append_cstr (mrbc_value *s1, const char *s2)

Detailed Description

mruby/c String class

Copyright (C) 2015- Kyushu Institute of Technology.
Copyright (C) 2015- Shimane IT Open-Innovation Center.

This file is distributed under BSD 3-Clause License.

Definition in file c_string.h.

Macro Definition Documentation

◆ MRBC_STRING_SIZE_T

#define MRBC_STRING_SIZE_T   uint16_t

Definition at line 33 of file c_string.h.

◆ RSTRING_LEN

#define RSTRING_LEN ( str)
Value:
static int mrbc_string_size(const mrbc_value *str)
Definition c_string.h:108

Definition at line 37 of file c_string.h.

◆ RSTRING_PTR

#define RSTRING_PTR ( str)
Value:
static char * mrbc_string_cstr(const mrbc_value *v)
Definition c_string.h:116

Definition at line 38 of file c_string.h.

Typedef Documentation

◆ mrbc_string

typedef struct RString mrbc_string

String object.

Function Documentation

◆ mrbc_string_append_cstr()

int mrbc_string_append_cstr ( mrbc_value * s1,
const char * s2 )
inlinestatic

append c string (s1 += s2)

Parameters
s1pointer to target value 1
s2pointer to char (c_str)
Returns
mrbc_error_code

Definition at line 128 of file c_string.h.

Here is the call graph for this function:

◆ mrbc_string_compare()

int mrbc_string_compare ( const mrbc_value * v1,
const mrbc_value * v2 )
inlinestatic

compare

Definition at line 94 of file c_string.h.

Here is the caller graph for this function:

◆ mrbc_string_cstr()

char * mrbc_string_cstr ( const mrbc_value * v)
inlinestatic

get c-language string (char *)

Definition at line 116 of file c_string.h.

Here is the caller graph for this function:

◆ mrbc_string_new_cstr()

mrbc_value mrbc_string_new_cstr ( struct VM * vm,
const char * src )
inlinestatic

constructor by c string

Parameters
vmpointer to VM.
srcsource string or NULL
Returns
string object

Definition at line 85 of file c_string.h.

Here is the call graph for this function:

◆ mrbc_string_size()

int mrbc_string_size ( const mrbc_value * str)
inlinestatic

get size

Definition at line 108 of file c_string.h.

Here is the caller graph for this function: