#pragma once

#include <util/folder/path.h>
#include <util/generic/noncopyable.h>
#include <library/cpp/deprecated/atomic/atomic.h>

//TODO: (yrum) The dependencies is out of the control. This app should not depend on search & ranking. Fix it.

namespace NRTYServer {

class TParsedDoc;

class TFADumper : public TNonCopyable{
public:
    struct TArgs {
        TString IndexDir;
    };

    class THandler {
    public:
        virtual ~THandler() {}

        virtual bool OnParsedDoc(ui32 realDocId, const NRTYServer::TParsedDoc& doc) = 0;
    };

protected:
    TFADumper() {};

public:
    static THolder<TFADumper> Create(const TArgs& args);

    virtual bool Open() = 0;
    virtual bool Run(THandler& handler, TAtomic* stopFlag = nullptr) = 0;
    virtual bool Close() = 0;

    virtual ~TFADumper() {}
};
} // namespace TRTYServer
