Changeset 290 for trunk/lib/Trac.cc


Ignore:
Timestamp:
May 8, 2007, 3:34:58 PM (15 years ago)
Author:
Peter Johansson
Message:

added suppport for links of type ticket:180 refs #180

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Trac.cc

    r289 r290  
    5353                    const std::string::const_iterator& last)
    5454  {
     55    if (ticket1(first, last))
     56      return true;
     57    if (ticket2(first, last))
     58      return true;
     59    return false;
     60  }
     61
     62
     63  bool Trac::ticket1(std::string::const_iterator& first,
     64                     const std::string::const_iterator& last)
     65  {
    5566    if (first==last)
    5667      return false;
     
    6677      return false;
    6778    }
     79
     80    const Configuration& conf = Configuration::instance();
     81    hs_.stream() << anchor(conf.trac_root()+"ticket/"+ticket,"#"+ticket);
     82    return true;
     83  }
     84
     85
     86  bool Trac::ticket2(std::string::const_iterator& first,
     87                     const std::string::const_iterator& last)
     88  {
     89    if (first==last)
     90      return false;
     91
     92    const std::string::const_iterator first_orig(first);
     93
     94    if (match(first, last, "ticket:").empty()){
     95      first = first_orig;
     96      return false;
     97    }
     98     
     99    std::string ticket = match(first, last, Digit());
    68100
    69101    const Configuration& conf = Configuration::instance();
Note: See TracChangeset for help on using the changeset viewer.