#include "stealth.h"

#include <unistd.h>
#include <sstream>
#include <thread>
#include <chrono>

#include <bobcat/mstream>
#include <bobcat/exception>
#include <bobcat/linearmap>
#include <bobcat/process>
#include <bobcat/ifdstream>
#include <bobcat/ofdstream>
#include <bobcat/localclientsocket>
#include <bobcat/localserversocket>

#include "../policyfile/policyfile.h"
#include "../integrityscanner/integrityscanner.h"
#include "../report/report.h"
#include "../msg/msg.h"
#include "../util/util.h"


inline void Stealth::timestamp(char const *label)
{
    d_report->timestamp(label, d_integrityScanner->nScans());
}

inline void Stealth::startThread(void (Stealth::*member)(), Stealth *obj)
{
    (obj->*member)();
}

using namespace std;
using namespace FBB;

class LogReportbuf: public streambuf
{
    Report &d_report;

    public:
        LogReportbuf(Report &report);

    private:
        int overflow(int ch) override;
        int sync() override;
};
