InfdFilesystemStorage

InfdFilesystemStorage

Functions

Properties

gchar * root-directory Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── InfdFilesystemStorage

Implemented Interfaces

InfdFilesystemStorage implements InfdStorage.

Description

Functions

infd_filesystem_storage_new ()

InfdFilesystemStorage *
infd_filesystem_storage_new (const gchar *root_directory);

Creates a new InfdFilesystemStorage that stores its nodes in the given directory on the file system. The directory is created if it does not exist.

Parameters

root_directory

A directory name in UTF-8.

 

Returns

A new InfdFilesystemStorage.


infd_filesystem_storage_open ()

FILE *
infd_filesystem_storage_open (InfdFilesystemStorage *storage,
                              const gchar *identifier,
                              const gchar *path,
                              const gchar *mode,
                              GError **error);

Opens a file in the given path within the storage's root directory. If the file exists already, and mode is set to "w", the file is overwritten.

Parameters

storage

A InfdFilesystemStorage.

 

identifier

The type of node to open.

 

path

Tha path to open.

 

mode

Either "r" for reading or "w" for writing.

 

error

Location to store error information, if any.

 

Returns

A stream for the open file. Close with fclose().

Types and Values

enum InfdFilesystemStorageError

Members

INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH

   

INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES

   

INFD_FILESYSTEM_STORAGE_ERROR_FAILED

   

struct InfdFilesystemStorage

struct InfdFilesystemStorage;


struct InfdFilesystemStorageClass

struct InfdFilesystemStorageClass {
  GObjectClass parent_class;
};

Property Details

The “root-directory” property

  “root-directory”           gchar *

The directory in which the storage stores its content.

Flags: Read / Write / Construct Only

Default value: NULL