[Cppcms-users] RES: URL maps
Brought to you by:
artyom-beilis
|
From: Renato F. <re....@ay...> - 2011-03-25 14:30:35
|
Hi Thanks again,
Well, my cppcms::application have 2 attachs:
void attach(application *app);
void attach(application *app,std::string regex,int part);
then Id try:
class App : public cppcms::application
{
public:
App(cppcms::service &s)
: cppcms::application(s)
{
attach( new Test( s ),
"test",
"/test{1}",
"/test((/.*)?)", 1 );
attach( new Portal( s ),
"portal",
"/portal{1}",
"/portal((/.*)?)", 1 );
}
};
But I receive this error of compiler:
1>e:\project.vgsws\main.cpp(362) : error C2661:
'cppcms::application::attach' : no overloaded function takes 5 arguments
1>e:\project.vgsws\main.cpp(367) : error C2661:
'cppcms::application::attach' : no overloaded function takes 5 arguments
I am using: cppcms-0.99.6
I am confusing in how use a class to represent an Page/URL.
Thanks for help.
De: Pavel Kropitz [mailto:un...@fu...]
Enviada em: sexta-feira, 25 de março de 2011 10:51
Para: cpp...@li...
Assunto: Re: [Cppcms-users] URL maps
hi,
before Artyom gives you more sopisticated answer, look at attach() method
(enables generating url - look at blog example).
/// Register an application \a app as child and mount it into:
///
/// - url_dispatcher calling dispatcher().mount(regex,*app,part);
/// - url_mapper calling mapper().mount(name,url,*app);
///
/// Ownership of app is transfered to parent.
///
void attach(application *app,std::string const &name,std::string const
&url,std::string const ®ex,int part);
example from my application>
attach( new apps::photo( s ),
"photo",
"/photo{1}",
"/photo((/.*)?)", 1 );
attach( new apps::user::app_user( s ),
"user",
"/user{1}",
"/user((/.*)?)", 1 );
pavel.
On Friday 25 March 2011, Renato Forti wrote:
> Hi,
> I am try understand how group and map url.
> For sample I have 2 classes:
> {
>
> add(_test, "/test", 1);
>
> add(_home, "/home", 2);
>
> }
> };
|