NAME ^

pmc/luastring.pmc - Lua String

DESCRIPTION ^

LuaString extends LuaBase to provide a class with the behaviour of the Lua String type.

Overloaded Methods ^

void init()

Initializes the string.

PMC *new_from_string(STRING *rep, INTVAL flags)

Allow :

    .const .LuaString s = "Hello World!"
void morph(INTVAL type)

Morphs the scalar to the specified type.

void mark()

Marks the string as live.

PMC *clone()

Creates a copy of the string.

STRING *get_string()

Returns the string itself.

STRING *name()

Return the string "string".

void set_integer_native (INTVAL value)

void set_number_native(FLOATVAL value)

VOID set_string_native(STRING *value)

Sets the value of the string to that of the specified string.

PMC *get_pmc_keyed (PMC *key)

PMC *neg (PMC *dest)

void i_neg ()

INTVAL elements ()

Return length of the string.

void freeze(visit_info *info)

Used to archive the string.

void thaw(visit_info *info)

Used to unarchive the string.

non-Vtable Methods ^

PMC *add (PMC *value, PMC *dest)

void i_add (PMC *value)

PMC *subtract (PMC *value, PMC *dest)

void i_subtract (PMC *value)

PMC *multiply (PMC *value, PMC *dest)

void i_multiply (PMC *value)

PMC *divide (PMC *value, PMC *dest)

void i_divide (PMC *value)

PMC *modulus (PMC *value, PMC *dest)

void i_modulus (PMC *value)

PMC *pow (PMC *value, PMC *dest)

void i_pow (PMC *value)

INTVAL is_equal (PMC *value)

Compares the string with value; returns true if they match.

INTVAL cmp (PMC *value)

Compares the string with value; returns -1 if the string is smaller, 0 if they are equal, and 1 if value is smaller.

Throws an exception unless value is a LuaString.

PMC *concatenate(PMC *value, PMC *dest)

void i_concatenate (PMC *value)

Specific Methods ^

PMC *len()

PMC *rawequal (PMC *value)

PMC *tonumber()

PMC *tobase(INTVAL base)

AUTHORS ^

Francois Perrad.

Klaas-Jan Stol.


parrot