//=-- FSNormal.h - Normal Uncompressed File Streams --------------------------=
//
//   This class provides one implementation of the FileStreamPlugin interface.
//   This allows MagicStats to read from normal uncompressed files.  Pretty
//   simple stuff.
//
//=---------------------------------------------------------------------------=
//  This file is copyright (c) 1997-1998 Chris Lattner
//=---------------------------------------------------------------------------=

#ifndef FSNORMAL_H
#define FSNORMAL_H

#include "FileStreamPlugin.h"
#include <stdio.h>
#include <assert.h>

class FSNormal : public FileStreamPluginImpl<FSNormal> {
public:
  
  virtual ~FSNormal();   // Destructor to clean things up...

  FSNormal(int &CE) { CE = 1; }
  FSNormal(const char *Filename, int OpenCode, int &ErrorOccurred);

  // Implement the FileStreamPlugin API
  virtual int seek(long Position, int From = SeekSet);
  virtual long tell();
  virtual FileStreamPlugin *getline(char *Buffer, int BufferLength, char Delimiter = '\n');
  virtual int eof();

  inline static unsigned int GetCurrentVersion() {
    return 100;                       // Version 1.00
  }

  inline static const char *GetPluginName() {
    return "Normal";
  }

  // This has the very lowest priority, because it should only be used as a 
  // last resort.  
  static int GetPriority() { return 1000; }

private :
  FILE *F;
};

#endif
