Top |
enum | InfAdoptedSessionReplayError |
struct | InfAdoptedSessionReplay |
struct | InfAdoptedSessionReplayClass |
InfAdoptedSessionReplay can be used to replay a record created with InfAdoptedSessionRecord.
Use inf_adopted_session_replay_set_record()
to specify the recording to
replay, and then use inf_adopted_session_replay_get_session()
to obtain
the replayed session.
InfAdoptedSessionReplay *
inf_adopted_session_replay_new (void
);
Creates a new InfAdoptedSessionReplay. Use
inf_adopted_session_replay_set_record()
to start the recording, and
inf_adopted_session_replay_play_next()
or
inf_adopted_session_replay_play_to_end()
to play it.
gboolean inf_adopted_session_replay_set_record (InfAdoptedSessionReplay *replay
,const gchar *filename
,const InfcNotePlugin *plugin
,GError **error
);
Set the record file for replay
to play. It should have been created with
InfAdoptedSessionRecord. plugin
should match the type of the recorded
session. If an error occurs, the function returns FALSE
and error
is set.
replay |
||
filename |
Path to the record file to play. |
|
plugin |
A InfcNotePlugin for the note type of the recorded session. |
|
error |
Location to store error information, if any. |
InfAdoptedSession *
inf_adopted_session_replay_get_session
(InfAdoptedSessionReplay *replay
);
Returns the played back session, or NULL
if
inf_adopted_session_replay_set_record()
was not yet called.
gboolean inf_adopted_session_replay_play_next (InfAdoptedSessionReplay *replay
,GError **error
);
Reads the next request from the record and passes it to the session. Note
that this might do nothing if that request is not yet causally ready,
meaning that it depends on another request that has not yet been played. In
that case it will be executed as soon as it is ready, that is after some
future inf_adopted_session_replay_play_next()
call. Therefore, it is also
possible that this function executes more than one request.
If an error occurs, then this function returns FALSE
and error
is set.
If the end of the recording is reached, then it also returns FALSE
, but
error
is left untouched. If the next request has been read, then it
returns TRUE
.
gboolean inf_adopted_session_replay_play_to_end (InfAdoptedSessionReplay *replay
,GError **error
);
Plays all requests that are contained in the recording, so that the replay's session has the same state as the recorded session when the recording was stopped.
Note that, depending on the size of the record, this function may take some time to finish.
If an error occurs during replay, then the function returns FALSE
and
error
is set. Otherwise it returns TRUE
.
Error codes for the INF_ADOPTED_SESSION_REPLAY_ERROR
error domain. These can occur while loading or replaying a session
with InfAdoptedSessionReplay.
The record file could not be opened for reading. |
||
The record file contains invalid XML. |
||
The record file is not a session recording. |
||
The record file is a session recording for a different type of session than the one provided. |
||
The record file is invalid. |
||
More data was expected to be read from the record file, but the end of file was reached. |
struct InfAdoptedSessionReplay;
InfAdoptedSessionReplay is an opaque data type. You should only access it via the public API functions.
“filename”
property“filename” gchar *
The filename of the record to play.
Flags: Read
Default value: NULL