XcapStack.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace org.doubango.tinyWRAP {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class XcapStack : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal XcapStack(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(XcapStack obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~XcapStack() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. tinyWRAPPINVOKE.delete_XcapStack(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public bool putElement(string url, byte[] payload) {
  37. IntPtr ptr = Marshal.AllocHGlobal(payload.Length);
  38. Marshal.Copy(payload, 0, ptr, payload.Length);
  39. bool ret = this.putElement(url, ptr, (uint)payload.Length);
  40. Marshal.FreeHGlobal(ptr);
  41. return ret;
  42. }
  43. public bool putAttribute(string url, byte[] payload) {
  44. IntPtr ptr = Marshal.AllocHGlobal(payload.Length);
  45. Marshal.Copy(payload, 0, ptr, payload.Length);
  46. bool ret = this.putAttribute(url, ptr, (uint)payload.Length);
  47. Marshal.FreeHGlobal(ptr);
  48. return ret;
  49. }
  50. public bool putDocument(string url, byte[] payload, string contentType) {
  51. IntPtr ptr = Marshal.AllocHGlobal(payload.Length);
  52. Marshal.Copy(payload, 0, ptr, payload.Length);
  53. bool ret = this.putDocument(url, ptr, (uint)payload.Length, contentType);
  54. Marshal.FreeHGlobal(ptr);
  55. return ret;
  56. }
  57. public XcapStack(XcapCallback callback, string xui, string password, string xcap_root) : this(tinyWRAPPINVOKE.new_XcapStack(XcapCallback.getCPtr(callback), xui, password, xcap_root), true) {
  58. }
  59. public bool registerAUID(string id, string mime_type, string ns, string document_name, bool is_global) {
  60. bool ret = tinyWRAPPINVOKE.XcapStack_registerAUID(swigCPtr, id, mime_type, ns, document_name, is_global);
  61. return ret;
  62. }
  63. public bool start() {
  64. bool ret = tinyWRAPPINVOKE.XcapStack_start(swigCPtr);
  65. return ret;
  66. }
  67. public bool setCredentials(string xui, string password) {
  68. bool ret = tinyWRAPPINVOKE.XcapStack_setCredentials(swigCPtr, xui, password);
  69. return ret;
  70. }
  71. public bool setXcapRoot(string xcap_root) {
  72. bool ret = tinyWRAPPINVOKE.XcapStack_setXcapRoot(swigCPtr, xcap_root);
  73. return ret;
  74. }
  75. public bool setLocalIP(string ip) {
  76. bool ret = tinyWRAPPINVOKE.XcapStack_setLocalIP(swigCPtr, ip);
  77. return ret;
  78. }
  79. public bool setLocalPort(uint port) {
  80. bool ret = tinyWRAPPINVOKE.XcapStack_setLocalPort(swigCPtr, port);
  81. return ret;
  82. }
  83. public bool addHeader(string name, string value) {
  84. bool ret = tinyWRAPPINVOKE.XcapStack_addHeader(swigCPtr, name, value);
  85. return ret;
  86. }
  87. public bool removeHeader(string name) {
  88. bool ret = tinyWRAPPINVOKE.XcapStack_removeHeader(swigCPtr, name);
  89. return ret;
  90. }
  91. public bool setTimeout(uint timeout) {
  92. bool ret = tinyWRAPPINVOKE.XcapStack_setTimeout(swigCPtr, timeout);
  93. return ret;
  94. }
  95. public bool getDocument(string url) {
  96. bool ret = tinyWRAPPINVOKE.XcapStack_getDocument(swigCPtr, url);
  97. return ret;
  98. }
  99. public bool getElement(string url) {
  100. bool ret = tinyWRAPPINVOKE.XcapStack_getElement(swigCPtr, url);
  101. return ret;
  102. }
  103. public bool getAttribute(string url) {
  104. bool ret = tinyWRAPPINVOKE.XcapStack_getAttribute(swigCPtr, url);
  105. return ret;
  106. }
  107. public bool deleteDocument(string url) {
  108. bool ret = tinyWRAPPINVOKE.XcapStack_deleteDocument(swigCPtr, url);
  109. return ret;
  110. }
  111. public bool deleteElement(string url) {
  112. bool ret = tinyWRAPPINVOKE.XcapStack_deleteElement(swigCPtr, url);
  113. return ret;
  114. }
  115. public bool deleteAttribute(string url) {
  116. bool ret = tinyWRAPPINVOKE.XcapStack_deleteAttribute(swigCPtr, url);
  117. return ret;
  118. }
  119. public bool putDocument(string url, IntPtr payload, uint len, string contentType) {
  120. bool ret = tinyWRAPPINVOKE.XcapStack_putDocument(swigCPtr, url, payload, len, contentType);
  121. return ret;
  122. }
  123. public bool putElement(string url, IntPtr payload, uint len) {
  124. bool ret = tinyWRAPPINVOKE.XcapStack_putElement(swigCPtr, url, payload, len);
  125. return ret;
  126. }
  127. public bool putAttribute(string url, IntPtr payload, uint len) {
  128. bool ret = tinyWRAPPINVOKE.XcapStack_putAttribute(swigCPtr, url, payload, len);
  129. return ret;
  130. }
  131. public bool stop() {
  132. bool ret = tinyWRAPPINVOKE.XcapStack_stop(swigCPtr);
  133. return ret;
  134. }
  135. }
  136. }