#pragma once

#include <string>
#include <atomic>
#include <thread>

#include <seallib/log.h>

class CacheCleaner
{
    public:
        CacheCleaner();
        ~CacheCleaner();

        void init();
        void shutdown();

    private:
        std::string getLocalAppDataPath();
        void clearFolder(std::string& path);
        void monitorLoop();

        std::atomic<bool> _running;
        std::unique_ptr<std::thread> _monitorThread;
        std::string _cacheDir;

        seallib::Logger* _log = nullptr;
};
