NAME
src/pmc/packfile.pmc - Packfile PMC
DESCRIPTION
This class implements a Packfile object, as specified in PDD13. This object is the top level parser and serializer for *.pbc files.
Methods
static void copy_packfile_header(PARROT_INTERP, PMC *self, PackFile *pf)
Copy attributes from PackFile* to Packfile PMC.
void init()
Initialize the structure.
(Create a blank PackFile object.)
VTABLE void init_pmc(view)
Create a new PackFile from an existing PackFileView.
void mark()
Marks the Packfile as alive.
STRING *get_string()
Return raw serialized PBC file data.
void set_string_native(STRING *str)
Parse raw serialized PBC file data into the Packfile data structure.
void set_pointer(void *ptr)
Set a raw PackFile* pointer to this Packfile PMC
INTVAL get_integer_keyed_str(STRING *key)
Fetch an integer keyed value from the packfile object.
Valid keys are:
- wordsize
- byteorder
- fptype
- version_major
- version_minor
- version_patch
- bytecode_major
- bytecode_minor
- uuid_type
STRING *get_string_keyed_str(STRING *key)
Fetch a string keyed value from the packfile object.
Valid keys are:
INTVAL get_integer_keyed(PMC *key)
Fetch a keyed integer value from the packfile object.
Dispatches to get_integer_keyed_str.
STRING *get_string_keyed(PMC *key)
Fetch a keyed string value from the packfile object.
Dispatches to get_string_keyed_str.
void set_integer_keyed_str(STRING *key, INTVAL value)
Set an integer keyed value to the specified value.
Valid keys are:
void set_integer_keyed(PMC *key, INTVALval)
Set a keyed integer value in the packfile object.
Dispatches to set_integer_keyed_str.
get_string_keyed_str
(v-table)
Used to get data about fields in the header that have a string value.
Valid keys are:
void set_string_keyed(PMC *key, STRING *val)
Set a keyed string value in the packfile object.
Dispatches to set_string_keyed_str.
STRING * pack()
Return raw serialized PBC file data.
Synonym for get_string.
void unpack(STRING *data)
Parse raw serialized PBC file data into the Packfile data structure.
Synonym for set_string.
PMC *get_directory()
Fetch the PackfileDirectory PMC that represents the directory segment at the start of the packfile.
PMC *view()
Get a PackfileView for the current packfile.
PackfileView is a read-only wrapper around a static packfile structure.
This method creates a fresh copy of the packfile structure and assigns that copy to the new PackfileView PMC.
Auxliary functions
static AttrEnumPackfile getAttrEnum(PARROT_INTERP, const STRING *name)
Gets an enumerated value corresponding to the attribute with that name.