Function URI::Template::MatchExpression

Function Documentation

std::optional<Match> URI::Template::MatchExpression(const Expression &expression, const std::string &where, std::size_t start, std::size_t end, char terminator, std::unordered_map<std::string, VarValue> *values = nullptr)

Lookup for template expression.

Returns result of searching for a expansion of an expression in where. Expression considered matched if its’ expansion does not contradict definition

Parameters
  • [in] expressionTemplate expression to lookup for.

  • [in] where – A string where to lookup for a match.

  • [in] start – Position to start lookup at.

  • [in] end – Position to end lookup at.

  • [in] terminator – If this character met matching stops.

  • [out] values – Map of template variables values found in the string. Not expanded variables will be filled with VarType::UNDEFINED.

Returns

Match instance wrapped in std::optional or std::nullopt.