/**
* @file LabeledFileList.h
* @brief reads images from directory
* @author Erik Rodner
* @date 17.09.2007
*/
#ifndef LabeledFileListINCLUDE
#define LabeledFileListINCLUDE

#include <string>

#include "core/basics/Config.h"
#include "vislearning/baselib/ProgressBar.h"

#include "ClassNames.h"
#include "LocalizationResult.h"
#include "LabeledSet.h"
#include "LabeledSetFactory.h"

namespace OBJREC {

/**
 * @brief reads images from directory
 */
class LabeledFileList
{
  private:
    bool debug_dataset;

    LabeledSetFactory *m_pLabeledSetFactory;

    public:
  
	/** simple constructor */
	LabeledFileList(); 
      
	/** simple destructor */
	virtual ~LabeledFileList();
 
	LocalizationResult *getLocalizationInfo ( const ClassNames & classnames,
					    int classno,
					    const std::string & file,
					    const NICE::Config & conf ) const;

    /**
    * @brief extract multiple label information from different sources.
    *
    * Different sources specified in the logfile under section "main":
    *-"pattern" <br>
    *-"filelist" <br>
    *-"factoryxml" <br>
    *  xml file whose information is extracted and inserted into a LabeledSet. In order to use the right xml loader, a factory had to be provided
    * ( ::setFactory() ). [Johannes Ruehle]
    * @see LabeledSetFactory
    */
	void get ( const std::string & dir,
		   const NICE::Config & datasetconf,
		   const ClassNames & classnames, 
		   LabeledSet & ls,
		   bool localizationInfoDisabled = false,
		   bool debugDataset = false );
		   
	void getFromPattern ( const std::string & dir,
		   const NICE::Config & datasetconf,
		   const ClassNames & classnames, 
		   LabeledSet & ls,
		   bool localizationInfoDisabled = false ) const;


    void getFromList ( const std::string & filelist,
                       const NICE::Config & datasetconf,
                       const ClassNames & classnames,
                       LabeledSet & ls,
                       bool localizationInfoDisabled = false ) const;


    void setFactory(LabeledSetFactory *pLabeledSetFactory)
    {
         m_pLabeledSetFactory = pLabeledSetFactory;
    }

};


} // namespace

#endif
