/***************************************************************************
                          FileReader.cpp  -  description
                             -------------------
    begin                : Sam Nov 22 2003
    copyright            : (C) 2003 by klaus frieler
    email                : kgf@omniversum.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#include "types.h"
#include "FileReader.h"

FileIOBase *FileIOFactory::Create(Format format)
{
   FileIOBase *pFileIO = 0;
   switch(format)
   {
      case esac:
         pFileIO =  new ESACIO();
      break;
      case csv:
         pFileIO =  new CSVIO();
      break;
      case gnu:
         pFileIO =  new GNUIO();
      break;
      case midi:
         pFileIO = new MIDIIO();
      break;
      case notes:
         pFileIO = new NotesIO();
      break;
      default:
      break;
   }
   return pFileIO;
}

void FileIOFactory::Destroy(FileIOBase **ppFileIO)
{
   if(ppFileIO && *ppFileIO){
      delete *ppFileIO;
      *ppFileIO = 0;
   }
   return;
}

