LCOV - code coverage report
Current view: top level - utilites/matchmaker/matcher - regex_match.cpp (source / functions) Hit Total Coverage
Test: wfc_jsonrpc-coverage.info Lines: 14 16 87.5 %
Date: 2019-09-12 Functions: 4 4 100.0 %

          Line data    Source code
       1             : 
       2             : #include "regex_match.hpp"
       3             : 
       4             : namespace wfc{ namespace jsonrpc{ 
       5             : 
       6          81 : bool regex_match::configure(const char* beg, const char* end, json::json_error& err) 
       7             : try
       8             : {
       9          81 :   json::string<>::serializer()(_str, beg, end, &err);
      10          81 :   _reg.assign(_str); 
      11          81 :   return !err; 
      12             : } 
      13           0 : catch(...) 
      14             : { 
      15           0 :   return false;
      16             : }
      17             : 
      18          69 : bool regex_match::match(const char* beg, const char* end, json::json_error& err) 
      19             : {
      20          69 :   const char* send = json::parser::parse_value(beg, end, &err);
      21          69 :   if (err) return false;
      22          69 :   if ( json::parser::is_string(beg, end) )
      23             :   {
      24          65 :     std::string val; 
      25          65 :     json::string<>::serializer()(val, beg, end, &err);
      26          65 :     if (err) return false;
      27          65 :     return boost::regex_match(val, _reg );
      28             :   }
      29             :   else
      30             :   {
      31             :     // на сыром json
      32           4 :     return boost::regex_match(beg, send, _reg );
      33             :   }
      34             : }
      35             : 
      36           3 : }}

Generated by: LCOV version 1.10