Author: infinoid
Date: Fri Jul 18 20:33:32 2008
New Revision: 29607
Modified:
branches/pdd13pbc/src/pmc/packfile.pmc
Log:
[PDD13] First stab at Packfile.set_integer_keyed_str
Modified: branches/pdd13pbc/src/pmc/packfile.pmc
==============================================================================
--- branches/pdd13pbc/src/pmc/packfile.pmc (original)
+++ branches/pdd13pbc/src/pmc/packfile.pmc Fri Jul 18 20:33:32 2008
@@ -233,7 +233,26 @@
*/
VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
- real_exception(interp, NULL, E_NotImplementedError, "Not implemented
yet.");
+ PackFile *pf = PMC_data_typed(SELF, PackFile *);
+ if (!string_compare(interp, key, CONST_STRING(interp,
"version_major"))) {
+ pf->header->major = value;
+ return;
+ }
+ if (!string_compare(interp, key, CONST_STRING(interp,
"version_minor"))) {
+ pf->header->minor = value;
+ return;
+ }
+ if (!string_compare(interp, key, CONST_STRING(interp,
"version_patch"))) {
+ pf->header->patch = value;
+ return;
+ }
+ if (!string_compare(interp, key, CONST_STRING(interp, "uuid_type"))) {
+ pf->header->uuid_type = value;
+ return;
+ }
+ real_exception(interp, NULL, E_KeyError,
+ "PackFile: No such integer key \"%s\"",
+ Parrot_string_cstring(interp, key));
}
/*