phaser-server  0.0.3
Public Member Functions | Protected Member Functions | List of all members
TextResponse Class Reference

Response with an optional text message. More...

#include <response.h>

Inheritance diagram for TextResponse:
Inheritance graph
[legend]
Collaboration diagram for TextResponse:
Collaboration graph
[legend]

Public Member Functions

 TextResponse (Response_t, const char *=0, const char *=0)
 Construct an instance. More...
 
- Public Member Functions inherited from JsonResponse
 JsonResponse (Response_t type)
 Construct with the outcome enumeration.
 
std::string operator() (void)
 Get the JSON encoded response string.
 

Protected Member Functions

virtual void Create (JSONObject &) override
 Add the optional text message if one was provided. More...
 

Additional Inherited Members

- Public Types inherited from JsonResponse
enum class  Response_t { R_ok , R_warning , R_error }
 Status of processed request.
 

Detailed Description

Response with an optional text message.

Note
If constructed with the optional message and message label, they must stay in scope for the lifetime of the object.

Constructor & Destructor Documentation

◆ TextResponse()

TextResponse::TextResponse ( Response_t  type,
const char *  text = 0,
const char *  label = 0 
)

Construct an instance.

Note
The optional text and label must be provided as a pair.
The text and label must stay in scope for the life of the object.
Parameters
type- Outcome enumeration.
text- Optional text message (can be null).
label- Label to use with the message (can be null).

Member Function Documentation

◆ Create()

void TextResponse::Create ( JSONObject &  root)
overrideprotectedvirtual

Add the optional text message if one was provided.

Parameters
root- Collection of JSON objects to update.

Implements JsonResponse.


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