Diff for /parser3/src/classes/table.C between versions 1.267 and 1.269

version 1.267, 2009/09/08 09:11:51 version 1.269, 2009/11/09 00:31:07
Line 9  static const char * const IDENT_TABLE_C= Line 9  static const char * const IDENT_TABLE_C=
   
 #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4))  #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4))
 #include <sstream>  #include <sstream>
 using namespace std;  
 #endif  #endif
   
 #include "classes.h"  #include "classes.h"
Line 55  String table_reverse_name(TABLE_REVERSE_ Line 54  String table_reverse_name(TABLE_REVERSE_
 // methods  // methods
   
 static Table::Action_options get_action_options(Request& r, MethodParams& params,   static Table::Action_options get_action_options(Request& r, MethodParams& params, 
                                                 const Table& source) {                                                  size_t options_index, const Table& source) {
         Table::Action_options result;          Table::Action_options result;
         if(!params.count())          if(params.count() <= options_index)
                 return result;                  return result;
   
         Value& maybe_options=params.last();          Value& maybe_options=params[options_index];
 /* can not do it:   /* can not do it: 
         want to enable ^table::create[$source;          want to enable ^table::create[$source;
 #               $.option[]  #               $.option[]
Line 157  struct TableSeparators { Line 156  struct TableSeparators {
 static void _create(Request& r, MethodParams& params) {  static void _create(Request& r, MethodParams& params) {
         // clone/copy part?          // clone/copy part?
         if(Table *source=params[0].get_table()) {          if(Table *source=params[0].get_table()) {
                 Table::Action_options o=get_action_options(r, params, *source);                  Table::Action_options o=get_action_options(r, params, 1, *source);
                 check_option_param(o.defined, params, 1,                   check_option_param(o.defined, params, 1, 
                         "too many parameters");                          "too many parameters");
                 GET_SELF(r, VTable).set_table(*new Table(*source, o));                  GET_SELF(r, VTable).set_table(*new Table(*source, o));
Line 388  static void _load(Request& r, MethodPara Line 387  static void _load(Request& r, MethodPara
   
 #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4))  #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4))
   
 void maybe_enclose( ostringstream& to, const String& from, char encloser ) {  #include "gc_allocator.h"
   
   typedef std::basic_stringstream<char, std::char_traits<char>, gc_allocator<char> > pa_stringstream;
   typedef std::basic_string<char, std::char_traits<char>, gc_allocator<char> > pa_string;
   
   void maybe_enclose( pa_stringstream& to, const String& from, char encloser ) {
         if(encloser) {          if(encloser) {
                 to<<encloser;                  to<<encloser;
                 // while we have 'encloser'...                  // while we have 'encloser'...
Line 479  static void _save(Request& r, MethodPara Line 483  static void _save(Request& r, MethodPara
   
 #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4))  #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4))
   
         ostringstream ost(stringstream::out);          pa_stringstream ost(std::stringstream::out);
   
         // process header          // process header
         if(output_column_names) {          if(output_column_names) {
Line 521  static void _save(Request& r, MethodPara Line 525  static void _save(Request& r, MethodPara
   
         // write          // write
         {          {
                 string data=ost.str();                  pa_string data=ost.str();
                 const char* data_cstr=data.c_str();                  const char* data_cstr=data.c_str();
   
                 file_write(r.charsets, file_spec, data_cstr, data.length(), true /* as text */, do_append);                  file_write(r.charsets, file_spec, data_cstr, data.length(), true /* as text */, do_append);
Line 962  static bool _locate_name_value(Table& ta Line 966  static bool _locate_name_value(Table& ta
 static void _locate(Request& r, MethodParams& params) {  static void _locate(Request& r, MethodParams& params) {
         Table& table=GET_SELF(r, VTable).table();          Table& table=GET_SELF(r, VTable).table();
   
         Table::Action_options o=get_action_options(r, params, table);          Table::Action_options o=get_action_options(r, params, 1, table);
   
         bool result=params[0].get_junction()?          bool result=params[0].get_junction()?
                 _locate_expression(table, o, r, params) :                  _locate_expression(table, o, r, params) :
Line 1021  static void _join(Request& r, MethodPara Line 1025  static void _join(Request& r, MethodPara
                         "source is not a table");                          "source is not a table");
         Table& src=*maybe_src;          Table& src=*maybe_src;
   
         Table::Action_options o=get_action_options(r, params, src);          Table::Action_options o=get_action_options(r, params, 1, src);
         check_option_param(o.defined, params, 1,          check_option_param(o.defined, params, 1,
                 "invalid extra parameter");                  "invalid extra parameter");
   

Removed from v.1.267  
changed lines
  Added in v.1.269


E-mail: