22 #ifndef CRNSAVABLE_HEADER
23 #define CRNSAVABLE_HEADER
101 std::unique_ptr<Map> user_data;
125 virtual Path completeFilename(
const Path &fn)
const;
127 virtual void load(
const Path &fname);
129 virtual void save(
const Path &fname);
Savable & operator=(const Savable &)=delete
No assignment allowed.
complex base abstract class
bool IsUserData(const String &key) const
Tests if a user data key exists.
std::unique_ptr< std::mutex > filelock
const String & GetName() const
Returns the name of the object.
void SetName(String &&s) noexcept
Sets the name of the object.
void serialize_internal_data(xml::Element &el) const
Dumps some internal data to an XML element.
void Load(const Path &fname)
Loads the object from an XML file (Safe)
virtual ~Savable()
Destructor.
A UTF32 character string class.
void SetUserData(const String &key, SObject value)
Adds or replaces a user data.
A convenience class for file paths.
String GetUserDataKey(const SObject &value) const
Gets a user data key by value.
void ClearUserData()
Deletes all user data entries.
void setFilename(Path &&fname) noexcept
Overwrites the filename.
void Save()
Saves the object to an already set XML file.
SObject GetUserData(const String &key)
Gets a user data by key.
const Path & GetFilename() const noexcept
Returns the file name of the object.
void DeleteUserData(const String &key)
Deletes a user data entry and frees the value.
void setFilename(const Path &fname)
Overwrites the filename.
void SetName(const String &s)
Sets the name of the object.
CRN_ALIAS_SMART_PTR(ImageBW)
void deserialize_internal_data(xml::Element &el)
Initializes some internal data from an XML element.
Savable(const String &s=U"")
Default constructor.