Diff for /parser3/src/classes/table.C between versions 1.150 and 1.151

version 1.150, 2002/04/15 13:17:04 version 1.151, 2002/04/18 10:51:00
Line 15 Line 15
 #include "pa_sql_connection.h"  #include "pa_sql_connection.h"
 #include "pa_vbool.h"  #include "pa_vbool.h"
   
 // defines  
   
 #define TABLE_CLASS_NAME "table"  
   
 // class  // class
   
 class MTable : public Methoded {  class MTable : public Methoded {
Line 203  static void _save(Request& r, const Stri Line 199  static void _save(Request& r, const Stri
   
 static void _count(Request& r, const String& method_name, MethodParams *) {  static void _count(Request& r, const String& method_name, MethodParams *) {
         Pool& pool=r.pool();          Pool& pool=r.pool();
         Value& value=*new(pool) VInt(pool, static_cast<VTable *>(r.self)->table().size());          int result=static_cast<VTable *>(r.self)->table().size();
         value.set_name(method_name);          r.write_no_lang(*new(pool) VInt(pool, result));
         r.write_no_lang(value);  
 }  }
   
 static void _line(Request& r, const String& method_name, MethodParams *) {  static void _line(Request& r, const String& method_name, MethodParams *) {
         Pool& pool=r.pool();          Pool& pool=r.pool();
         Value& value=*new(pool) VInt(pool, 1+static_cast<VTable *>(r.self)->table().current());          int result=1+static_cast<VTable *>(r.self)->table().current();
         value.set_name(method_name);          r.write_no_lang(*new(pool) VInt(pool, result));
         r.write_no_lang(value);  
 }  }
   
 static void _offset(Request& r, const String& method_name, MethodParams *params) {  static void _offset(Request& r, const String& method_name, MethodParams *params) {
Line 234  static void _offset(Request& r, const St Line 228  static void _offset(Request& r, const St
                                   
                 Value& offset_expr=params->as_junction(params->size()-1, "offset must be expression");                  Value& offset_expr=params->as_junction(params->size()-1, "offset must be expression");
                 table.offset(absolute, r.process_to_value(offset_expr).as_int());                  table.offset(absolute, r.process_to_value(offset_expr).as_int());
         } else {          } else
                 Value& value=*new(pool) VInt(pool, table.current());                  r.write_no_lang(*new(pool) VInt(pool, table.current()));
                 value.set_name(method_name);  
                 r.write_no_lang(value);  
         }  
 }  }
   
 static void _menu(Request& r, const String& method_name, MethodParams *params) {  static void _menu(Request& r, const String& method_name, MethodParams *params) {
Line 327  static void _hash(Request& r, const Stri Line 318  static void _hash(Request& r, const Stri
                         Row_info row_info={&self_table, key_field, &value_fields, result.get_hash(0)};                          Row_info row_info={&self_table, key_field, &value_fields, result.get_hash(0)};
                         self_table.for_each(table_row_to_hash, &row_info);                          self_table.for_each(table_row_to_hash, &row_info);
                 }                  }
         result.set_name(method_name);  
         r.write_no_lang(result);          r.write_no_lang(result);
 }  }
   
Line 435  static bool _locate_name_value(Request& Line 425  static bool _locate_name_value(Request&
 }  }
 static void _locate(Request& r, const String& method_name, MethodParams *params) {  static void _locate(Request& r, const String& method_name, MethodParams *params) {
         Pool& pool=r.pool();          Pool& pool=r.pool();
         Value& result=*new(pool) VBool(pool,           bool result=params->get(0).get_junction()?
                 params->get(0).get_junction()?  
                 _locate_expression(r, method_name, params) :                  _locate_expression(r, method_name, params) :
                 _locate_name_value(r, method_name, params));                  _locate_name_value(r, method_name, params);
         result.set_name(method_name);          r.write_no_lang(*new(pool) VBool(pool, result));
         r.write_no_lang(result);  
 }  }
   
 static void _flip(Request& r, const String& method_name, MethodParams *params) {  static void _flip(Request& r, const String& method_name, MethodParams *params) {
Line 635  static void _columns(Request& r, const S Line 623  static void _columns(Request& r, const S
                 }                  }
         }          }
   
         VTable& result=*new(pool) VTable(pool, &result_table);          r.write_no_lang(*new(pool) VTable(pool, &result_table));
         result.set_name(method_name);  
         r.write_no_lang(result);  
 }  }
   
 static void _select(Request& r, const String& method_name, MethodParams *params) {  static void _select(Request& r, const String& method_name, MethodParams *params) {
Line 665  static void _select(Request& r, const St Line 651  static void _select(Request& r, const St
         }          }
         source_table.set_current(saved_current);          source_table.set_current(saved_current);
   
         VTable& result=*new(pool) VTable(pool, &result_table);          r.write_no_lang(*new(pool) VTable(pool, &result_table));
         result.set_name(method_name);  
         r.write_no_lang(result);  
 }  }
   
 // constructor  // constructor
   
 MTable::MTable(Pool& apool) : Methoded(apool) {  MTable::MTable(Pool& apool) : Methoded(apool, "table") {
         set_name(*NEW String(pool(), TABLE_CLASS_NAME));  
   
         // ^table::create{data}          // ^table::create{data}
         // ^table::create[nameless]{data}          // ^table::create[nameless]{data}
         // ^table::create[table]          // ^table::create[table]

Removed from v.1.150  
changed lines
  Added in v.1.151


E-mail: