WebFramework v3.0.12
Web framework for C++.
Loading...
Searching...
No Matches
framework::WebFramework Class Reference

Main class of framework. More...

#include <WebFramework.h>

Public Member Functions

 WebFramework (const utility::Config &webFrameworkConfig)
 
 WebFramework (const std::filesystem::path &webFrameworkConfigPath)
 
void start (bool wait=false, const std::function< void()> &onStartServer=[]() {})
 Start server.
 
void stop (bool wait=true)
 Stop server.
 
void kick (const std::string &ip) const
 Kick specific client.
 
std::vector< std::string > getClientsIp () const
 Get ip addresses of all currently connected clients.
 
bool isServerRunning () const
 Is server running.
 
const json::JSONParser & getCurrentConfiguration () const
 Getter for currentConfiguration.
 

Static Public Member Functions

static std::string_view getWebFrameworkVersion ()
 Get current WebFramework version.
 
static bool getUseHTTPS ()
 Is server use HTTPS.
 

Detailed Description

Main class of framework.

All initializations go through this class

Definition at line 15 of file WebFramework.h.

Constructor & Destructor Documentation

◆ WebFramework()

framework::WebFramework::WebFramework ( const utility::Config & webFrameworkConfig)

Definition at line 231 of file WebFramework.cpp.

Member Function Documentation

◆ getClientsIp()

vector< string > framework::WebFramework::getClientsIp ( ) const

Get ip addresses of all currently connected clients.

Returns

Definition at line 292 of file WebFramework.cpp.

◆ getCurrentConfiguration()

const json::JSONParser & framework::WebFramework::getCurrentConfiguration ( ) const

Getter for currentConfiguration.

Returns
Get current running configuration JSON

Definition at line 312 of file WebFramework.cpp.

◆ getUseHTTPS()

bool framework::WebFramework::getUseHTTPS ( )
static

Is server use HTTPS.

Returns

Definition at line 29 of file WebFramework.cpp.

◆ getWebFrameworkVersion()

string_view framework::WebFramework::getWebFrameworkVersion ( )
static

Get current WebFramework version.

Returns
Current WebFramework version

Definition at line 22 of file WebFramework.cpp.

◆ isServerRunning()

bool framework::WebFramework::isServerRunning ( ) const

Is server running.

Returns
is server running

Definition at line 307 of file WebFramework.cpp.

◆ kick()

void framework::WebFramework::kick ( const std::string & ip) const

Kick specific client.

Parameters
ipclient's address

Definition at line 287 of file WebFramework.cpp.

◆ start()

void framework::WebFramework::start ( bool wait = false,
const std::function< void()> & onStartServer = []() {} )

Start server.

Parameters
waitWait until server stop
onStartServerOn start server callback

Definition at line 277 of file WebFramework.cpp.

◆ stop()

void framework::WebFramework::stop ( bool wait = true)

Stop server.

Parameters
waitWait until server stop

Definition at line 282 of file WebFramework.cpp.


The documentation for this class was generated from the following files: