InfAdoptedSessionRecord: libinfinity-0.7 Reference Manual

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

## Stability Level

Unstable, unless otherwise indicated

## Functions

InfAdoptedSessionRecord * | inf_adopted_session_record_new ()
gboolean | inf_adopted_session_record_start_recording ()
gboolean | inf_adopted_session_record_stop_recording ()
gboolean | inf_adopted_session_record_is_recording ()

## Properties

gchar * | filename | Read
InfAdoptedSession * | session | Read / Write / Construct Only

## Types and Values

struct | InfAdoptedSessionRecord
struct | InfAdoptedSessionRecordClass

## Object Hierarchy

        GObject
        ╰── InfAdoptedSessionRecord

## Includes

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

## 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.

## Functions

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

[constructor]

#### Parameters

session | A InfAdoptedSession. |

#### Returns

A new InfAdoptedSessionRecord.

[transfer full]

### 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.

#### Parameters

record | A InfAdoptedSessionRecord. |
filename | The file in which to store the record. | [type filename]
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.

#### Parameters

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.

#### Parameters

record | A InfAdoptedSessionRecord. |

#### Returns

Whether `record` currently records the session.

## Types and Values

### struct InfAdoptedSessionRecord

    struct 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.

## Property Details

### The `“filename”` property

      “filename”                 gchar *

The filename of the record file.

Owner: InfAdoptedSessionRecord

Flags: Read

Default value: NULL

### The `“session”` property

      “session”                  InfAdoptedSession *

The session to record.

Owner: InfAdoptedSessionRecord

Flags: Read / Write / Construct Only

## See Also

InfAdoptedSession, InfAdoptedSessionReplay