## InfAdoptedSessionRecord InfAdoptedSessionRecord — Create a record of a session |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libinfinity/adopted/inf-adopted-session-record.h>

                        InfAdoptedSessionRecord;
    struct              InfAdoptedSessionRecordClass;
    InfAdoptedSessionRecord * inf_adopted_session_record_new
                                                            (InfAdoptedSession *session);
    gboolean            inf_adopted_session_record_start_recording
                                                            (InfAdoptedSessionRecord *record,
                                                             const gchar *filename,
                                                             GError **error);
    gboolean            inf_adopted_session_record_stop_recording
                                                            (InfAdoptedSessionRecord *record,
                                                             GError **error);
    gboolean            inf_adopted_session_record_is_recording
                                                            (InfAdoptedSessionRecord *record);

## Object Hierarchy

      GObject
       +----InfAdoptedSessionRecord

## Properties

      "session"                  InfAdoptedSession*    : Read / Write / Construct Only

## Description

InfAdoptedSessionRecord creates a record of a InfAdoptedSession. It records every modification made to the session from the beginning of its own lifetime to the end of its lifetime.

It does not record user status changes and thus the recorded session cannot reliably be replayed with all user information. It's main purpose is to make it easy to reproduce bugs in libinfinity. However, it might be extended in the future.

To replay a record, use InfAdoptedSessionReplay or the tool `inf-test-text-replay` in the infinote test suite.

## Details

### InfAdoptedSessionRecord

    typedef struct _InfAdoptedSessionRecord InfAdoptedSessionRecord;

InfAdoptedSessionRecord is an opaque data type. You should only access it via the public API functions.

### struct InfAdoptedSessionRecordClass

    struct InfAdoptedSessionRecordClass {
    };

This structure does not contain any public fields.

### inf_adopted_session_record_new ()

    InfAdoptedSessionRecord * inf_adopted_session_record_new
                                                            (InfAdoptedSession *session);

Creates a new InfAdoptedSessionRecord, recording `session`. To start recording, call `inf_adopted_session_record_start_recording()`.

`session` : | A InfAdoptedSession.
Returns : | A new InfAdoptedSessionRecord.

### inf_adopted_session_record_start_recording ()

    gboolean            inf_adopted_session_record_start_recording
                                                            (InfAdoptedSessionRecord *record,
                                                             const gchar *filename,
                                                             GError **error);

Starts to record the session. Make sure the session is not already closed before calling this function. If an error occurs, such as if `filename` could not be opened, then the function returns `FALSE` and `error` is set.

`record` : | A InfAdoptedSessionRecord.
`filename` : | The file in which to store the record.
`error` : | Location to store error information, if any.
Returns : | `TRUE` if the session is started to be recorded, `FALSE` on error.

### inf_adopted_session_record_stop_recording ()

    gboolean            inf_adopted_session_record_stop_recording
                                                            (InfAdoptedSessionRecord *record,
                                                             GError **error);

Stops the recording of the current session, which must have been started previously via `inf_adopted_session_record_start_recording()`. If an error occurs, then the function returns `FALSE` and `error` is set. Note that even if an error occurs, then the recording is stopped as well. However, the file might not have been completely written to disk, so you should still show any errors during this function to the user.

`record` : | A InfAdoptedSessionRecord.
`error` : | Location to store error information, if any.
Returns : | `TRUE` if the recording has been stored successfully, `FALSE` otherwise.

### inf_adopted_session_record_is_recording ()

    gboolean            inf_adopted_session_record_is_recording
                                                            (InfAdoptedSessionRecord *record);

Returns whether `record` is currently recording a session.

`record` : | A InfAdoptedSessionRecord.
Returns : | Whether `record` currently records the session.

## Property Details

### The `"session"` property

      "session"                  InfAdoptedSession*    : Read / Write / Construct Only

The session to record.

## See Also

InfAdoptedSession, InfAdoptedSessionReplay