using System;
using System.IO;
using Db4objects.Db4o;
using Db4objects.Db4o.Query;

namespace Orienteering.Data {
    public class DataBase {
        internal IObjectContainer db;
        private string file;

        public DataBase() {
            if (db != null)
                db.Close();

            file = Path.GetTempFileName();
            db = Db4oFactory.OpenFile(file);
        }

        public void Close() {
            db.Close();
            File.Delete(file);
        }
    }
}
