FileList.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.1
  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 RakNet {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class FileList : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal FileList(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(FileList obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~FileList() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. RakNetPINVOKE.delete_FileList(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public static FileList GetInstance() {
  37. IntPtr cPtr = RakNetPINVOKE.FileList_GetInstance();
  38. FileList ret = (cPtr == IntPtr.Zero) ? null : new FileList(cPtr, false);
  39. return ret;
  40. }
  41. public static void DestroyInstance(FileList i) {
  42. RakNetPINVOKE.FileList_DestroyInstance(FileList.getCPtr(i));
  43. }
  44. public FileList() : this(RakNetPINVOKE.new_FileList(), true) {
  45. }
  46. public void AddFilesFromDirectory(string applicationDirectory, string subDirectory, bool writeHash, bool writeData, bool recursive, FileListNodeContext context) {
  47. RakNetPINVOKE.FileList_AddFilesFromDirectory(swigCPtr, applicationDirectory, subDirectory, writeHash, writeData, recursive, FileListNodeContext.getCPtr(context));
  48. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  49. }
  50. public void Clear() {
  51. RakNetPINVOKE.FileList_Clear(swigCPtr);
  52. }
  53. public void Serialize(BitStream outBitStream) {
  54. RakNetPINVOKE.FileList_Serialize(swigCPtr, BitStream.getCPtr(outBitStream));
  55. }
  56. public bool Deserialize(BitStream inBitStream) {
  57. bool ret = RakNetPINVOKE.FileList_Deserialize(swigCPtr, BitStream.getCPtr(inBitStream));
  58. return ret;
  59. }
  60. public void ListMissingOrChangedFiles(string applicationDirectory, FileList missingOrChangedFiles, bool alwaysWriteHash, bool neverWriteHash) {
  61. RakNetPINVOKE.FileList_ListMissingOrChangedFiles(swigCPtr, applicationDirectory, FileList.getCPtr(missingOrChangedFiles), alwaysWriteHash, neverWriteHash);
  62. }
  63. public void GetDeltaToCurrent(FileList input, FileList output, string dirSubset, string remoteSubdir) {
  64. RakNetPINVOKE.FileList_GetDeltaToCurrent(swigCPtr, FileList.getCPtr(input), FileList.getCPtr(output), dirSubset, remoteSubdir);
  65. }
  66. public void PopulateDataFromDisk(string applicationDirectory, bool writeFileData, bool writeFileHash, bool removeUnknownFiles) {
  67. RakNetPINVOKE.FileList_PopulateDataFromDisk(swigCPtr, applicationDirectory, writeFileData, writeFileHash, removeUnknownFiles);
  68. }
  69. public void FlagFilesAsReferences() {
  70. RakNetPINVOKE.FileList_FlagFilesAsReferences(swigCPtr);
  71. }
  72. public void WriteDataToDisk(string applicationDirectory) {
  73. RakNetPINVOKE.FileList_WriteDataToDisk(swigCPtr, applicationDirectory);
  74. }
  75. public void AddFile(string filepath, string filename, FileListNodeContext context) {
  76. RakNetPINVOKE.FileList_AddFile__SWIG_0(swigCPtr, filepath, filename, FileListNodeContext.getCPtr(context));
  77. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  78. }
  79. public void DeleteFiles(string applicationDirectory) {
  80. RakNetPINVOKE.FileList_DeleteFiles(swigCPtr, applicationDirectory);
  81. }
  82. public void AddCallback(FileListProgress cb) {
  83. RakNetPINVOKE.FileList_AddCallback(swigCPtr, FileListProgress.getCPtr(cb));
  84. }
  85. public void RemoveCallback(FileListProgress cb) {
  86. RakNetPINVOKE.FileList_RemoveCallback(swigCPtr, FileListProgress.getCPtr(cb));
  87. }
  88. public void ClearCallbacks() {
  89. RakNetPINVOKE.FileList_ClearCallbacks(swigCPtr);
  90. }
  91. public RakNetListFileListNode fileList {
  92. set {
  93. RakNetPINVOKE.FileList_fileList_set(swigCPtr, RakNetListFileListNode.getCPtr(value));
  94. }
  95. get {
  96. IntPtr cPtr = RakNetPINVOKE.FileList_fileList_get(swigCPtr);
  97. RakNetListFileListNode ret = (cPtr == IntPtr.Zero) ? null : new RakNetListFileListNode(cPtr, false);
  98. return ret;
  99. }
  100. }
  101. public static bool FixEndingSlash(string str) {
  102. bool ret = RakNetPINVOKE.FileList_FixEndingSlash(str);
  103. return ret;
  104. }
  105. public void AddFile(string filename, string fullPathToFile, byte[] inByteArray, uint dataLength, uint fileLength, FileListNodeContext context, bool isAReference) {
  106. RakNetPINVOKE.FileList_AddFile__SWIG_1(swigCPtr, filename, fullPathToFile, inByteArray, dataLength, fileLength, FileListNodeContext.getCPtr(context), isAReference);
  107. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  108. }
  109. public void AddFile(string filename, string fullPathToFile, byte[] inByteArray, uint dataLength, uint fileLength, FileListNodeContext context) {
  110. RakNetPINVOKE.FileList_AddFile__SWIG_2(swigCPtr, filename, fullPathToFile, inByteArray, dataLength, fileLength, FileListNodeContext.getCPtr(context));
  111. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  112. }
  113. }
  114. }
粤ICP备19079148号