NAME

src/pmc/packfiledirectory.pmc - PackfileDirectory PMC

DESCRIPTION

This class implements a PackfileDirectory object, a segment of the .pbc data file used for listing the rest of the file's contents. Essentially this segment is a container for all other segments within a Packfile.

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

void init()
Initialize PackfileDirectory.
void mark()
Marks the object as live.
void destroy()
Destroys the PMC and frees all allocated memory.
void set_pointer(void *ptr)
Initialize PackfileDirectory from PackFile_Directory.
void *get_pointer()
Creates PackFile for given directory.
INTVAL elements()
Get the number of elements in the array.
PMC *get_iter()
Return a new iterator for the directory.
PMC *get_pmc_keyed_str(STRING *name)
Search the array for a segment with the given name, and return it if it exists.
PMC *get_pmc_keyed(PMC *key)
Fetch a keyed string value from the packfiledirectory object.
void set_pmc_keyed_str(STRING *name, PMC *segment)
Add a segment with the given name to the directory. If a segment with this name already existed, it will be replaced with the new segment.
PMC *set_pmc_keyed(PMC *key)
Add a segment with the given name to the directory. Dispatches to set_pmc_keyed_str.