Files
ink-board/main/io/io.h

20 lines
570 B
C++

#pragma once
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
class KVStorageHandler {
public:
virtual ~KVStorageHandler() = default;
virtual void init(const EventGroupHandle_t& system_event_group) = 0;
// Store a key-value pair
virtual void put(const char*& key, const char*& value) = 0;
// Retrieve a value by key, returns nullptr if key not found
// The caller is responsible for freeing the returned memory
virtual char* get(const char*& key) const = 0;
// Delete a key-value pair
virtual void remove(const char*& key) = 0;
};