fhq-server  v0.2.33
Documentation for fhq-server. FreeHackQuest is an open source platform for competitions of computer security.
Public Member Functions | Private Attributes | List of all members
ModelRequest Class Reference

#include <cmd_handlers.h>

Collaboration diagram for ModelRequest:
Collaboration graph
[legend]

Public Member Functions

 ModelRequest (QWebSocket *pClient, IWebSocketServer *pWebSocketServer, nlohmann::json &jsonRequest_)
 
QWebSocket * client ()
 
std::string getIpAddress ()
 
IWebSocketServerserver ()
 
WsjcppUserSessiongetUserSession ()
 
bool isAdmin ()
 
bool isUser ()
 
bool isUnauthorized ()
 
const nlohmann::json & jsonRequest ()
 
bool hasInputParam (const std::string &sParamName)
 
std::string getInputString (const std::string &sParamName, const std::string &sDefaultValue)
 
int getInputInteger (const std::string &sParamName, int defaultValue)
 
std::string m ()
 
bool hasM ()
 
std::string command ()
 
bool hasCommand ()
 
void sendMessageError (const std::string &cmd, WsjcppError error)
 
void sendMessageSuccess (const std::string &cmd, nlohmann::json &jsonResponse)
 
void sendResponse (nlohmann::json &jsonResult)
 

Private Attributes

std::string TAG
 
QWebSocket * m_pClient
 
IWebSocketServerm_pServer
 
WsjcppUserSessionm_pWsjcppUserSession
 
nlohmann::json m_jsonRequest
 
std::string m_sMessageId
 
std::string m_sCommand
 

Constructor & Destructor Documentation

◆ ModelRequest()

ModelRequest::ModelRequest ( QWebSocket *  pClient,
IWebSocketServer pWebSocketServer,
nlohmann::json &  jsonRequest_ 
)

Member Function Documentation

◆ client()

QWebSocket * ModelRequest::client ( )

◆ command()

std::string ModelRequest::command ( )

◆ getInputInteger()

int ModelRequest::getInputInteger ( const std::string &  sParamName,
int  defaultValue 
)

◆ getInputString()

std::string ModelRequest::getInputString ( const std::string &  sParamName,
const std::string &  sDefaultValue 
)

◆ getIpAddress()

std::string ModelRequest::getIpAddress ( )

◆ getUserSession()

WsjcppUserSession * ModelRequest::getUserSession ( )

◆ hasCommand()

bool ModelRequest::hasCommand ( )

◆ hasInputParam()

bool ModelRequest::hasInputParam ( const std::string &  sParamName)

◆ hasM()

bool ModelRequest::hasM ( )

◆ isAdmin()

bool ModelRequest::isAdmin ( )

◆ isUnauthorized()

bool ModelRequest::isUnauthorized ( )

◆ isUser()

bool ModelRequest::isUser ( )

◆ jsonRequest()

const nlohmann::json & ModelRequest::jsonRequest ( )

◆ m()

std::string ModelRequest::m ( )

◆ sendMessageError()

void ModelRequest::sendMessageError ( const std::string &  cmd,
WsjcppError  error 
)

◆ sendMessageSuccess()

void ModelRequest::sendMessageSuccess ( const std::string &  cmd,
nlohmann::json &  jsonResponse 
)

◆ sendResponse()

void ModelRequest::sendResponse ( nlohmann::json &  jsonResult)

◆ server()

IWebSocketServer * ModelRequest::server ( )

Member Data Documentation

◆ m_jsonRequest

nlohmann::json ModelRequest::m_jsonRequest
private

◆ m_pClient

QWebSocket* ModelRequest::m_pClient
private

◆ m_pServer

IWebSocketServer* ModelRequest::m_pServer
private

◆ m_pWsjcppUserSession

WsjcppUserSession* ModelRequest::m_pWsjcppUserSession
private

◆ m_sCommand

std::string ModelRequest::m_sCommand
private

◆ m_sMessageId

std::string ModelRequest::m_sMessageId
private

◆ TAG

std::string ModelRequest::TAG
private

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