BinaryObjectWriter.js 665 B

12345678910111213141516171819202122232425
  1. function BinaryObjectWriter() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.BinaryObjectWriter()
  4. }
  5. }
  6. Duktape.fin(BinaryObjectWriter.prototype, function (x) {
  7. if (x === BinaryObjectWriter.prototype) {
  8. return;
  9. }
  10. Polycode.BinaryObjectWriter__delete(x.__ptr)
  11. })
  12. BinaryObjectWriter.prototype.addKey = function(key) {
  13. return Polycode.BinaryObjectWriter_addKey(this.__ptr, key)
  14. }
  15. BinaryObjectWriter.prototype.getKeyIndex = function(key) {
  16. return Polycode.BinaryObjectWriter_getKeyIndex(this.__ptr, key)
  17. }
  18. BinaryObjectWriter.prototype.writeToFile = function(fileName) {
  19. return Polycode.BinaryObjectWriter_writeToFile(this.__ptr, fileName)
  20. }