/*
 *  db.h
 *  (C) gsd 2001
 */                                                                             

#ifndef DATABASE_H
#define DATABASE_H

#include <string>
#include <iostream>

#include "mesbus.h"
#include "term.h"

class CDataBase : public CMessageBus
{
public:
        CDataBase( std::string name = "local.db");
private:
    void    receive( long sender, std::string);
    bool    find( std::string uid, streampos &pos);
    bool    store( std::string uid, std::string s);
    bool    remove( std::string uid);
    bool    retrieve( std::string uid, std::string &s);

    filebuf fb;     // the file buffer
    istream ifile;  // the input stream over fb
    ostream ofile;  // the output stream over fb  
};

#endif /* DATABASE_H */