RMVL  2.4.0-dev
Robotic Manipulation and Vision Library
载入中...
搜索中...
未找到
rm::Router::RoutePattern类 参考

路由模式匹配器 更多...

#include <rmvl/io/netapp.hpp>

rm::Router::RoutePattern 的协作图:

Public 成员函数

 RoutePattern (std::string_view pattern_str)
 构造路由模式
bool match (std::string_view path, std::unordered_map< std::string, std::string > &params) const
 匹配路径,并提取参数
const std::string & pattern () const noexcept
 获取原始路由模式字符串

详细描述

路由模式匹配器

构造及析构函数说明

◆ RoutePattern()

rm::Router::RoutePattern::RoutePattern ( std::string_view pattern_str)
explicit

构造路由模式

参数
[in]pattern_str路由模式字符串,如 "/api/:name"

成员函数说明

◆ match()

bool rm::Router::RoutePattern::match ( std::string_view path,
std::unordered_map< std::string, std::string > & params ) const

匹配路径,并提取参数

参数
[in]path请求路径
[out]params输出参数,提取的路径参数
返回
是否匹配成功

◆ pattern()

const std::string & rm::Router::RoutePattern::pattern ( ) const
inlinenodiscardnoexcept

获取原始路由模式字符串


该类的文档由以下文件生成: