Ability: saveable

Description:

This ability is used for objects that can save their state on the disk, and later restore it from the disk.

The saveable ability is used mainly for saving user bodies and bulletin boards. For the so-called auto load objects you should use the reconstruct ability.

Usage:

#include <ability.h>

inherit SAVEABLE;

Functions:

string query_file_name()
Return the file name of the file to which this object is saved. The file name does not contain a trailing '.o', which is appended to it when the object is actually saved.

void set_file_name(string f)
Set the file name of the file to which this object is saved. The file name should not contain a trailing '.o', which is appended to it when the object is actually saved.

int restore(string f)
Restore the object from file f. By default this function will simply call the efun restore_object(), but you may redefine it if you wish.

int save()
Save the object to the file. By default this function will simply call the efun save_object(), but you may redefine it if you wish.

Source code:

/ability/saveable.c.

See also:

Ability: reconstruct