MappedFile

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

Constructors

this
this(GMappedFile* gMappedFile, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string filename, bool writable)

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

this
this(int fd, bool writable)

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

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

Functions

free
void free()

This call existed before #GMappedFile had refcounting and is currently exactly the same as g_mapped_file_unref().

getBytes
Bytes getBytes()

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.

getContents
string getContents()

Returns the contents of a #GMappedFile.

getLength
size_t getLength()

Returns the length of the contents of a #GMappedFile.

getMappedFileStruct
GMappedFile* getMappedFileStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

ref_
MappedFile ref_()

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

unref
void unref()

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

Variables

gMappedFile
GMappedFile* gMappedFile;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta