WebFramework v3.0.12
Web framework for C++.
Loading...
Searching...
No Matches
WebFrameworkConstants.h
1#pragma once
2
3#include <string>
4#include <chrono>
5#include <memory>
6#include <cstdint>
7
12inline constexpr uint64_t sessionLifeTime = 10 * 60 * 1'000'000'000ULL;
16inline constexpr std::chrono::duration<uint32_t> sessionCheckPeriod(60);
17
18inline const std::string webFrameworkDefaultAssests = "WebFrameworkAssets";
19
20inline constexpr std::string_view webFrameworkDynamicPagesExtension = ".wfdp";
21
22inline constexpr size_t defaultChunkSize = 14 * 1024 * 1024;
23
24namespace json_settings
25{
26 inline constexpr std::string_view webServerObject = "WebServer";
27 inline constexpr std::string_view webFrameworkObject = "WebFramework";
28 inline constexpr std::string_view httpsObject = "HTTPS";
29 inline constexpr std::string_view loggingObject = "Logging";
30 inline constexpr std::string_view threadPoolServerObject = "ThreadPoolServer";
31 inline constexpr std::string_view loadBalancerObject = "LoadBalancer";
32 inline constexpr std::string_view proxyObject = "Proxy";
33
34 inline constexpr std::string_view settingsPathsKey = "settingsPaths";
35 inline constexpr std::string_view ipKey = "ip";
36 inline constexpr std::string_view portKey = "port";
37 inline constexpr std::string_view timeoutKey = "timeout";
38 inline constexpr std::string_view loadSourcesKey = "loadSources";
39 inline constexpr std::string_view assetsPathKey = "assetsPath";
40 inline constexpr std::string_view templatesPathKey = "templatesPath";
41 inline constexpr std::string_view cachingSize = "cachingSize";
42 inline constexpr std::string_view dateFormatKey = "dateFormat";
43 inline constexpr std::string_view logFileSizeKey = "logFileSize";
44 inline constexpr std::string_view logFlagsKey = "flags";
45 inline constexpr std::string_view webServerTypeKey = "webServerType";
46 inline constexpr std::string_view useHTTPSKey = "useHTTPS";
47 inline constexpr std::string_view pathToCertificateKey = "pathToCertificate";
48 inline constexpr std::string_view pathToKey = "pathToKey";
49 inline constexpr std::string_view webFrameworkDefaultAssetsPath = "defaultAssetsPath";
50
51 inline constexpr std::string_view listOfServersKey = "listOfServers";
52 inline constexpr std::string_view heuristicKey = "heuristic";
53 inline constexpr std::string_view loadSourceKey = "loadSource";
54 inline constexpr std::string_view serversHTTPSKey = "serversHTTPS";
55
56 inline constexpr std::string_view usingLoggingKey = "usingLogging";
57 inline constexpr std::string_view logsPathKey = "logsPath";
58 inline constexpr std::string_view duplicateOutputKey = "duplicateOutput";
59 inline constexpr std::string_view duplicateErrorOutputKey = "duplicateErrorOutput";
60
61 inline constexpr std::string_view defaultLoadSourceValue = "current";
62
63 inline constexpr std::string_view threadCountKey = "threadCount";
64
65 inline constexpr std::string_view multiThreadedWebServerTypeValue = "multiThreaded";
66 inline constexpr std::string_view threadPoolWebServerTypeValue = "threadPool";
67 inline constexpr std::string_view loadBalancerWebServerTypeValue = "loadBalancer";
68 inline constexpr std::string_view proxyWebServerTypeValue = "proxy";
69}
70
71namespace exceptions
72{
73 inline constexpr std::string_view notImplemented = "Not implemented";
74 inline constexpr std::string_view fileDoesNotExist = "file does not exist";
75 inline constexpr std::string_view cantFindFunction = "Can't find ";
76 inline constexpr std::string_view useMacroToMakeCreationFunction = "Make sure that you add DECLARE_EXECUTOR macro for executor class";
77 inline constexpr std::string_view missingLoadType = "Missing load type of ";
78 inline constexpr std::string_view cantLoadSource = "Can't load ";
79 inline constexpr std::string_view missingOtherDLLs = "That load source requires to load other dlls";
80
81 inline const std::string wrongWebServerType = "Wrong type of webServerType option";
82
83 inline constexpr std::string_view variableDeclarationSyntaxError = "Wrong variable declaration";
84 inline constexpr std::string_view sectionDeclarationSyntaxError = "Wrong section declaration";
85 inline constexpr std::string_view missingSemicolonSyntaxError = "Missing semicolon";
86
87 inline constexpr std::string_view stringConversionErrorCode = "String conversion error code ";
88
89 inline constexpr std::string_view notFound = "Not found";
90 inline constexpr std::string_view badRequest = "Bad request from client";
91}
92
93namespace json_settings_values
94{
95 inline constexpr std::string_view initializationLoadTypeValue = "initialization";
96 inline constexpr std::string_view dynamicLoadTypeValue = "dynamic";
97}
98
99namespace web_framework_assets
100{
101 inline constexpr std::string_view errorsFolder = "Errors";
102
103 inline constexpr std::string_view badRequest = "400.html";
104 inline constexpr std::string_view notFound = "404.html";
105 inline constexpr std::string_view internalServerError = "500.html";
106}
107
108#ifdef WEB_FRAMEWORK_DLL
109#ifdef __LINUX__
110#define WEB_FRAMEWORK_API __attribute__((visibility("default")))
111#else
112#define WEB_FRAMEWORK_API __declspec(dllexport)
113
114#pragma warning(disable: 4275)
115#pragma warning(disable: 4251)
116#endif
117#else
118#define WEB_FRAMEWORK_API
119#endif