32 lines
687 B
C++
32 lines
687 B
C++
#pragma once
|
|
#include "Types.hpp"
|
|
#include "echoion/core/state/StateVersions.hpp"
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace Echoion::Core
|
|
{
|
|
|
|
// Handles migration between state versions
|
|
class StateMigration
|
|
{
|
|
public:
|
|
|
|
// Migrate from any old version to current
|
|
static Api::Result<StateV1> migrate(uint32_t fromVersion,
|
|
const std::string& jsonData);
|
|
|
|
// Specific migrations
|
|
static StateV1 fromV0(const StateV0& v0);
|
|
|
|
// Check if migration path exists
|
|
static bool canMigrate(uint32_t fromVersion);
|
|
|
|
private:
|
|
|
|
// Migration chain: V0 -> V1 -> V2 -> ...
|
|
// Each version only knows how to migrate from previous
|
|
};
|
|
|
|
} // namespace Echoion::Core
|