Example #1
0
 match_result operator ()(U &&value) const {
   int status = get_status(std::forward<U>(value), terminate);
   if(WIFEXITED(status)) {
     std::ostringstream ss;
     ss << "exited with status " << WEXITSTATUS(status);
     return { matcher_(WEXITSTATUS(status)), ss.str() };
   }
   return { false, "didn't exit" };
 }
Example #2
0
 match_result operator ()(U &&value) const {
   int status = get_status(std::forward<U>(value), terminate);
   if(WIFSIGNALED(status)) {
     std::ostringstream ss;
     ss << "killed with signal " << WTERMSIG(status);
     return { matcher_(WTERMSIG(status)), ss.str() };
   }
   return { false, "wasn't killed" };
 }
Example #3
0
	bool parse(scanner_t& scanner, skip_t&) const
	{
		regex_match_t matcher_(matcher);

		if (matcher_.match(scanner.getRemainString()))
		{
			std::pair<size_t, size_t> position = matcher_.getCapture(0);
			if (position.first != 0)
				return false;

			scanner.skip(position.second);
			return true;
		}

		return false;
	}
Example #4
0
    match_result operator ()(const U &value) const {
      std::ostringstream ss;
      ostream_list_append append(ss);
      bool good = initial_;

      ss << "[";
      for(auto &&i : value) {
        auto result = matcher_(i);
        if(result != initial_)
          good = result;
        append(matcher_message(result, i));
      }
      ss << "]";

      return {good, ss.str()};
    }
Example #5
0
bool GeneralEventMatcher::operator()(Event* e) { return matcher_(e); }