Changeset 2706


Ignore:
Timestamp:
2001-08-21T10:44:35+12:00 (23 years ago)
Author:
sjboddie
Message:

added [href] format string entity

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

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

    r2001 r2706  
    340340  if (langcode == "zu") return "Zulu";
    341341  return "";
     342}
     343
     344text_t get_href (const text_t &link) {
     345
     346  text_t href;
     347
     348  text_t::const_iterator here = findchar(link.begin(), link.end(), '"');
     349  text_t::const_iterator end = link.end();
     350 
     351  here ++;
     352  while (here != end) {
     353    if (*here == '"') break;
     354    href.push_back(*here);
     355    here ++;
     356  }
     357
     358  return href;
    342359}
    343360
     
    492509    formatlistptr->command = comEndLink;
    493510
     511  else if (meta == "href")
     512    formatlistptr->command = comHref;
     513
    494514  else if (meta == "num")
    495515    formatlistptr->command = comNum;
     
    917937              ResultDocInfo_t &docinfo, displayclass &disp,
    918938              format_t *formatlistptr,
    919               const text_t &link, const text_t &icon, 
     939              const text_t &link, const text_t &icon,
    920940              const text_t &text, bool highlight,
    921941              ostream& logout) {
     
    931951    if (link.empty()) return "";
    932952    else return "</a>";
     953  case comHref:
     954    return get_href(link);
    933955  case comIcon:
    934956    return icon;
     
    10551077                  text, logout);
    10561078}
    1057 
    1058 
    1059 
    1060 
    1061 
    1062 
    1063 
  • trunk/gsdl/src/recpt/formattools.h

    r2001 r2706  
    3434
    3535enum command_t {comIf, comOr, comMeta, comText, comLink, comEndLink, comNum, comIcon,
    36         comDoc, comHighlight, comEndHighlight, comRel};//changed
     36        comDoc, comHighlight, comEndHighlight, comRel, comHref};
    3737enum pcommand_t {pNone, pImmediate, pTop, pAll};
    3838enum dcommand_t {dMeta, dText};
     
    108108text_t iso639 (const text_t &langcode);
    109109
     110text_t get_href (const text_t &link);
     111
    110112text_t get_related_docs(const text_t& collection, recptproto* collectproto,
    111113              ResultDocInfo_t &docinfo, ostream& logout);
Note: See TracChangeset for help on using the changeset viewer.