WebFramework v3.0.12
Web framework for C++.
Loading...
Searching...
No Matches
WebFramework.h
1#pragma once
2
3#include "Import/WebFrameworkCore.h"
4
5#include "WebNetwork/WebServers/BaseWebServer.h"
6
7#include "Config.h"
8
9namespace framework
10{
15 class WEB_FRAMEWORK_API WebFramework
16 {
17 public:
20 static std::string_view getWebFrameworkVersion();
21
26 static bool getUseHTTPS();
27
28 private:
29 utility::Config config;
30 std::unique_ptr<web::BaseTCPServer> server;
31
32 private:
33 uint64_t parseLoggingFlags(const json::utility::jsonObject& loggingSettings) const;
34
35 private:
36 std::string initLogging() const;
37
38 void initHTTPS(const json::utility::jsonObject& webFrameworkSettings) const;
39
40 void initServer
41 (
42 const json::utility::jsonObject& webFrameworkSettings,
43 const std::vector<utility::JSONSettingsParser>& jsonSettings,
44 const std::vector<std::string>& pathToSources
45 );
46
47 void init();
48
49 public:
50 WebFramework(const utility::Config& webFrameworkConfig);
51
52 WebFramework(const std::filesystem::path& webFrameworkConfigPath);
53
59 void start(bool wait = false, const std::function<void()>& onStartServer = []() {});
60
65 void stop(bool wait = true);
66
71 void kick(const std::string& ip) const;
72
77 std::vector<std::string> getClientsIp() const;
78
83 bool isServerRunning() const;
84
87 const json::JSONParser& getCurrentConfiguration() const;
88
89 ~WebFramework() = default;
90 };
91}
Main class of framework.
Config file representation.
Definition Config.h:15