/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the iWear Database Access Library.
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __DCAGDATACSVREADER_H
#define __DCAGDATACSVREADER_H

#ifndef __IWEAR_H
#include <iwear/iwear.h>
#endif

#ifndef __CSVPARSER_H
#include <iwear_utils/csvparser.h>
#endif

#ifndef __CAR_H
#include <iwear_dcag_mark_assistant/car.h>
#endif

#ifndef __CHECK_H
#include <iwear_dcag_mark_assistant/check.h>
#endif

#include <list>

using namespace std;
using namespace iwear::utilities;

namespace iwear {
    namespace dcag {
/**
 * This class is a representation of the iwear dcag subassemblies.
 */
class DcagDataCsvReader: CSVParser
{
private:
   list<list<string>*>* csvtokens;
   list<Car*> cars;
   list<Car*> parse_cars();
   list<Weldpoint*>::iterator find_weldpoint(uint32_t name, list<Weldpoint*>* weldpoints);
   list<Car*>::iterator find_car(string name, list<Car*>* cars);
   static list<Check*> read_check_dir(const char* folder);
public:
   virtual ~DcagDataCsvReader( );
   DcagDataCsvReader(string filename, string folder);
   list<Car*> get_cars();
   
    /** Gets all saved checks which are available for loading.
     * @prarm saved_check_dir The directory where the checks are
     *  located.
     * @return A list of all available saved checks. 
     */
   static list<Check*> get_saved_checks(const string& saved_check_dir);

    /** Gets all new checks which are available for loading.
     * @prarm saved_check_dir The directory where the checks are
     *  located.
     * @return A list of all new available checks. 
     */
   static list<Check*> get_checks(const string& check_dir);
};
} // namespace dcag
} // namespace iwear
#endif
