#ifndef __FORENSICS_NTFSRUNLISTPROPAGATOR_HH__
#define __FORENSICS_NTFSRUNLISTPROPAGATOR_HH__

#include "forensics-gecode.hh"
#include "datasource.hh"
#include "unsafe.hh"
//#include "xmloutput.hh"
#include "ntfsmftentryxml.hh"
#include "ntfsmftentry.hh"
#include "ntfsseglist.hh"

class NTFSRunlistPropagator : public Gecode::Propagator
{
protected:
  GetDataSource m_callback;
  DataSource& ds;
  Gecode::Int::IntView m_clusterStart;
  Gecode::Int::IntView m_offsetStart;
  Gecode::Int::IntView m_offsetDATA;
  Gecode::ViewArray<Gecode::Int::IntView> m_blocks;
  Gecode::Int::IntView m_offsetInternal;
  Gecode::Int::IntView m_fileLength;
  NTFSMFTEntryXML& m_xmlout;

public:
NTFSRunlistPropagator (Gecode::Space& home, Gecode::Int::IntView clusterStart, Gecode::Int::IntView offsetStart, Gecode::Int::IntView offsetDATA, Gecode::ViewArray<Gecode::Int::IntView> blocks, Gecode::IntVar offsetInternal, Gecode::IntVar fileLength, GetDataSource callback, NTFSMFTEntryXML& xmlout);

  NTFSRunlistPropagator (Gecode::Space& home, bool share, NTFSRunlistPropagator& p);

  virtual Gecode::Propagator* copy (Gecode::Space& home, bool share);

  virtual size_t dispose (Gecode::Space& home);

  virtual Gecode::PropCost cost (const Gecode::Space& home, const Gecode::ModEventDelta& med) const;

  virtual Gecode::ExecStatus propagate (Gecode::Space& home, const Gecode::ModEventDelta& med);

static Gecode::ExecStatus post (Gecode::Space& home, Gecode::Int::IntView clusterStart, Gecode::Int::IntView offsetStart, Gecode::Int::IntView offsetDATA, Gecode::ViewArray<Gecode::Int::IntView> blocks, Gecode::IntVar offsetInternal, Gecode::IntVar fileLength, GetDataSource callback, NTFSMFTEntryXML& xmlout);
};


void ntfs_runlist (Gecode::Space& home, Gecode::IntVar clusterStart, Gecode::IntVar offsetStart, Gecode::IntVar offsetDATA, Gecode::IntVarArray blocks, Gecode::IntVar offsetInternal, Gecode::IntVar fileLength, GetDataSource callback, NTFSMFTEntryXML& xmlout);


extern std::string current_filename;


#endif

