ToolFiles

ToolFiles — abstract reading of compressed or not text files.

Functions

Types and Values

struct ToolFiles
struct ToolFilesClass

Object Hierarchy

    GObject
    ╰── ToolDbgObj
        ╰── ToolFiles

Description

This class defines objects to read text files with the same API than with GIOChannel. The addition is that these files can be transparently compressed or not.

Functions

tool_files_new ()

ToolFiles *
tool_files_new ();

Creates a new ToolFiles object.

Returns

a newly created ToolFiles object.

[transfer full]

Since: 3.8


tool_files_open ()

gboolean
tool_files_open (ToolFiles *file,
                 const gchar *filename,
                 GError **error);

Open filename for read access. The file can be compressed or not.

Parameters

file

a ToolFiles object.

 

filename

a filename.

 

error

a location for an error.

 

Returns

TRUE if no error occured when opening the file.

Since: 3.8


tool_files_read_line_string ()

GIOStatus
tool_files_read_line_string (ToolFiles *file,
                             GString *buffer,
                             gsize *terminator_pos,
                             GError **error);

Read a new line from file and put it into buffer . This works like g_io_channel_read_line_string() but is transparent for compressed files.

Parameters

file

a ToolFiles object.

 

buffer

an allocated string.

[out caller-allocates]

terminator_pos

position of the terminator in buffer .

[out caller-allocates]

error

an error location.

 

Returns

a status.

Since: 3.8


tool_files_rewind ()

GIOStatus
tool_files_rewind (ToolFiles *file,
                   GError **error);

Transparently rewind file at the beginning for compressed files or not.

Parameters

file

a ToolFiles object.

 

error

an error location.

 

Returns

a status.

Since: 3.8

Types and Values

struct ToolFiles

struct ToolFiles;

An opaque structure for the scalar field.


struct ToolFilesClass

struct ToolFilesClass {
  VisuObjectClass parent;
};

An opaque structure for the class.

Members

VisuObjectClass parent;

the parent class.