35 lines
842 B
C++
35 lines
842 B
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Echoion::Api
|
|
{
|
|
|
|
// Opaque state blob - contents are internal to Core
|
|
// Plugin should NEVER inspect or modify the data field
|
|
struct StateBlob {
|
|
std::vector<uint8_t>
|
|
data; // Serialized state data (JSON using glaze)
|
|
uint32_t version = 0; // Format version (for logging/debugging only)
|
|
std::string timestamp; // ISO 8601 timestamp when saved
|
|
|
|
bool empty() const { return data.empty(); }
|
|
size_t size() const { return data.size(); }
|
|
|
|
// Clear the state
|
|
void clear()
|
|
{
|
|
data.clear();
|
|
version = 0;
|
|
timestamp.clear();
|
|
}
|
|
};
|
|
|
|
// Constants for state management
|
|
constexpr uint32_t MAX_SUPPORTED_STATE_VERSION_AGE =
|
|
10; // Support 10 versions back
|
|
constexpr uint32_t STATE_VERSION_NONE = 0;
|
|
|
|
} // namespace Echoion::Api
|