public void Pull(string file) { unsafe { Native.Status *status = Native.Pull(parent_.GetHandle(), handle_.GetHandle(), file); if (status != null) { using (handles.StatusHandle handle = new handles.StatusHandle(status)) { throw new MatryoshkaException(handle); } } } }
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)); } } }
internal MatryoshkaException(handles.StatusHandle handle) : base(handle.GetMessage()) { }