Public Access
- lib/storage_model (host-tested): FAT-safe names, daily Log paths, dates from Log/Capture file names, CleanupPlan by category and age, byte formatting - StorageService does all card I/O on its task: queued Log lines are written in batches each second (dropped while Logs are paused), plus file listing and deletion jobs - Settings > Storage moves into StoragePage: usage, Clean up (category, age with size preview, confirmation), Erase SD card - Clock: local date for Log names - Serial: log <text>, sd list Verified on the device: lines land in /irc/dev/#test/2026-10-02.log with folders created as needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
23 lines
789 B
C++
23 lines
789 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <initializer_list>
|
|
#include <string>
|
|
|
|
namespace roro::storage {
|
|
|
|
// Makes one path component safe for FAT: forbidden characters become '_', never empty or a dot name.
|
|
std::string sanitize(const std::string& name);
|
|
|
|
// "/irc/libera/#roro/2026-10-02.log" from {"irc", "libera", "#roro"} and a local date
|
|
// ("YYYY-MM-DD"); an empty date (clock not set yet) gives "undated.log".
|
|
std::string dailyLogPath(std::initializer_list<std::string> folders, const std::string& date);
|
|
|
|
// Day number (days since 1970-01-01) encoded in a Log ("2026-10-02.log") or Capture
|
|
// ("20261002-144500.pcap") file name, or -1 if the name carries no valid date.
|
|
int fileDay(const std::string& fileName);
|
|
|
|
int dayFromUtc(int64_t utcSeconds);
|
|
|
|
} // namespace roro::storage
|