Diff for /parser3/src/classes/string.C between versions 1.204 and 1.205

version 1.204, 2012/04/19 19:41:29 version 1.205, 2012/06/08 11:44:02
Line 534  const String* sql_result_string(Request& Line 534  const String* sql_result_string(Request&
         ulong offset=0;          ulong offset=0;
         default_code=0;          default_code=0;
         if(params.count()>1)          if(params.count()>1)
                 if(HashStringValue* options=params.as_hash(1)) {                  if(HashStringValue* options=params.as_hash(1, "sql options")) {
                         int valid_options=0;                          int valid_options=0;
                         if(Value* vbind=options->get(sql_bind_name)) {                          if(Value* vbind=options->get(sql_bind_name)) {
                                 valid_options++;                                  valid_options++;
Line 603  static void _replace(Request& r, MethodP Line 603  static void _replace(Request& r, MethodP
   
         if(params.count()==1) {          if(params.count()==1) {
                 // ^string.replace[table]                  // ^string.replace[table]
                 Table* table=params.as_no_junction(0, PARAM_MUST_NOT_BE_CODE).get_table();                  Table* table=params.as_table(0, "param");
                 if(!table)  
                         throw Exception(PARSER_RUNTIME,  
                                 0,  
                                 "parameter must be table");  
                 Dictionary dict(*table);                  Dictionary dict(*table);
                 r.write_assign_lang(src.replace(dict));                  r.write_assign_lang(src.replace(dict));
         } else {          } else {
Line 628  static void _save(Request& r, MethodPara Line 624  static void _save(Request& r, MethodPara
         size_t file_name_index=0;          size_t file_name_index=0;
         if(params.count()>1)          if(params.count()>1)
                 if(HashStringValue* options=params.as_no_junction(1, "second parameter should be string or hash").get_hash()){                  if(HashStringValue* options=params.as_no_junction(1, "second parameter should be string or hash").get_hash()){
                           // ^file.save[filespec;$.charset[] $.append(true)]
                         int valid_options=0;                          int valid_options=0;
                         if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){                          if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){
                                 asked_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER));                                  asked_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER));
Line 640  static void _save(Request& r, MethodPara Line 637  static void _save(Request& r, MethodPara
                         if(valid_options != options->count())                          if(valid_options != options->count())
                                 throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION);                                  throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION);
                 } else {                  } else {
                           // ^file.save[append;filespec]
                         const String& mode=params.as_string(0, "mode must be string");                          const String& mode=params.as_string(0, "mode must be string");
                         if(mode==MODE_APPEND){                          if(mode==MODE_APPEND){
                                 do_append=true;                                  do_append=true;

Removed from v.1.204  
changed lines
  Added in v.1.205


E-mail: