コード例 #1
0
        public List <string> Find(string path = null)
        {
            List <string> files = new List <string>();

            unsafe {
                Native.FileSystem *file_system = handle_.GetHandle();
                if (path == null)
                {
                    Native.Find(file_system, IntPtr.Zero, x => files.Add(Marshal.PtrToStringAnsi(x)));
                }
                else
                {
                    Native.Find(file_system, path, x => files.Add(Marshal.PtrToStringAnsi(x)));
                }
            }
            return(files);
        }
コード例 #2
0
 public FileSystem(string path)
 {
     unsafe {
         Native.Status *    status;
         Native.FileSystem *file_system = Native.Load(path, &status);
         if (file_system == null)
         {
             using (handles.StatusHandle handle = new handles.StatusHandle(status)) {
                 throw new MatryoshkaException(handle);
             }
         }
         else
         {
             handle_ = new handles.FileSystemHandle(file_system);
         }
     }
 }
コード例 #3
0
 public File Push(string inner_path, string path, int chunk_size = -1)
 {
     unsafe {
         Native.Status *    status;
         Native.FileSystem *file_system = handle_.GetHandle();
         Native.FileHandle *file        = Native.Push(file_system, inner_path, path, chunk_size, &status);
         if (file == null)
         {
             using (handles.StatusHandle handle = new handles.StatusHandle(status)) {
                 throw new MatryoshkaException(handle);
             }
         }
         else
         {
             return(new File(this, file, path));
         }
     }
 }
コード例 #4
0
 public File Open(string path)
 {
     unsafe {
         Native.Status *    status;
         Native.FileSystem *file_system = handle_.GetHandle();
         Native.FileHandle *file        = Native.Open(file_system, path, &status);
         if (file == null)
         {
             using (handles.StatusHandle handle = new handles.StatusHandle(status)) {
                 throw new MatryoshkaException(handle);
             }
         }
         else
         {
             return(new File(this, file, path));
         }
     }
 }
コード例 #5
0
 public unsafe FileSystemHandle(Native.FileSystem *file_system) : base(true)
 {
     this.SetHandle(new IntPtr((void *)file_system));
 }