Wt examples: hangman/hangman.C File Reference

Wt examples 4.10.4

Loading...
Searching...
No Matches
Functions
hangman.C File Reference
`#include <Wt/WApplication.h>`
`#include <Wt/WServer.h>`
`#include "HangmanGame.h"`
`#include "Session.h"`

Go to the source code of this file.

## Functions
std::unique_ptr< WApplication > | createApplication (const WEnvironment &env)
int | main (int argc, char **argv)

## Function Documentation

## ◆ createApplication()

std::unique_ptr< WApplication > createApplication | ( | const WEnvironment & | env | ) |

Definition at line 15 of file hangman.C.

16{
17 auto app = std::make_unique<WApplication>(env);
18
19 app->setTitle("Hangman");
20
21 app->messageResourceBundle().use(app->appRoot() + "strings");
22 app->messageResourceBundle().use(app->appRoot() + "templates");
23
24 app->useStyleSheet("css/hangman.css");
25
26 app->root()->addNew<HangmanGame>();
27
28 return app;
29}
HangmanGame
Definition HangmanGame.h:25

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv )

Definition at line 32 of file hangman.C.

33{
34 try {
35 WServer server(argc, argv, WTHTTP_CONFIGURATION);
36
37 server.addEntryPoint(EntryPointType::Application, createApplication);
38
39 Session::configureAuth();
40
41 server.run();
42 } catch (WServer::Exception& e) {
43 std::cerr << e.what() << std::endl;
44 } catch (std::exception &e) {
45 std::cerr << "exception: " << e.what() << std::endl;
46 }
47}
Session::configureAuth
static void configureAuth()
Definition Session.C:65
createApplication
std::unique_ptr< WApplication > createApplication(const WEnvironment &env)
Definition hangman.C:15