Files
FWS-PacManage/history/history-manager.h
BlackAngelTV 2395ba3f17 refactor(tree): give the history, the archive and the self-update a folder
Three self-contained things shared src/ with the rest: the operation
history, the zip reader behind the .fwspacm installer, and the
self-update. Each moves to its own folder — history/, archive/ and
update/ — so a change to one does not have to reason about the others.
2026-09-29 21:25:03 +02:00

36 lines
790 B
C++

#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/PacManager/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();
};