crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Struct::ServerCommandResponse Struct Reference

Response from the command-and-control server. More...

#include <ServerCommandResponse.hpp>

Properties

bool fail {false}
 Indicates whether the server command failed. More...
 
bool confirm {false}
 Indicates whether the server command needs to be confirmed. More...
 
std::string text
 The text of the response by the server. More...
 
std::uint64_t id {}
 Optional ID returned by the server. More...
 

Construction

 ServerCommandResponse ()=default
 Default constructor. More...
 
 ServerCommandResponse (const std::string &response)
 Constructor initializing a successful response with text. More...
 
 ServerCommandResponse (const std::string &response, std::uint64_t newId)
 Constructor initializing a successful response with text and ID. More...
 
 ServerCommandResponse (bool failed, bool toBeConfirmed, const std::string &response)
 Constructor initializing a possibly failed or possibly to be confirmed response with text. More...
 

Helpers

static ServerCommandResponse failed (const std::string &response)
 Helper to initialize a "failed" response with text. More...
 
static ServerCommandResponse toBeConfirmed (const std::string &response)
 Helper to initialize a "to be confirmed" response with text. More...
 

Detailed Description

Response from the command-and-control server.

Constructor & Destructor Documentation

◆ ServerCommandResponse() [1/4]

crawlservpp::Struct::ServerCommandResponse::ServerCommandResponse ( )
default

Default constructor.

Referenced by failed(), and toBeConfirmed().

◆ ServerCommandResponse() [2/4]

crawlservpp::Struct::ServerCommandResponse::ServerCommandResponse ( const std::string &  response)
inlineexplicit

Constructor initializing a successful response with text.

Parameters
responseConstant reference to a string containing the text of the server response.

◆ ServerCommandResponse() [3/4]

crawlservpp::Struct::ServerCommandResponse::ServerCommandResponse ( const std::string &  response,
std::uint64_t  newId 
)
inline

Constructor initializing a successful response with text and ID.

Parameters
responseConstant reference to a string containing the text of the response by the server.
newIdThe ID to be sent alongside the response by the server.

◆ ServerCommandResponse() [4/4]

crawlservpp::Struct::ServerCommandResponse::ServerCommandResponse ( bool  failed,
bool  toBeConfirmed,
const std::string &  response 
)
inline

Constructor initializing a possibly failed or possibly to be confirmed response with text.

Parameters
failedSet whether the server command failed.
toBeConfirmedSet whether the server command needs to be confirmed.
responseConstant reference to a string containing the text of the response by the server.

Member Function Documentation

◆ failed()

static ServerCommandResponse crawlservpp::Struct::ServerCommandResponse::failed ( const std::string &  response)
inlinestatic

Helper to initialize a "failed" response with text.

Parameters
responseConstant reference to a string containing the text of the response by the server.

References ServerCommandResponse().

Referenced by crawlservpp::Main::Server::tick().

◆ toBeConfirmed()

static ServerCommandResponse crawlservpp::Struct::ServerCommandResponse::toBeConfirmed ( const std::string &  response)
inlinestatic

Helper to initialize a "to be confirmed" response with text.

Parameters
responseConstant reference to a string containing the text of the response by the server.

References ServerCommandResponse().

Referenced by crawlservpp::Main::Server::tick().

Member Data Documentation

◆ confirm

bool crawlservpp::Struct::ServerCommandResponse::confirm {false}

Indicates whether the server command needs to be confirmed.

Referenced by crawlservpp::Main::Server::tick().

◆ fail

bool crawlservpp::Struct::ServerCommandResponse::fail {false}

Indicates whether the server command failed.

Referenced by crawlservpp::Main::Server::tick().

◆ id

std::uint64_t crawlservpp::Struct::ServerCommandResponse::id {}

Optional ID returned by the server.

Referenced by crawlservpp::Main::Server::tick().

◆ text

std::string crawlservpp::Struct::ServerCommandResponse::text

The text of the response by the server.

Referenced by crawlservpp::Main::Server::tick().


The documentation for this struct was generated from the following file: