Changeset 7421


Ignore:
Timestamp:
2004-05-25T12:16:24+12:00 (20 years ago)
Author:
mdewsnip
Message:

(Human Info) Use ++here instead of here++ for iterators, use g_EmptyText instead of "" for text_ts, and delete char* variables using delete []variable instead of delete variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r7420 r7421  
    113113  ainfo.multiplechar = true;
    114114  ainfo.defaultstatus = cgiarginfo::good;
    115   ainfo.argdefault = "";
     115  ainfo.argdefault = g_EmptyText;
    116116  ainfo.savedarginfo = cgiarginfo::mustnot;
    117117  argsinfo.addarginfo (NULL, ainfo);
     
    121121  ainfo.multiplechar = true;
    122122  ainfo.defaultstatus = cgiarginfo::none;
    123   ainfo.argdefault = "";
     123  ainfo.argdefault = g_EmptyText;
    124124  ainfo.savedarginfo = cgiarginfo::must;
    125125  argsinfo.addarginfo (NULL, ainfo);
     
    130130  ainfo.multiplechar = true;
    131131  ainfo.defaultstatus = cgiarginfo::none;
    132   ainfo.argdefault = "";
     132  ainfo.argdefault = g_EmptyText;
    133133  ainfo.savedarginfo = cgiarginfo::must;
    134134  argsinfo.addarginfo (NULL, ainfo);
     
    138138  ainfo.multiplechar = true;
    139139  ainfo.defaultstatus = cgiarginfo::none;
    140   ainfo.argdefault = "";
     140  ainfo.argdefault = g_EmptyText;
    141141  ainfo.savedarginfo = cgiarginfo::mustnot;
    142142  argsinfo.addarginfo (NULL, ainfo);
     
    146146  ainfo.multiplechar = true;
    147147  ainfo.defaultstatus = cgiarginfo::none;
    148   ainfo.argdefault = "";
     148  ainfo.argdefault = g_EmptyText;
    149149  ainfo.savedarginfo = cgiarginfo::must;
    150150  argsinfo.addarginfo (NULL, ainfo);
     
    173173  ainfo.multiplechar = true;
    174174  ainfo.defaultstatus = cgiarginfo::none;
    175   ainfo.argdefault = "";
     175  ainfo.argdefault = g_EmptyText;
    176176  ainfo.savedarginfo = cgiarginfo::mustnot;
    177177  argsinfo.addarginfo (NULL, ainfo);
     
    380380      (*actionhere).second.a->configure(key, cfgline);
    381381
    382     actionhere++;
     382    ++actionhere;
    383383  }
    384384
     
    496496    if (((*actionhere).second.a == NULL) ||
    497497    !(*actionhere).second.a->init(logout)) return false;
    498     actionhere++;
     498    ++actionhere;
    499499  }
    500500
     
    611611    return false;
    612612    }
    613     actionhere++;
     613    ++actionhere;
    614614  }
    615615
     
    723723  if (fd == -1) {
    724724    logout << "Error: Couldn't open file " << lfile << "\n";
    725     delete lfile;
     725    delete []lfile;
    726726    return false;
    727727  }
     
    740740    write(fd, buffer, num_chars);
    741741    GSDL_UNLOCK_FILE (fd);
    742     delete buffer;
     742    delete []buffer;
    743743  } else {
    744744    logout << "Error: Couldn't lock file " << lfile << "\n";
    745745    close(fd);
    746     delete lfile;
     746    delete []lfile;
    747747    return false;
    748748  }
     
    750750  close(fd);
    751751       
    752   delete lfile;
     752  delete []lfile;
    753753  return true;
    754754}
     
    761761  action *a = actions.getaction (args["a"]);
    762762  prepare_page (a, args, text_t2ascii, logout);
    763   disp.expandstring ("Global", astring, outstring);
     763  disp.expandstring (displayclass::defaultpackage, astring, outstring);
    764764  return outstring;
    765765}
     
    832832    if (latest<file_info.st_mtime) latest=file_info.st_mtime;
    833833      }
    834       delete buildcfg_ptr;
    835       delete collectcfg_ptr;
     834      delete []buildcfg_ptr;
     835      delete []collectcfg_ptr;
    836836
    837837      if (latest>0) {
     
    10511051    return compressed_args;
    10521052
    1053   return "";
     1053  return g_EmptyText;
    10541054}
    10551055
     
    10841084      maindirs.insert (gsdlmacrodir);
    10851085    }
    1086     colhere ++;
     1086    ++colhere;
    10871087  }
    10881088
     
    11161116      foundfile = true;
    11171117    }
    1118     dirhere ++;
     1118    ++dirhere;
    11191119      }
    11201120    }
     
    11401140      return false;
    11411141    }
    1142     arrhere++;
     1142    ++arrhere;
    11431143  }
    11441144
     
    11821182      }
    11831183     
    1184       arrhere++;
     1184      ++arrhere;
    11851185    }
    11861186  }
     
    12491249             first = false;
    12501250          }
    1251           col_here ++;
     1251          ++col_here;
    12521252        }
    12531253      }
     
    13341334    }
    13351335   
    1336     params_here++;
     1336    ++params_here;
    13371337  }
    13381338 
     
    13501350      (*actionhere).second.a->define_external_macros (disp, args, &protocols, logout);
    13511351    }
    1352     actionhere++;
     1352    ++actionhere;
    13531353  }
    13541354
     
    13711371  text_t &collection = args["c"];
    13721372
    1373   disp.setmacro ("gsdlhome", "Global", dm_safe(configinfo.gsdlhome));
    1374   disp.setmacro ("gwcgi", "Global", configinfo.gwcgi);
    1375   disp.setmacro ("httpimg", "Global", configinfo.httpimg);
    1376   disp.setmacro ("httpprefix", "Global", configinfo.httpprefix);
     1373  disp.setmacro ("gsdlhome", displayclass::defaultpackage, dm_safe(configinfo.gsdlhome));
     1374  disp.setmacro ("gwcgi", displayclass::defaultpackage, configinfo.gwcgi);
     1375  disp.setmacro ("httpimg", displayclass::defaultpackage, configinfo.httpimg);
     1376  disp.setmacro ("httpprefix", displayclass::defaultpackage, configinfo.httpprefix);
    13771377
    13781378  if (!collection.empty()) {
     
    13851385      if (!cinfo.httpdomain.empty()) httpcollection = "http://";
    13861386      httpcollection += cinfo.httpdomain + cinfo.httpprefix + "/collect/" + collection;
    1387       disp.setmacro ("httpcollection", "Global", httpcollection);
     1387      disp.setmacro ("httpcollection", displayclass::defaultpackage, httpcollection);
    13881388    }
    13891389  }
    13901390
    13911391  text_t compressedoptions = get_compressed_arg(args, logout);
    1392   disp.setmacro ("compressedoptions", "Global", dm_safe(compressedoptions));
     1392  disp.setmacro ("compressedoptions", displayclass::defaultpackage, dm_safe(compressedoptions));
    13931393  // need a decoded version of compressedoptions for use within forms
    13941394  // as browsers encode values from forms before sending to server
    13951395  // (e.g. %25 becomes %2525)
    13961396  decode_cgi_arg (compressedoptions);
    1397   disp.setmacro ("decodedcompressedoptions", "Global", dm_safe(compressedoptions));
     1397  disp.setmacro ("decodedcompressedoptions", displayclass::defaultpackage, dm_safe(compressedoptions));
    13981398
    13991399#if defined (__WIN32__)
    1400   disp.setmacro ("win32", "Global", "1");
     1400  disp.setmacro ("win32", displayclass::defaultpackage, "1");
    14011401#endif
    14021402
     
    14151415      // need to escape special characters from query string
    14161416      disp.setmacro ("cgiarg" + (*argshere).first,
    1417              "Global", html_safe((*argshere).second.value));
     1417             displayclass::defaultpackage, html_safe((*argshere).second.value));
    14181418    else if ((*argshere).first == "hp") {
    1419       disp.setmacro ("cgiarg" + (*argshere).first, "Global", (*argshere).second.value);
     1419      disp.setmacro ("cgiarg" + (*argshere).first, displayclass::defaultpackage, (*argshere).second.value);
    14201420    } else {
    1421       disp.setmacro ("cgiarg" + (*argshere).first, "Global", dm_safe((*argshere).second.value));
    1422     }
    1423     argshere ++;
     1421      disp.setmacro ("cgiarg" + (*argshere).first, displayclass::defaultpackage, dm_safe((*argshere).second.value));
     1422    }
     1423    ++argshere;
    14241424  }
    14251425
    14261426  // display text right to left if language is arabic/farsi (and if browser can support it)
    14271427  if (args["l"] == "ar" || args["l"] == "fa")
    1428     disp.setmacro ("htmlextra", "Global", " dir=rtl");
     1428    disp.setmacro ("htmlextra", displayclass::defaultpackage, " dir=rtl");
    14291429
    14301430  // set collection specific macros
     
    14441444          ((*here).first != "hasprevious")) {
    14451445        // check for args in form name:lang
    1446         text_t name = "";
    1447         text_t lang = "";
     1446        text_t name = g_EmptyText;
     1447        text_t lang = g_EmptyText;
    14481448        bool colonfound=false;
    14491449        text_t::const_iterator a = (*here).first.begin();
     
    14581458        else name.push_back(*a);
    14591459          }
    1460           a++;
     1460          ++a;
    14611461        }
    14621462        if (!lang.empty()) {
    14631463          if (args["l"]==lang) {
    1464         disp.setmacro (name, "Global", (*here).second.values[0]);
     1464        disp.setmacro (name, displayclass::defaultpackage, (*here).second.values[0]);
    14651465          }
    14661466        }
    14671467        else { // the default one
    1468           disp.setmacro ((*here).first, "Global", (*here).second.values[0]);
     1468          disp.setmacro ((*here).first, displayclass::defaultpackage, (*here).second.values[0]);
    14691469        }
    14701470      }
    1471       here ++;
     1471      ++here;
    14721472    }
    14731473      }
    14741474
    14751475      text_t iconcollection;
    1476       disp.expandstring ("Global", "_iconcollection_", iconcollection);
     1476      disp.expandstring (displayclass::defaultpackage, "_iconcollection_", iconcollection);
    14771477      if (!iconcollection.empty())
    14781478    {
     
    14841484          // local but with full path
    14851485          iconcollection = "http://" + cinfo.httpdomain + iconcollection;
    1486           disp.setmacro("iconcollection", "Global", iconcollection);
     1486          disp.setmacro("iconcollection", displayclass::defaultpackage, iconcollection);
    14871487        }
    14881488    }
Note: See TracChangeset for help on using the changeset viewer.