From bde8ae10dde5fdc2cba17d2aa35a4a29728ff43d Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 5 Jul 2012 19:15:36 +0000 Subject: [PATCH] .tutorial: Skylark01 git-svn-id: svn://ultimatepp.org/upp/trunk@5129 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- tutorial/Skylark01/Skylark01.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tutorial/Skylark01/Skylark01.cpp b/tutorial/Skylark01/Skylark01.cpp index e2a384d07..d8b577067 100644 --- a/tutorial/Skylark01/Skylark01.cpp +++ b/tutorial/Skylark01/Skylark01.cpp @@ -2,29 +2,44 @@ using namespace Upp; -SKYLARK(HomePage, "**") +SKYLARK(HomePage, "") { http << "Hello world!"; } SKYLARK(Param, "*/param") { - http << "Param entered: " << http[0] << ""; + http << "Parameter: " << http[0] << ""; +} + +SKYLARK(Params, "params/**") +{ + http << "Parameters: "; + for(int i = 0; i < http.GetParamCount(); i++) + http << http[i] << " "; + http << ""; +} + +SKYLARK(CatchAll, "**") +{ + http.Redirect(HomePage); } struct MyApp : SkylarkApp { MyApp() { root = "myapp"; + #ifdef _DEBUG prefork = 0; use_caching = false; + #endif } }; CONSOLE_APP_MAIN { -#ifdef DEBUG +#ifdef _DEBUG StdLogSetup(LOG_FILE|LOG_COUT); - skylark_log = true; + Ini::skylark_log = true; #endif MyApp().Run();