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); }
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); } } }
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)); } } }
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)); } } }
public unsafe FileSystemHandle(Native.FileSystem *file_system) : base(true) { this.SetHandle(new IntPtr((void *)file_system)); }