--- parser3/src/classes/hashfile.C 2003/11/06 08:22:48 1.24 +++ parser3/src/classes/hashfile.C 2003/11/06 10:25:40 1.26 @@ -6,7 +6,7 @@ */ -static const char* IDENT="$Id: hashfile.C,v 1.24 2003/11/06 08:22:48 paf Exp $"; +static const char* IDENT="$Id: hashfile.C,v 1.26 2003/11/06 10:25:40 paf Exp $"; #include "classes.h" @@ -39,30 +39,23 @@ static void _open(Request& r, MethodPara self.open(r.absolute(params.as_string(0, "filename must be string"))); } -#if LATER static void _hash(Request& r, MethodParams& params) { VHashfile& self=GET_SELF(r, VHashfile); // write out result - VHash& result=*new(pool) VHash(pool, *self.get_hash(&method_name)); - result.set_name(method_name); + VHash& result=*new VHash(*self.get_hash()); r.write_no_lang(result); } static void _delete(Request& r, MethodParams& params) { VHashfile& self=GET_SELF(r, VHashfile); - if(params.size()==0) - self.mark_to_cancel_cache(); - else { - // key - const String &key=params.as_string(0, "key must be string"); - // remove - self.get_table_ptr(&method_name)->remove(key); - } + // key + const String &key=params.as_string(0, "key must be string"); + // remove + self.remove(key); } -#endif static void _clear(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.clear(); @@ -115,9 +108,9 @@ MHashfile::MHashfile(): Methoded("hashfi // ^hashfile::open[db_home;filename] add_native_method("open", Method::CT_DYNAMIC, _open, 1, 1); // ^hash[] -// add_native_method("hash", Method::CT_DYNAMIC, _hash, 0, 0); + add_native_method("hash", Method::CT_DYNAMIC, _hash, 0, 0); // ^hashfile.delete[key] -// add_native_method("delete", Method::CT_DYNAMIC, _delete, 0, 1); + add_native_method("delete", Method::CT_DYNAMIC, _delete, 1, 1); // ^hashfile.clear[] add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); // ^hashfile.foreach[key;value]{code}[delim]