Ajouter la gestion de l'historique des actions

Signed-off-by: BlackAngelTV <dami.scoot3@gmail.com>
This commit is contained in:
BlackAngelTV committed 2026-08-24 21:13:50 +02:00
1 parent a0fbb3d210
commit b504289d18
2 files changed
+133

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <string>
#include <vector>
#include <ctime>
#include <fstream>
#include <sstream>
#include <iostream>
struct HistoryEntry {
std::string timestamp;
std::string action; // "install", "remove", "update"
std::string package;
std::string plugin;
bool success;
};
class HistoryManager {
public:
HistoryManager(const std::string& historyFile = "~/.local/share/PackageMapper/history.csv");
~HistoryManager();
void record(const HistoryEntry& entry);
const std::vector<HistoryEntry>& getHistory() const;
void clear();
void save();
void load();
private:
std::string m_historyFile;
std::vector<HistoryEntry> m_history;
std::string expandPath(const std::string& path);
std::string getCurrentTimestamp();
};