Remove YouTubeClient::urlEncode/decodeHtmlEntities/parseIso8601Duration and StateSerializer::getCurrentTimestampISO8601 — each just forwarded to one Void call — and have the ~12 call sites call Void directly (Void::Encoding::Url::encode, Void::Text::html_unescape, Void::Time::parse_iso8601_interval(...).value_or(0), Void::Time::utc_now_iso8601). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
968 B
C++
41 lines
968 B
C++
#pragma once
|
|
#include "StateBlob.hpp"
|
|
#include "echoion/core/state/StateVersions.hpp"
|
|
#include <Types.hpp>
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace Echoion::Core
|
|
{
|
|
|
|
class StateSerializer
|
|
{
|
|
public:
|
|
|
|
// Current version being used
|
|
static constexpr uint32_t CURRENT_VERSION = 1;
|
|
|
|
// Serialize current state to opaque blob
|
|
static Api::StateBlob serialize(const StateV1& state);
|
|
|
|
// Deserialize blob to current version (handles migration)
|
|
static Api::Result<StateV1> deserialize(const Api::StateBlob& blob);
|
|
|
|
// Check if version is supported
|
|
static bool isVersionSupported(uint32_t version);
|
|
|
|
// Get supported version range
|
|
static uint32_t getMinimumSupportedVersion();
|
|
static uint32_t getCurrentVersion();
|
|
|
|
private:
|
|
|
|
// Extract version from JSON blob
|
|
static uint32_t extractVersion(const std::string& jsonStr);
|
|
|
|
// Make it accessible to StateMigration
|
|
friend class StateMigration;
|
|
};
|
|
|
|
} // namespace Echoion::Core
|