| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <string> |
| 4 |
|
| 5 |
namespace ui |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Interface of an object that supports saving and loading its state |
| 9 |
* to and from a registry key, respectively. |
| 10 |
*/ |
| 11 |
class IPersistableObject |
| 12 |
{ |
| 13 |
public: |
| 14 |
virtual ~IPersistableObject() {} |
| 15 |
|
| 16 |
// Load the state of this object from the given registry element |
| 17 |
virtual void loadFromPath(const std::string& registryKey) = 0; |
| 18 |
|
| 19 |
// Save the state of this object to the given registry element |
| 20 |
// It is allowed to create sub-elements. |
| 21 |
virtual void saveToPath(const std::string& registryKey) = 0; |
| 22 |
}; |
| 23 |
|
| 24 |
} |