/*
 * Implementation of class VideoReader
 *
 * $Date$
 * $Revision$
 *
 */

#include "WImage/ImageArray.hh"
#include "WImage/VideoReader.hh"
#include "WImage/debug.h"
#include <stdexcept>
#include <fstream>

#if !(defined __WATCOMC__ && __WATCOMC__ < 1230)
using namespace std;
#endif

void
VideoReader::read (void)
{
  int success = 0;
  
  if (m_fname != NULL)
    {
      ifstream ifs (m_fname);
      if (!ifs)
        {
          success = -1;
        }
    }
  
  if (success == 0)
    {
      success = readfmt ();
    }
  
  switch (success)
    {
    case -1: throw ios_base::failure ("read: could not open file.");
    case -2: 
      throw invalid_argument ("read: invalid file format.");
    case 0: 
      /* do nothing */
      break;
    default: 
      {
      }
    }

}

