|
bool | test_patterns (std::map< std::string, std::string > &vars, std::string &txt, bool anchor, std::list< boost::regex > &skip_list) |
|
Definition at line 52 of file filter_http_rewrite.cpp.
◆ test_patterns()
bool mp::filter::HttpRewrite::Rule::test_patterns |
( |
std::map< std::string, std::string > & |
vars, |
|
|
std::string & |
txt, |
|
|
bool |
anchor, |
|
|
std::list< boost::regex > & |
skip_list |
|
) |
| |
Definition at line 563 of file filter_http_rewrite.cpp.
568 bool replaces =
false;
571 std::string::const_iterator start, end;
578 bool match_one =
false;
583 if (it->start_anchor && !first)
586 if (regex_search(start, end, what, it->re))
588 if (!match_one || what[0].first < bwhat[0].first)
602 for (i = 1; i < bwhat.size(); ++i)
605 std::map<int, std::string>::const_iterator git
606 = bit->group_index.find(i);
607 if (git != bit->group_index.end())
609 vars[git->second] = bwhat[i];
614 bool skipthis =
false;
615 std::list<boost::regex>::iterator si = skip_list.begin();
616 for ( ; si != skip_list.end(); si++) {
617 if ( boost::regex_search(bwhat.str(0), *si) )
624 std::string rvalue = bit->sub_vars(vars);
625 out.append(start, bwhat[0].first);
628 yaz_log(YLOG_LOG,
"! Not rewriting '%s', skiplist match",
629 bwhat.str(0).c_str() );
630 out.append(bwhat.str(0).c_str());
634 yaz_log(YLOG_LOG,
"! Rewritten '%s' to '%s'",
635 bwhat.str(0).c_str(), rvalue.c_str());
638 start = bwhat[0].second;
640 out.append(start, end);
◆ replace_list
std::list<Replace> metaproxy_1::filter::HttpRewrite::Rule::replace_list |
The documentation for this class was generated from the following file: