Top | ![]() |
![]() |
![]() |
![]() |
Storage of text sessions on the file systemStorage of text sessions on the file system — Utility functions to deal with storing InfTextSessions in filesystem storage |
The functions in this section are utility functions that can be used when implementing a InfdNotePlugin to handle InfTextSessions. These functions implement reading and writing the content of an InfTextSession to an XML file in the storage.
gboolean inf_text_filesystem_format_read (InfdFilesystemStorage *storage
,const gchar *path
,InfUserTable *user_table
,InfTextBuffer *buffer
,GError **error
);
Reads a text session from path
in storage
. The file is expected to have
been saved with inf_text_filesystem_format_write()
before. The user_table
parameter should be an empty user table that will be used for the session,
and the buffer
parameter should be an empty InfTextBuffer, and the
document will be written into this buffer. If the function succeeds, the
user table and buffer can be used to create an InfTextSession with
inf_text_session_new_with_user_table()
. If the function fails, FALSE
is
returned and error
is set.
storage |
||
path |
Storage path to retrieve the session from. |
|
user_table |
An empty InfUserTable to use as the new session's user table. |
|
buffer |
An empty InfTextBuffer to use as the new session's buffer. |
|
error |
Location to store error information, if any, or |
gboolean inf_text_filesystem_format_write (InfdFilesystemStorage *storage
,const gchar *path
,InfUserTable *user_table
,InfTextBuffer *buffer
,GError **error
);
Writes the given user table and buffer into the filesystem storage at
path
. If successful, the session can then be read back with
inf_text_filesystem_format_read()
. If the function fails, FALSE
is
returned and error
is set.
storage |
||
path |
Storage path where to write the session to. |
|
user_table |
The InfUserTable to write. |
|
buffer |
The InfTextBuffer to write. |
|
error |
Location to store error information, if any, or |
Errors that can occur when reading a InfTextSession from a InfdFilesystemStorage.