Re: [Cppcms-users] url dispatching
Brought to you by:
artyom-beilis
|
From: Vinicius P. <ds...@ha...> - 2016-06-27 10:39:47
|
It's regular expressions.
When you say "/number/(\\d+)" you mean to check for strings starting
with /number/ and capture all numbers following it "(\\d+)", the 1 after
is to pass this parameter.
When you say ".*" it means every strings, as "." match every char and *
means any number of it, the 0 means it will not pass arguments as it
don't capture nothing.
If you are still lost, look for a tutorial on regexp or regular
expression on the net.
The pointer is the &hello::number part, a pointer to a function, and you
must pass this as it's a function of a class.
Hope this helps,
Vinicius
On 26-06-2016 06:57, mawan sugiyanto wrote:
> Dear All
>
> what is different between :
> some time we meet example :
>
> dispatcher().assign("/number/(\\d+)",&hello::number,this,1);
>
> and
>
> dispatcher().assign(".*",&dashboard::prepare,this,0);
>
> is 0 or 1 is pointer only or we have too fill with parameters start
> from 1?
>
> thankyou
>
>
> mawan
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> https://u3143608.ct.sendgrid.net/wf/click?upn=XKgXTBnynYc51QNK-2FVhLWGHEVgnlGmLptX1YaZ-2FDzWM-3D_QqpctyXzj3McV7nyWd3l9m7lCO1pRhWOf-2FT5RqYYs597RjT9wvGhEJXv4m7jZD-2BEYUwavzgRUkWhGzCT6bHX2avlwELJiO4J-2F8Wce4FtF4yjkGc8v1dpODy45dtaeV7e4UO5au2zqxvxtkil9WiSEv86Sx7EFbv-2F3T6TfxhzCIhGPYlnooyzu4hDLBdCVq6JtLCTbI7AeuTySNxqsicrwHrL-2FDvF3ClGwFgqYHKT9C8-3D
>
>
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://u3143608.ct.sendgrid.net/wf/click?upn=-2F8o2SEPnO8o0gkz01Z4rS-2BVz-2BkzajgLQzAoqRKlFQZMZV23PrrGQX1Y-2FnO6KyV7Cg6qnA3jfnwVVC-2BvfFaL4kRlo5qTOuSuNLjAJ4aI-2BCTA-3D_QqpctyXzj3McV7nyWd3l9m7lCO1pRhWOf-2FT5RqYYs597RjT9wvGhEJXv4m7jZD-2BEYUwavzgRUkWhGzCT6bHX2bzxuxXLfwDyW4vs-2FZtMNalxPj9Q2ODwEvr6HIQIkcay24pZ9U8MSCL-2FlTIm4WzViS0jPOvqjscqCV5fku4z1imy6c2WQt6bDElcn5HDBFiZc-2BFheNOAQ4r-2FG2-2FxQlLa1G6Np3GvWtqqRP08ifal6M0-3D
|