Changeset 290
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Trac.cc
r289 r290 53 53 const std::string::const_iterator& last) 54 54 { 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 { 55 66 if (first==last) 56 67 return false; … … 66 77 return false; 67 78 } 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()); 68 100 69 101 const Configuration& conf = Configuration::instance(); -
trunk/lib/Trac.h
r288 r290 65 65 const std::string::const_iterator& last); 66 66 67 bool ticket(std::string::const_iterator& first, 68 const std::string::const_iterator& last); 69 67 70 /// if range (first, last) starts with /#[:digit:]*/ a ticket link 68 71 /// is written; 69 72 /// @return if ticket is found iterator pointing to after found 70 73 /// ticket; else first is returned. 71 bool ticket(std::string::const_iterator& first, 72 const std::string::const_iterator& last); 74 bool ticket1(std::string::const_iterator& first, 75 const std::string::const_iterator& last); 76 77 bool ticket2(std::string::const_iterator& first, 78 const std::string::const_iterator& last); 79 73 80 74 81 -
trunk/lib/utility.cc
r289 r290 111 111 112 112 113 std::string match(std::string::const_iterator& first, 114 const std::string::const_iterator& last, 115 const char* c) 116 { 117 std::string str(c); 118 if (match_begin(first, last, str)) { 119 first += str.size(); 120 return str; 121 } 122 return std::string(); 123 } 124 125 113 126 bool node_exist(const std::string& path) 114 127 { -
trunk/lib/utility.h
r289 r290 133 133 inline std::string trim(std::string str) { return htrim(ltrim(str)); } 134 134 135 136 std::string match(std::string::const_iterator& first, 137 const std::string::const_iterator& last, 138 const char*); 135 139 136 140 template <class T>
Note: See TracChangeset
for help on using the changeset viewer.