/// <summary> /// Get a specific key of the device info list for a client connection. /// Known key values are: Model, FSTotalBytes, FSFreeBytes and FSBlockSize. /// This is a helper function for afc_get_device_info(). /// </summary> /// <param name="client"> /// The client to get device info for. /// </param> /// <param name="key"> /// The key to get the value of. /// </param> /// <param name="value"> /// The value for the key if successful or NULL otherwise. /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_get_device_info_key(AfcClientHandle client, string key, out string value) { return(AfcNativeMethods.afc_get_device_info_key(client, key, out value)); }
/// <summary> /// Closes a file on the device. /// </summary> /// <param name="client"> /// The client to close the file with. /// </param> /// <param name="handle"> /// File handle of a previously opened file. /// </param> public virtual AfcError afc_file_close(AfcClientHandle client, ulong handle) { return(AfcNativeMethods.afc_file_close(client, handle)); }
/// <summary> /// Attempts to the read the given number of bytes from the given file. /// </summary> /// <param name="client"> /// The relevant AFC client /// </param> /// <param name="handle"> /// File handle of a previously opened file /// </param> /// <param name="data"> /// The pointer to the memory region to store the read data /// </param> /// <param name="length"> /// The number of bytes to read /// </param> /// <param name="bytes_read"> /// The number of bytes actually read. /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_file_read(AfcClientHandle client, ulong handle, byte[] data, uint length, ref uint bytesRead) { return(AfcNativeMethods.afc_file_read(client, handle, data, length, ref bytesRead)); }
/// <summary> /// Get device information for a connected client. The device information /// returned is the device model as well as the free space, the total capacity /// and blocksize on the accessed disk partition. /// </summary> /// <param name="client"> /// The client to get device info for. /// </param> /// <param name="device_information"> /// A char list of device information terminated by an /// empty string or NULL if there was an error. Free with /// afc_dictionary_free(). /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_get_device_info(AfcClientHandle client, out System.Collections.ObjectModel.ReadOnlyCollection <string> deviceInformation) { return(AfcNativeMethods.afc_get_device_info(client, out deviceInformation)); }
/// <summary> /// Gets information about a specific file. /// </summary> /// <param name="client"> /// The client to use to get the information of the file. /// </param> /// <param name="filename"> /// The fully-qualified path to the file. /// </param> /// <param name="file_information"> /// Pointer to a buffer that will be filled with a /// NULL-terminated list of strings with the file information. Set to NULL /// before calling this function. Free with afc_dictionary_free(). /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_get_file_info(AfcClientHandle client, string filename, out System.Collections.ObjectModel.ReadOnlyCollection <string> fileInformation) { return(AfcNativeMethods.afc_get_file_info(client, filename, out fileInformation)); }
public static extern AfcError afc_remove_path_and_contents(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string path);
public static extern AfcError afc_client_start_service(iDeviceHandle device, out AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string label);
public static extern AfcError afc_file_lock(AfcClientHandle client, ulong handle, AfcLockOp operation);
public static extern AfcError afc_file_read(AfcClientHandle client, ulong handle, byte[] data, uint length, ref uint bytesRead);
public static extern AfcError afc_file_open(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string filename, AfcFileMode fileMode, ref ulong handle);
public static extern AfcError afc_file_close(AfcClientHandle client, ulong handle);
public static extern AfcError afc_get_file_info(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string filename, out System.IntPtr fileInformation);
public static extern AfcError afc_read_directory(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string path, out System.IntPtr directoryInformation);
/// <summary> /// Makes a connection to the AFC service on the device. /// </summary> /// <param name="device"> /// The device to connect to. /// </param> /// <param name="service"> /// The service descriptor returned by lockdownd_start_service. /// </param> /// <param name="client"> /// Pointer that will be set to a newly allocated afc_client_t /// upon successful return. /// </param> /// <returns> /// AFC_E_SUCCESS on success, AFC_E_INVALID_ARG if device or service is /// invalid, AFC_E_MUX_ERROR if the connection cannot be established, /// or AFC_E_NO_MEM if there is a memory allocation problem. /// </returns> public virtual AfcError afc_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out AfcClientHandle client) { AfcError returnValue; returnValue = AfcNativeMethods.afc_client_new(device, service, out client); client.Api = this.Parent; return(returnValue); }
public static extern AfcError afc_make_link(AfcClientHandle client, AfcLinkType linktype, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string target, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string linkname);
public static extern AfcError afc_file_write(AfcClientHandle client, ulong handle, byte[] data, uint length, ref uint bytesWritten);
public static extern AfcError afc_set_file_time(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string path, ulong mtime);
public static extern AfcError afc_file_seek(AfcClientHandle client, ulong handle, long offset, int whence);
public static extern AfcError afc_get_device_info_key(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string key, out System.IntPtr value);
public static extern AfcError afc_file_tell(AfcClientHandle client, ulong handle, ref ulong position);
public static extern AfcError afc_get_device_info(AfcClientHandle client, out System.IntPtr deviceInformation);
public static extern AfcError afc_file_truncate(AfcClientHandle client, ulong handle, ulong newsize);
/// <summary> /// Gets a directory listing of the directory requested. /// </summary> /// <param name="client"> /// The client to get a directory listing from. /// </param> /// <param name="path"> /// The directory for listing. (must be a fully-qualified path) /// </param> /// <param name="directory_information"> /// A char list of files in the directory /// terminated by an empty string or NULL if there was an error. Free with /// afc_dictionary_free(). /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_read_directory(AfcClientHandle client, string path, out System.Collections.ObjectModel.ReadOnlyCollection <string> directoryInformation) { return(AfcNativeMethods.afc_read_directory(client, path, out directoryInformation)); }
public static extern AfcError afc_rename_path(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string from, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string to);
/// <summary> /// Opens a file on the device. /// </summary> /// <param name="client"> /// The client to use to open the file. /// </param> /// <param name="filename"> /// The file to open. (must be a fully-qualified path) /// </param> /// <param name="file_mode"> /// The mode to use to open the file. /// </param> /// <param name="handle"> /// Pointer to a uint64_t that will hold the handle of the file /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_file_open(AfcClientHandle client, string filename, AfcFileMode fileMode, ref ulong handle) { return(AfcNativeMethods.afc_file_open(client, filename, fileMode, ref handle)); }
public static extern AfcError afc_make_directory(AfcClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string path);
/// <summary> /// Locks or unlocks a file on the device. /// Makes use of flock on the device. /// </summary> /// <param name="client"> /// The client to lock the file with. /// </param> /// <param name="handle"> /// File handle of a previously opened file. /// </param> /// <param name="operation"> /// the lock or unlock operation to perform, this is one of /// AFC_LOCK_SH (shared lock), AFC_LOCK_EX (exclusive lock), or /// AFC_LOCK_UN (unlock). /// </param> public virtual AfcError afc_file_lock(AfcClientHandle client, ulong handle, AfcLockOp operation) { return(AfcNativeMethods.afc_file_lock(client, handle, operation)); }
public static extern AfcError afc_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out AfcClientHandle client);
/// <summary> /// Writes a given number of bytes to a file. /// </summary> /// <param name="client"> /// The client to use to write to the file. /// </param> /// <param name="handle"> /// File handle of previously opened file. /// </param> /// <param name="data"> /// The data to write to the file. /// </param> /// <param name="length"> /// How much data to write. /// </param> /// <param name="bytes_written"> /// The number of bytes actually written to the file. /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> public virtual AfcError afc_file_write(AfcClientHandle client, ulong handle, byte[] data, uint length, ref uint bytesWritten) { return(AfcNativeMethods.afc_file_write(client, handle, data, length, ref bytesWritten)); }
/// <summary> /// Deletes a file or directory including possible contents. /// </summary> /// <param name="client"> /// The client to use. /// </param> /// <param name="path"> /// The path to delete. (must be a fully-qualified path) /// </param> /// <returns> /// AFC_E_SUCCESS on success or an AFC_E_* error value. /// </returns> /// <remarks> /// Only available in iOS 6 and later. /// </remarks> public virtual AfcError afc_remove_path_and_contents(AfcClientHandle client, string path) { return(AfcNativeMethods.afc_remove_path_and_contents(client, path)); }