ObjectEntry.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. function ObjectEntry() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.ObjectEntry()
  4. }
  5. Object.defineProperties(this, {
  6. 'type': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_type, set: ObjectEntry.prototype.__set_type},
  7. 'name': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_name, set: ObjectEntry.prototype.__set_name},
  8. 'NumberVal': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_NumberVal, set: ObjectEntry.prototype.__set_NumberVal},
  9. 'intVal': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_intVal, set: ObjectEntry.prototype.__set_intVal},
  10. 'stringVal': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_stringVal, set: ObjectEntry.prototype.__set_stringVal},
  11. 'boolVal': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_boolVal, set: ObjectEntry.prototype.__set_boolVal},
  12. 'length': { enumerable: true, configurable: true, get: ObjectEntry.prototype.__get_length, set: ObjectEntry.prototype.__set_length}
  13. })
  14. }
  15. ObjectEntry.UNKNOWN_ENTRY = - 1
  16. ObjectEntry.FLOAT_ENTRY = 0
  17. ObjectEntry.INT_ENTRY = 1
  18. ObjectEntry.BOOL_ENTRY = 2
  19. ObjectEntry.ARRAY_ENTRY = 3
  20. ObjectEntry.STRING_ENTRY = 4
  21. ObjectEntry.CONTAINER_ENTRY = 5
  22. ObjectEntry.prototype.__get_type = function() {
  23. return Polycode.ObjectEntry__get_type(this.__ptr)
  24. }
  25. ObjectEntry.prototype.__set_type = function(val) {
  26. Polycode.ObjectEntry__set_type(this.__ptr, val)
  27. }
  28. ObjectEntry.prototype.__get_name = function() {
  29. return Polycode.ObjectEntry__get_name(this.__ptr)
  30. }
  31. ObjectEntry.prototype.__set_name = function(val) {
  32. Polycode.ObjectEntry__set_name(this.__ptr, val)
  33. }
  34. ObjectEntry.prototype.__get_NumberVal = function() {
  35. return Polycode.ObjectEntry__get_NumberVal(this.__ptr)
  36. }
  37. ObjectEntry.prototype.__set_NumberVal = function(val) {
  38. Polycode.ObjectEntry__set_NumberVal(this.__ptr, val)
  39. }
  40. ObjectEntry.prototype.__get_intVal = function() {
  41. return Polycode.ObjectEntry__get_intVal(this.__ptr)
  42. }
  43. ObjectEntry.prototype.__set_intVal = function(val) {
  44. Polycode.ObjectEntry__set_intVal(this.__ptr, val)
  45. }
  46. ObjectEntry.prototype.__get_stringVal = function() {
  47. return Polycode.ObjectEntry__get_stringVal(this.__ptr)
  48. }
  49. ObjectEntry.prototype.__set_stringVal = function(val) {
  50. Polycode.ObjectEntry__set_stringVal(this.__ptr, val)
  51. }
  52. ObjectEntry.prototype.__get_boolVal = function() {
  53. return Polycode.ObjectEntry__get_boolVal(this.__ptr)
  54. }
  55. ObjectEntry.prototype.__set_boolVal = function(val) {
  56. Polycode.ObjectEntry__set_boolVal(this.__ptr, val)
  57. }
  58. ObjectEntry.prototype.__get_length = function() {
  59. return Polycode.ObjectEntry__get_length(this.__ptr)
  60. }
  61. ObjectEntry.prototype.__set_length = function(val) {
  62. Polycode.ObjectEntry__set_length(this.__ptr, val)
  63. }
  64. Duktape.fin(ObjectEntry.prototype, function (x) {
  65. if (x === ObjectEntry.prototype) {
  66. return;
  67. }
  68. Polycode.ObjectEntry__delete(x.__ptr)
  69. })
  70. ObjectEntry.prototype.readNumber = function(key,out) {
  71. return Polycode.ObjectEntry_readNumber(this.__ptr, key, out.__ptr)
  72. }
  73. ObjectEntry.prototype.readString = function(key,out) {
  74. return Polycode.ObjectEntry_readString(this.__ptr, key, out.__ptr)
  75. }
  76. ObjectEntry.prototype.readBool = function(key,out) {
  77. return Polycode.ObjectEntry_readBool(this.__ptr, key, out.__ptr)
  78. }
  79. ObjectEntry.prototype.addChild = function(name) {
  80. var retVal = new ObjectEntry()
  81. retVal.__ptr = Polycode.ObjectEntry_addChild(this.__ptr, name)
  82. return retVal
  83. }
  84. ObjectEntry.prototype.getTypedName = function() {
  85. return Polycode.ObjectEntry_getTypedName(this.__ptr)
  86. }
  87. ObjectEntry.prototype.setTypedName = function(str) {
  88. Polycode.ObjectEntry_setTypedName(this.__ptr, str)
  89. }
  90. ObjectEntry.prototype.Clear = function() {
  91. Polycode.ObjectEntry_Clear(this.__ptr)
  92. }