Top | ![]() |
![]() |
![]() |
![]() |
Storage of chat sessions on the file systemStorage of chat sessions on the file system — Utility functions to deal with storing InfChatSessions in filesystem storage |
gboolean | infd_chat_filesystem_format_read () |
gboolean | infd_chat_filesystem_format_write () |
The functions in this section are utility functions that can be used when implementing a InfdNotePlugin to handle InfChatSessions. These functions implement reading and writing the content of an InfChatSession to an XML file in the storage.
gboolean infd_chat_filesystem_format_read (InfdFilesystemStorage *storage
,const gchar *path
,InfChatBuffer *buffer
,GError **error
);
Reads a chat session from path
in storage
. The file is expected to have
been saved with infd_chat_filesystem_format_write()
before. The buffer
parameter should be an empty InfChatBuffer, and the document will be
written into this buffer. If the function succeeds, the buffer can be used
to create an InfChatSession with inf_chat_session_new()
. If the function
fails, FALSE
is returned and error
is set.
gboolean infd_chat_filesystem_format_write (InfdFilesystemStorage *storage
,const gchar *path
,InfChatBuffer *buffer
,GError **error
);
Writes the given buffer into the filesystem storage at path
. If
successful, the session can then be read back with
infd_chat_filesystem_format_read()
. If the function fails, FALSE
is
returned and error
is set.
storage |
||
path |
Storage path where to write the session to. |
|
buffer |
The InfChatBuffer to write. |
|
error |
Location to store error information, if any, or |
Errors that can occur when reading a InfChatSession from a InfdFilesystemStorage.