LCOV - code coverage report
Current view: top level - utilites/matchmaker/matcher - prefix_match.cpp (source / functions) Hit Total Coverage
Test: wfc_jsonrpc-coverage.info Lines: 10 13 76.9 %
Date: 2019-09-12 Functions: 2 2 100.0 %

          Line data    Source code
       1             : 
       2             : #include "prefix_match.hpp"
       3             : 
       4             : namespace wfc{ namespace jsonrpc{ 
       5             : 
       6          10 : bool prefix_match::configure(const char* beg, const char* end, json::json_error& err) 
       7             : {
       8          10 :   json::string<>::serializer()(_val, beg, end, &err);
       9          10 :   return !err;
      10             : }
      11             : 
      12          11 : bool prefix_match::match(const char* beg, const char* end, json::json_error& err)
      13             : {
      14          11 :   if (!json::parser::is_string(beg,end))
      15           0 :     return false;
      16          11 :   if ( static_cast<std::ptrdiff_t>(_val.size()) > (std::distance(beg, end) + 2) )
      17           0 :     return false;
      18          11 :   std::string value;
      19          11 :   json::string<>::serializer()(value, beg, end, &err);
      20          11 :   if ( err )
      21           0 :     return false;
      22          11 :   return value.compare( 0, _val.size(), _val ) == 0;
      23             : }
      24             : 
      25             : }}

Generated by: LCOV version 1.10