InfdFilesystemStorage

InfdFilesystemStorage

Synopsis

enum                InfdFilesystemStorageError;
                    InfdFilesystemStorage;
struct              InfdFilesystemStorageClass;
InfdFilesystemStorage * infd_filesystem_storage_new     (const gchar *root_directory);
FILE *              infd_filesystem_storage_open        (InfdFilesystemStorage *storage,
                                                         const gchar *identifier,
                                                         const gchar *path,
                                                         const gchar *mode,
                                                         GError **error);

Object Hierarchy

  GObject
   +----InfdFilesystemStorage

Implemented Interfaces

InfdFilesystemStorage implements InfdStorage.

Properties

  "root-directory"           gchar*                : Read / Write / Construct Only

Description

Details

enum InfdFilesystemStorageError

typedef enum {
  /* The path contains invalid characters */
  INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH,
  /* Failed to remove files from disk */
  INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES,

  INFD_FILESYSTEM_STORAGE_ERROR_FAILED
} InfdFilesystemStorageError;


InfdFilesystemStorage

typedef struct _InfdFilesystemStorage InfdFilesystemStorage;


struct InfdFilesystemStorageClass

struct InfdFilesystemStorageClass {
  GObjectClass parent_class;
};


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.

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.

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().

Property Details

The "root-directory" property

  "root-directory"           gchar*                : Read / Write / Construct Only

The directory in which the storage stores its content.

Default value: NULL