--- parser3/src/classes/file.C 2001/04/27 15:19:22 1.31.2.1 +++ parser3/src/classes/file.C 2001/06/28 07:41:59 1.37 @@ -5,16 +5,18 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: file.C,v 1.31.2.1 2001/04/27 15:19:22 paf Exp $ + $Id: file.C,v 1.37 2001/06/28 07:41:59 parser Exp $ */ +static char *RCSId="$Id: file.C,v 1.37 2001/06/28 07:41:59 parser Exp $"; +#include "classes.h" #include "pa_request.h" -#include "_file.h" #include "pa_vfile.h" #include "pa_table.h" #include "pa_vint.h" #include "pa_exec.h" +// consts // defines @@ -23,9 +25,16 @@ // class class MFile : public Methoded { +public: // VStateless_class + + Value *create_new_value(Pool& pool) { return new(pool) VFile(pool); } + +public: // Methoded + bool used_directly() { return true; } + public: MFile(Pool& pool); - bool used_directly() { return true; } + }; // consts @@ -120,12 +129,7 @@ static void pass_cgi_header_attribute(Ar hash.put(string.mid(0, colon_pos), new(string.pool()) VString(string.mid(colon_pos+1, string.size()))); } -/** - ^exec[file-name] - ^exec[file-name;env hash] - ^exec[file-name;env hash;cmd;line;arg;s] - @todo fix `` in perl - they produced flipping consoles and no output to perl -*/ +/// @todo fix `` in perl - they produced flipping consoles and no output to perl static void _cgi(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool(); @@ -248,8 +252,8 @@ static void _cgi(Request& r, const Strin // constructor -MFile::MFile(Pool& pool, VStateless_class& vclass) { - set_name(NEW String(pool, FILE_CLASS_NAME)); +MFile::MFile(Pool& apool) : Methoded(apool) { + set_name(*NEW String(pool(), FILE_CLASS_NAME)); // ^save[file-name] @@ -269,9 +273,9 @@ MFile::MFile(Pool& pool, VStateless_clas // ^stat[disk-name] add_native_method("stat", Method::CT_DYNAMIC, _stat, 1, 1); - // ^exec[file-name] - // ^exec[file-name;env hash] - // ^exec[file-name;env hash;1cmd;2line;3ar;4g;5s] + // ^cgi[file-name] + // ^cgi[file-name;env hash] + // ^cgi[file-name;env hash;1cmd;2line;3ar;4g;5s] add_native_method("cgi", Method::CT_DYNAMIC, _cgi, 1, 2+5); } @@ -282,5 +286,5 @@ Methoded *file_class; // creator Methoded *MFile_create(Pool& pool) { - return new(pool) MFile(pool); + return file_class=new(pool) MFile(pool); }