ActionConfig.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 ActionConfig : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal ActionConfig(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(ActionConfig obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~ActionConfig() {
  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_ActionConfig(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public ActionConfig() : this(tinyWRAPPINVOKE.new_ActionConfig(), true) {
  37. }
  38. public bool addHeader(string name, string value) {
  39. bool ret = tinyWRAPPINVOKE.ActionConfig_addHeader(swigCPtr, name, value);
  40. return ret;
  41. }
  42. public bool addPayload(IntPtr payload, uint len) {
  43. bool ret = tinyWRAPPINVOKE.ActionConfig_addPayload(swigCPtr, payload, len);
  44. return ret;
  45. }
  46. public bool setActiveMedia(twrap_media_type_t type) {
  47. bool ret = tinyWRAPPINVOKE.ActionConfig_setActiveMedia(swigCPtr, (int)type);
  48. return ret;
  49. }
  50. public ActionConfig setResponseLine(short code, string phrase) {
  51. IntPtr cPtr = tinyWRAPPINVOKE.ActionConfig_setResponseLine(swigCPtr, code, phrase);
  52. ActionConfig ret = (cPtr == IntPtr.Zero) ? null : new ActionConfig(cPtr, false);
  53. return ret;
  54. }
  55. public ActionConfig setMediaString(twrap_media_type_t type, string key, string value) {
  56. IntPtr cPtr = tinyWRAPPINVOKE.ActionConfig_setMediaString(swigCPtr, (int)type, key, value);
  57. ActionConfig ret = (cPtr == IntPtr.Zero) ? null : new ActionConfig(cPtr, false);
  58. return ret;
  59. }
  60. public ActionConfig setMediaInt(twrap_media_type_t type, string key, int value) {
  61. IntPtr cPtr = tinyWRAPPINVOKE.ActionConfig_setMediaInt(swigCPtr, (int)type, key, value);
  62. ActionConfig ret = (cPtr == IntPtr.Zero) ? null : new ActionConfig(cPtr, false);
  63. return ret;
  64. }
  65. }
  66. }