MappedFile

class MappedFile(val glibMappedFilePointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance(source)

The #GMappedFile represents a file mapping created with g_mapped_file_new(). It has only private members and should not be accessed directly.

Constructors

Link copied to clipboard
constructor(filename: String, writable: Boolean)

Maps a file into memory. On UNIX, this is using the mmap() function.

constructor(fd: <Error class: unknown class>, writable: Boolean)

Maps a file into memory. On UNIX, this is using the mmap() function.

constructor(glibMappedFilePointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val glibMappedFilePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>

Functions

Link copied to clipboard
open override fun addCleaner(cleaner: <Error class: unknown class>): Boolean

Registers a cleaner to be executed when this proxy object is garbage collected.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
fun free()

This is deprecated since version 2.22.

Link copied to clipboard

Creates a new #GBytes which references the data mapped from @file. The mapped contents of the file must not be modified after creating this bytes object, because a #GBytes should be immutable.

Link copied to clipboard

Returns the contents of a #GMappedFile.

Link copied to clipboard
fun getLength(): <Error class: unknown class>

Returns the length of the contents of a #GMappedFile.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Increments the reference count of @file by one. It is safe to call this function from any thread.

Link copied to clipboard
open override fun removeCleaner(cleaner: <Error class: unknown class>): Boolean

Removes a previously registered cleaner from this proxy object.

Link copied to clipboard
fun unref()

Decrements the reference count of @file by one. If the reference count drops to 0, unmaps the buffer of @file and frees it.