#pragma once #include #include #include namespace roro { struct StoredFile { std::string path; uint64_t bytes; }; // What Storage Clean-up offers (see CONTEXT.md). Notes are deliberately absent. struct CleanupCategory { const char* label; const char* folder; }; inline const CleanupCategory kCleanupCategories[] = { {"IRC logs", "/irc"}, {"Wi-Fi scan logs", "/wifi/scans"}, {"Wi-Fi captures", "/captures/wifi"}, {"LoRa captures", "/captures/lora"}, {"GNSS tracks", "/gnss/tracks"}, }; enum class CleanupAge { OneMonth, ThreeMonths, SixMonths, OneYear, Everything }; inline const char* const kCleanupAgeLabels[] = {"Older than 1 month", "Older than 3 months", "Older than 6 months", "Older than 1 year", "Everything"}; // The files a clean-up would delete, and how much space that frees. Dates come from file names; // undated files are only removed by Everything. struct CleanupPlan { std::vector paths; uint64_t bytes = 0; static CleanupPlan make(const std::vector& files, CleanupAge age, int todayDay); }; std::string formatBytes(uint64_t bytes); } // namespace roro