--- parser3/src/classes/table.C 2006/04/09 13:38:47 1.221 +++ parser3/src/classes/table.C 2007/03/15 10:11:18 1.225 @@ -5,7 +5,10 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_TABLE_C="$Date: 2006/04/09 13:38:47 $"; +static const char * const IDENT_TABLE_C="$Date: 2007/03/15 10:11:18 $"; + +#include +using namespace std; #include "classes.h" #include "pa_vmethod_frame.h" @@ -359,7 +362,7 @@ static void _load(Request& r, MethodPara GET_SELF(r, VTable).set_table(table); } -static void maybe_enclose( String& to, const String& from, char encloser, const String* sencloser ) { +void maybe_enclose( String& to, const String& from, char encloser, const String* sencloser ) { if(encloser) { to<<*sencloser; // while we have 'encloser'... @@ -379,8 +382,28 @@ static void maybe_enclose( String& to, c to<count()) + Value& voptions=params.as_no_junction(param_index++, "additional params must be hash"); + if( voptions.is_defined() && !voptions.is_string() ) { + if(HashStringValue* options=voptions.get_hash()) { + int valid_options=separators.load(*options); + if(valid_options!=options->count()) + throw Exception("parser.runtime", + 0, + "invalid option passed"); + } else { throw Exception("parser.runtime", 0, - "invalid option passed"); - } else - throw Exception("parser.runtime", - 0, - "additional params must be hash (did you spell mode parameter correctly?)"); - + "additional params must be hash (did you spell mode parameter correctly?)"); + } + } } if(param_indexcount()) + throw Exception("parser.runtime", + 0, + "invalid option passed"); + } else { + throw Exception("parser.runtime", + 0, + "additional params must be hash (did you spell mode parameter correctly?)"); + } + } + } + if(param_index i(*table.columns()); i.has_next(); ) { + maybe_enclose( ost, *i.next(), separators.encloser ); + if(i.has_next()){ + ost<count():0) + for(int column=0; column i(table); + while(i.has_next()) { + for(Array_iterator c(*i.next()); c.has_next(); ) { + maybe_enclose( ost, *c.next(), separators.encloser ); + if(c.has_next()) + ost<