NAME ^

src/pmc/packfileconstanttable.pmc - PackfileConstantTable PMC

DESCRIPTION ^

This class implements a PackfileConstantTable object, a segment of the .pbc data file used for storing constants of various types. (int, string, PMC)

See packfile.pmc for the toplevel Packfile interface, see packfilesegment.pmc for the list of common methods every packfile segment pmc must implement; see PDD13 for the design spec.

Methods ^

INTVAL elements()

Get the number of elements in the array.

FLOATVAL get_number_keyed_int(INTVAL index)

Fetch a numeric constant. An exception is thrown if the given constant isn't numeric.

STRING *get_string_keyed_int(INTVAL index)

Fetch a string constant. An exception is thrown if the given constant isn't a string.

PMC *get_pmc_keyed_int(INTVAL index)

Fetch a PMC constant. An exception is thrown if the given constant isn't a PMC.

void set_number_keyed_int(INTVAL index, INTVAL value)

Set the constant to the given number.

void set_string_keyed_int(INTVAL index, STRING *value)

Set the constant to the given string.

void set_pmc_keyed_int(INTVAL index, PMC *value)

Set the constant to the given PMC (or key).

INTVAL get_type(INTVAL index)

Get the type of the specified constant. Possible type IDs:

0x00 - No constant

0x6E - Number constant

0x73 - String constant

0x70 - PMC constant

0x6B - Key constant


parrot