--- parser3/src/classes/file.C 2002/03/27 15:30:33 1.74 +++ parser3/src/classes/file.C 2002/04/19 11:18:04 1.81 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: file.C,v 1.74 2002/03/27 15:30:33 paf Exp $ + $Id: file.C,v 1.81 2002/04/19 11:18:04 paf Exp $ */ #include "pa_config_includes.h" @@ -26,8 +26,6 @@ // defines -#define FILE_CLASS_NAME "file" - #define TEXT_MODE_NAME "text" // class @@ -85,18 +83,18 @@ static void _find(Request& r, const Stri // passed file name simply exists in current dir if(file_readable(r.absolute(lfile_name))) { - r.write_no_lang(*new(pool) VString(lfile_name)); + r.write_no_lang(lfile_name); return; } // scan .. dirs for result for(int i=0; isize()>1) { regexp=¶ms->as_no_junction(1, "regexp must not be code").as_string(); @@ -317,8 +315,6 @@ static void _list(Request& r, const Stri throw Exception(0, ®exp->mid(erroffset, regexp->size()), "regular expression syntax error - %s", errptr); - - ovector=(int *)pool.malloc(sizeof(int)*(ovecsize=(1/*match*/)*3)); } else regexp_code=0; @@ -367,7 +363,6 @@ static void _list(Request& r, const Stri // write out result VTable& result=*new(pool) VTable(pool, &table); - result.set_name(method_name); r.write_no_lang(result); } @@ -393,10 +388,7 @@ static void _lock(Request& r, const Stri // constructor -MFile::MFile(Pool& apool) : Methoded(apool) { - set_name(*NEW String(pool(), FILE_CLASS_NAME)); - - +MFile::MFile(Pool& apool) : Methoded(apool, "file") { // ^save[mode;file-name] add_native_method("save", Method::CT_DYNAMIC, _save, 2, 2);