/*--------------------------------------------------------------------------
 * dhtfile.h - definitions/declarations for
 *             class handling Gauss ,DHT/.DAT file
 *
 *       Jurgen Doornik 1996
 *
 *--------------------------------------------------------------------------*/

#ifndef DHTFILE_INCLUDED
#define DHTFILE_INCLUDED

class DhtFile
{
    decl m_file;          // the file pointer
    decl m_fIs32bit;      // TRUE for 32 bit (extended) file
    decl m_r, m_c;        // number of rows, columns
    decl m_asNames;       // variable names
    decl m_sFilename;     // file name
    decl m_iCptr;         // column file pointer
    decl m_cBlockSize;    // block size for column reading
                          // default is 1024, use 1 for seek-wise reading

    DhtFile();            // constructor
    ~DhtFile();           // destructor
    OpenRead(const fname);// opens a .dht file (no extension!!!) for reading
    Close();              // closes the file
    Info();               // prints information on the file
    Readr(const r);       // read r rows from the file
    Readc(c);             // read c columns from the file
                          // if c is a string, it reads the named column.
    Readv(const s);       // read a column by name
    Seekr(const r);       // position at row r (0 is first, 1 is second, etc.)
    Seekc(const c);       // position at column r (0 is first, 1 is 2nd, etc.)
    SetBlockSize(const b);// sets the block size for column reading
};

#endif /* DHTFILE_INCLUDED */
