ofxHTTP
A collection of tools for HTTP.
ofx::HTTP::SSEFrame Class Reference

A SSE frame. More...

#include <SSEFrame.h>

Public Member Functions

 SSEFrame (const std::string &data)
 Create a SSEFrame without an event name. More...
 
 SSEFrame (const std::string &event, const std::string &data)
 Create a SSEFrame with an event name. More...
 
virtual ~SSEFrame ()
 Destroy a SSEFrame.
 
std::string event () const
 
std::string data () const
 

Protected Attributes

std::string _event
 The UTF-8 encoded event name or an empty string if unset.
 
std::string _data
 The UTF-8 encoded data to be sent.
 

Detailed Description

A SSE frame.

Constructor & Destructor Documentation

◆ SSEFrame() [1/2]

ofx::HTTP::SSEFrame::SSEFrame ( const std::string &  data)

Create a SSEFrame without an event name.

Parameters
dataThe UTF-8 encoded data to send.

◆ SSEFrame() [2/2]

ofx::HTTP::SSEFrame::SSEFrame ( const std::string &  event,
const std::string &  data 
)

Create a SSEFrame with an event name.

Parameters
eventThe UTF-8 encoded event name to send.
dataThe UTF-8 encoded data to send.

Member Function Documentation

◆ data()

std::string ofx::HTTP::SSEFrame::data ( ) const
Returns
the UTF-8 encoded data to be sent.

◆ event()

std::string ofx::HTTP::SSEFrame::event ( ) const
Returns
the UTF-8 encoded event name or an empty string if unset.

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