/Frameworks/Foundation/objj.platform/CPData.j

http://github.com/jfahrenkrug/MapKit-HelloWorld · Unknown · 72 lines · 72 code · 0 blank · 0 comment · 0 complexity · bec6326637925f3c8d5e653471d84300 MD5 · raw file

  1. i;10;CPObject.ji;10;CPString.jc;2225;
  2. var _1=objj_allocateClassPair(CPObject,"CPData"),_2=_1.isa;
  3. class_addIvars(_1,[new objj_ivar("_plistObject")]);
  4. objj_registerClassPair(_1);
  5. objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  6. class_addMethods(_1,[new objj_method(sel_getUid("initWithString:"),function(_3,_4,_5){
  7. with(_3){
  8. _3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPObject")},"init");
  9. if(_3){
  10. string=_5;
  11. }
  12. return _3;
  13. }
  14. }),new objj_method(sel_getUid("initWithPlistObject:"),function(_6,_7,_8){
  15. with(_6){
  16. _6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPObject")},"init");
  17. if(_6){
  18. _plistObject=_8;
  19. }
  20. return _6;
  21. }
  22. }),new objj_method(sel_getUid("length"),function(_9,_a){
  23. with(_9){
  24. return objj_msgSend(objj_msgSend(_9,"string"),"length");
  25. }
  26. }),new objj_method(sel_getUid("description"),function(_b,_c){
  27. with(_b){
  28. return string;
  29. }
  30. }),new objj_method(sel_getUid("string"),function(_d,_e){
  31. with(_d){
  32. if(!string&&_plistObject){
  33. string=objj_msgSend(objj_msgSend(CPPropertyListSerialization,"dataFromPropertyList:format:errorDescription:",_plistObject,CPPropertyList280NorthFormat_v1_0,NULL),"string");
  34. }
  35. return string;
  36. }
  37. }),new objj_method(sel_getUid("setString:"),function(_f,_10,_11){
  38. with(_f){
  39. string=_11;
  40. _plistObject=nil;
  41. }
  42. }),new objj_method(sel_getUid("plistObject"),function(_12,_13){
  43. with(_12){
  44. if(string&&!_plistObject){
  45. _plistObject=objj_msgSend(CPPropertyListSerialization,"propertyListFromData:format:errorDescription:",_12,0,NULL);
  46. }
  47. return _plistObject;
  48. }
  49. }),new objj_method(sel_getUid("setPlistObject:"),function(_14,_15,_16){
  50. with(_14){
  51. string=nil;
  52. _plistObject=_16;
  53. }
  54. })]);
  55. class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_17,_18){
  56. with(_17){
  57. return new objj_data();
  58. }
  59. }),new objj_method(sel_getUid("data"),function(_19,_1a){
  60. with(_19){
  61. return objj_msgSend(objj_msgSend(_19,"alloc"),"initWithPlistObject:",nil);
  62. }
  63. }),new objj_method(sel_getUid("dataWithString:"),function(_1b,_1c,_1d){
  64. with(_1b){
  65. return objj_msgSend(objj_msgSend(_1b,"alloc"),"initWithString:",_1d);
  66. }
  67. }),new objj_method(sel_getUid("dataWithPlistObject:"),function(_1e,_1f,_20){
  68. with(_1e){
  69. return objj_msgSend(objj_msgSend(_1e,"alloc"),"initWithPlistObject:",_20);
  70. }
  71. })]);
  72. objj_data.prototype.isa=CPData;