Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Record.h

Go to the documentation of this file.
00001 // Record.h: Record style file model class definition
00002 // Haejoong Lee, Xiaoyi Ma, Steven Bird
00003 // Copyright (C) 2001 Linguistic Data Consortium, U Penn.
00004 // Web: http://www.ldc.upenn.edu/; Email: ldc@ldc.upenn.edu
00005 // For license information, see the file `LICENSE' included
00006 // with the distribution.
00007 
00008 
00009 #ifndef _RECORD_H_
00010 #define _RECORD_H_
00011 
00012 #include <string>
00013 #include <fstream>
00014 #include "agfioError.h"
00015 
00017 class Record
00018 {
00019 
00020 private:
00021   int       size;          // # fields per record
00022   ifstream  input;         // input file
00023   string    filename;      // input file name
00024   string    *record_buf;   // one entry buffer for a record
00025 
00026 protected:
00027   virtual void
00028   preprocess() {}
00029 
00030   virtual void
00031   postprocess() {}
00032 
00033   virtual void
00034   read_entry() = 0;
00035 
00036 public:
00041   class RangeError : public agfioError
00042   {
00043   public:
00044     RangeError(const string &s);
00045   };
00046 
00051   Record(int n);
00052 
00053   ~Record();
00054 
00061   bool
00062   open(const string &filename);
00063 
00072   bool
00073   readline(string& line);
00074 
00081   void
00082   put_ith(int i, const string& v);
00083 
00089   string
00090   get_ith(int i);
00091 
00093   string
00094   get_filename();
00095 
00097   int
00098   get_size();
00099 
00101   void
00102   clear_record_buf();
00103 
00110   bool
00111   good();
00112 
00119   bool
00120   eof();
00121 };
00122 
00123 
00124 #endif

Generated at Wed Jul 3 14:54:03 2002 for Annotation Graph API by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001