-
Notifications
You must be signed in to change notification settings - Fork 373
/
Copy pathEntryPoint.h
69 lines (54 loc) · 1.66 KB
/
EntryPoint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2018 Emweb bv, Herent, Belgium.
*
* All rights reserved.
*/
#ifndef ENTRYPOINT_H
#define ENTRYPOINT_H
#include "Wt/WApplication.h"
#include "Wt/WGlobal.h"
#include <deque>
namespace Wt {
class WT_API EntryPoint {
public:
EntryPoint(EntryPointType type, ApplicationCreator appCallback,
const std::string& path,
const std::string& favicon);
EntryPoint(WResource *resource, const std::string& path);
EntryPoint(const std::shared_ptr<WResource>& resource, const std::string& path);
~EntryPoint();
void setPath(const std::string& path);
EntryPointType type() const { return type_; }
WResource *resource() const { return resource_; }
ApplicationCreator appCallback() const { return appCallback_; }
const std::string& path() const { return path_; }
const std::string& favicon() const { return favicon_; }
private:
EntryPointType type_;
WResource *resource_;
std::shared_ptr<WResource> ownedResource_;
ApplicationCreator appCallback_;
std::string path_;
std::string favicon_;
};
typedef std::deque<EntryPoint> EntryPointList;
struct WT_API EntryPointMatch {
EntryPointMatch() noexcept
: entryPoint(nullptr),
extraStartIndex(0)
{ }
EntryPointMatch(
const EntryPoint *ep,
std::size_t extraStartIndex) noexcept
: entryPoint(ep),
extraStartIndex(extraStartIndex)
{ }
bool operator<(const EntryPointMatch& other) const noexcept;
std::size_t depth() const noexcept;
const EntryPoint *entryPoint;
std::vector<std::pair<std::string, std::string> > urlParams;
std::size_t extraStartIndex;
};
}
#endif // ENTRYPOINT_H