Method

GLibMappedFileget_contents

Declaration

gchar*
g_mapped_file_get_contents (
  GMappedFile* file
)

Description

Returns the contents of a GMappedFile.

Note that the contents may not be zero-terminated, even if the GMappedFile is backed by a text file.

If the file is empty then NULL is returned.

Available since:2.8

Return value

Returns: utf8
 

The contents of file, or NULL.

 The caller of the method takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.