I develop Roxen modules and since I sometimes needs to handle the _encode and _decode process for my objects since that is not handled automatically for me.
class MyEntityClass(Calendar.Minute min) { inherit RXML.Scope; constant is_RXML_encodable = 1;
array(int|string) _encode() { array(int|string) a = ({ time->unix_time(), min->language()->name }); // ---------- here it is used -----------------^ return a; }
void _decode (array(int|string) a) { [int t, string lang] = a; time = Calendar.set_language(lang)->Second ("unix", t); cal = 0; }
`[](string var, void|RXML.Context ctx, void|RXML.Type want_type) { [...] } }
Otherwise I have to look at what _sprintf tells me the object name is which i.e. swedish would be cSWE.
I hope this is not too much text:
--- Language.pmod 2006-08-07 18:52:53.000000000 +0200 +++ pike/pike-src/Pike-v7.7-snapshot/lib/modules/Calendar.pmod/Language.pmod 2006-08-07 18:55:12.000000000 +0200 @@ -503,6 +503,7 @@ { inherit _ymd_base;
+ constant name = "eng"; constant month_names= ({"January","February","March","April","May","June","July","August", "September","October","November","December"}); @@ -544,6 +545,8 @@ { inherit _ymd_base;
+ constant name = "swe"; + static private constant month_names= ({"januari","februari","mars","april","maj","juni","juli","augusti", "september","oktober","november","december"}); @@ -642,6 +645,7 @@ { inherit _ymd_base;
+ constant name = "de_at"; static private constant month_names= ({"jänner","feber","märz","april","mai","juni","juli","august", "september","oktober","november","dezember"}); @@ -659,12 +663,14 @@ // Welsh // source: book
+constant cWEL=cWELSH; constant cCY=cWELSH; constant cCYM=cWELSH; class cWELSH { inherit _ymd_base;
+ constant name = "cym"; static private constant month_names= ({"ionawr","chwefror","mawrth","ebrill","mai","mehefin", "gorffenaf","awst","medi","hydref","tachwedd","rhagfyr"}); @@ -698,6 +704,8 @@ { inherit _ymd_base;
+ constant name = "spa"; + static private constant month_names= ({"enero","febrero","marzo","abril","mayo","junio", "julio","agosto","setiembre","octubre","noviembre","diciembre"}); @@ -745,6 +753,8 @@ { inherit _ymd_base;
+ constant name ="por"; + static private constant month_names= ({ "Janeiro", @@ -804,6 +814,8 @@ { inherit _ymd_base;
+ constant name = "hun"; + static private constant month_names= ({"Január","Február","Március","Április","Május","Június", "Július","August","September","October","November","December"}); @@ -841,6 +853,8 @@ { inherit _ymd_base;
+ constant name = "lat"; + static array(string) month_names= ({"Ianuarius", "Februarius", "Martius", "Aprilis", "Maius", "Iunius", "Iulius", "Augustus", "September", "October", "November", "December" }); @@ -920,6 +934,8 @@ { inherit _ymd_base;
+ constant name = "kal"; + static private constant month_names= ({ "januari", @@ -953,12 +969,15 @@
// source: anonymous unix locale file
+constant cICE=cICELANDIC; constant cIS=cICELANDIC; // Icelandic constant cISL=cICELANDIC; class cICELANDIC { inherit _ymd_base;
+ constant name = "isl"; + static private constant month_names= ({ "Januar", @@ -992,12 +1011,15 @@
// source: anonymous unix locale file
+constant cPER=cPERSIAN; constant cFA=cPERSIAN; // Persian (Iran) constant cFAS=cPERSIAN; class cPERSIAN { inherit _ymd_base;
+ constant name ="fas"; + static private constant month_names= ({ "zanwyh", // <zj><a+><n+><w+><yf><h+> @@ -1037,6 +1059,8 @@ { inherit _ymd_base;
+ constant name ="afr"; + static private constant month_names= ({ "Januarie", @@ -1076,6 +1100,8 @@ { inherit _ymd_base;
+ constant name ="gle"; + static private constant month_names= ({ "Eanáir", @@ -1120,11 +1146,14 @@ // source: anonymous unix locale file
constant cEU=cBASQUE; // Basque (Spain) +constant cBAQ=cBASQUE; constant cEUS=cBASQUE; class cBASQUE { inherit _ymd_base;
+ constant name ="eus"; + static private constant month_names= ({ "urtarrila", @@ -1164,6 +1193,8 @@ { inherit _ymd_base;
+ constant name ="nor"; + static private constant month_names= ({ "januar", @@ -1205,6 +1236,8 @@ { inherit _ymd_base;
+ constant name ="nld"; + static private constant month_names= ({ "januari", @@ -1244,6 +1277,8 @@ { inherit _ymd_base;
+ constant name ="pol"; + static private constant month_names= ({ "styczen", // <s><t><y><c><z><e><n'> @@ -1278,6 +1313,8 @@ { inherit _ymd_base;
+ constant name ="pol"; + static private constant month_names= ({ "stycze\x0143", // <s><t><y><c><z><e><n'> @@ -1317,6 +1354,8 @@ { inherit _ymd_base;
+ constant name ="tur"; + static private constant month_names= ({ "Ocak", @@ -1353,6 +1392,8 @@ { inherit _ymd_base;
+ constant name ="tur"; + static private constant month_names= ({ "Ocak", @@ -1393,6 +1434,8 @@ { inherit _ymd_base;
+ constant name ="deu"; + static private constant month_names= ({ "Januar", @@ -1432,6 +1475,8 @@ { inherit _ymd_base;
+ constant name ="lav"; + static private constant month_names= ({ "janvaris", // <j><a><n><v><a-><r><i><s> @@ -1468,6 +1513,8 @@ { inherit _ymd_base;
+ constant name ="lav"; + static private constant month_names= ({ "janv\x0101""ris", // <j><a><n><v><a-><r><i><s> @@ -1507,6 +1554,8 @@ { inherit _ymd_base;
+ constant name ="fin"; + static private constant month_names= ({ "tammikuu", @@ -1546,6 +1595,8 @@ { inherit _ymd_base;
+ constant name ="lit"; + static private constant month_names= ({ "sausio", @@ -1580,6 +1631,8 @@ { inherit _ymd_base;
+ constant name ="lit"; + static private constant month_names= ({ "sausio", @@ -1619,6 +1672,8 @@ { inherit _ymd_base;
+ constant name ="est"; + static constant month_names= ({ "jaanuar", @@ -1655,6 +1710,8 @@ { inherit _ymd_base;
+ constant name ="glg"; + static private constant month_names= ({ "Xaneiro", @@ -1685,11 +1742,14 @@ void create() { SETUPSTUFF; } }
+constant cIND=cINDONESIAN; constant cID=cINDONESIAN; class cINDONESIAN { inherit _ymd_base;
+ constant name ="ind"; + static private constant month_names= ({ "Januari", @@ -1726,6 +1786,8 @@ { inherit _ymd_base;
+ constant name ="fra"; + static private constant month_names= ({ "janvier", @@ -1762,6 +1824,8 @@ { inherit _ymd_base;
+ constant name ="ita"; + static private constant month_names= ({ "gennaio", @@ -1798,6 +1862,8 @@ { inherit _ymd_base;
+ constant name ="cat"; + static private constant month_names= ({ "gener", @@ -1834,6 +1900,8 @@ { inherit _ymd_base;
+ constant name ="slv"; + static constant month_names= ({ "januar", @@ -1868,6 +1936,8 @@ { inherit cSLOVENIAN;
+ constant name ="slv"; + static constant week_day_names= ({ "ponedeljek", @@ -1888,6 +1958,8 @@ { inherit _ymd_base;
+ constant name ="fao"; + static private constant month_names= ({ "januar", @@ -1918,12 +1990,15 @@ void create() { SETUPSTUFF; } }
+constant cRUM=cROMANIAN; constant cRO=cROMANIAN; // Romanian constant cRON=cROMANIAN; class cROMANIAN { inherit _ymd_base;
+ constant name ="ron"; + static constant month_names= ({ "Ianuarie", @@ -1958,6 +2033,8 @@ { inherit cROMANIAN;
+ constant name ="ron"; + static constant week_day_names= ({ "Luni", @@ -1972,12 +2049,15 @@ void create() { SETUPSTUFF; } }
+constant cSCR=cCROATIAN; constant cHR=cCROATIAN; // Croatian constant cHRV=cCROATIAN; // Croatian class cCROATIAN { inherit _ymd_base;
+ constant name ="hrv"; + static private constant month_names= ({ "Sijecanj", // <S><i><j><e><c<><a><n><j> @@ -2012,6 +2092,8 @@ { inherit _ymd_base;
+ constant name ="hrv"; + static private constant month_names= ({ "Sije\415anj", @@ -2048,6 +2130,8 @@ { inherit _ymd_base;
+ constant name ="dan"; + static private constant month_names= ({ "januar", @@ -2103,12 +2187,15 @@ void create() { SETUPSTUFF; } }
+constant cSCC=cSERBIAN; constant cSR=cSERBIAN; // Serbian (Yugoslavia) constant cSRP=cSERBIAN; class cSERBIAN { inherit _ymd_base;
+ constant name ="srp"; + static constant month_names= ({ "januar", @@ -2144,6 +2231,8 @@ { inherit cSERBIAN;
+ constant name ="srp"; + static constant week_day_names= ({ "ponedeljak",