MultipartAdapter
MultipartAdapter
#include <icy/http/packetizers.h>class MultipartAdapterDefined in src/http/include/icy/http/packetizers.h:159
Inherits:
PacketProcessor
HTTP multipart encoding adapter for multipart/x-mixed-replace streaming.
List of all members
| Name | Kind | Owner |
|---|---|---|
connection | variable | Declared here |
contentType | variable | Declared here |
isBase64 | variable | Declared here |
initial | variable | Declared here |
emitter | variable | Declared here |
MultipartAdapter | function | Declared here |
MultipartAdapter | function | Declared here |
~MultipartAdapter | function | Declared here |
emitHeader | function | Declared here |
emitChunkHeader | function | Declared here |
process | function | Declared here |
PacketProcessor | function | Inherited from PacketProcessor |
process | function | Inherited from PacketProcessor |
accepts | function | Inherited from PacketProcessor |
operator<< | function | Inherited from PacketProcessor |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process() |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
variable | _emitter | |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Public Attributes
| Return | Name | Description |
|---|---|---|
Connection::Ptr | connection | HTTP connection for sending the initial response header. |
std::string | contentType | Content-Type of each part (e.g. "image/jpeg"). |
bool | isBase64 | If true, adds "Content-Transfer-Encoding: base64" to each part. |
bool | initial | True until the first chunk is processed and the boundary header emitted. |
PacketSignal | emitter |
connection
Connection::Ptr connectionDefined in src/http/include/icy/http/packetizers.h:162
HTTP connection for sending the initial response header.
contentType
std::string contentTypeDefined in src/http/include/icy/http/packetizers.h:163
Content-Type of each part (e.g. "image/jpeg").
isBase64
bool isBase64Defined in src/http/include/icy/http/packetizers.h:164
If true, adds "Content-Transfer-Encoding: base64" to each part.
initial
bool initialDefined in src/http/include/icy/http/packetizers.h:165
True until the first chunk is processed and the boundary header emitted.
emitter
PacketSignal emitterDefined in src/http/include/icy/http/packetizers.h:264
Public Methods
| Return | Name | Description |
|---|---|---|
MultipartAdapter inline | Creates a MultipartAdapter that sends headers through the given connection. The per-part content type is read from the connection's outgoing header. | |
MultipartAdapter inline | Creates a MultipartAdapter that emits its own raw HTTP/1.1 200 response header. Use this when no Connection object is available. | |
void | emitHeader virtual inline | Emits the initial HTTP/1.1 200 OK response with Content-Type multipart/x-mixed-replace. If a connection is set, headers are written through it; otherwise a raw response string is emitted. |
void | emitChunkHeader virtual inline | Emits the MIME boundary and per-part headers (Content-Type, optionally Content-Transfer-Encoding) for the next multipart chunk. |
void | process virtual inline | Wraps the incoming packet as a multipart chunk and emits it downstream. Emits the multipart HTTP response headers on the first call. |
MultipartAdapter
inline
inline MultipartAdapter(Connection::Ptr connection, bool base64 = false)Defined in src/http/include/icy/http/packetizers.h:171
Creates a MultipartAdapter that sends headers through the given connection. The per-part content type is read from the connection's outgoing header.
Parameters
connectionHTTP connection to use for sending the initial multipart header.[base64](base.html#base64)If true, indicates parts are base64-encoded.
MultipartAdapter
inline
inline MultipartAdapter(const std::string & contentType, bool base64 = false)Defined in src/http/include/icy/http/packetizers.h:184
Creates a MultipartAdapter that emits its own raw HTTP/1.1 200 response header. Use this when no Connection object is available.
Parameters
contentTypeContent-Type for each multipart part.[base64](base.html#base64)If true, indicates parts are base64-encoded.
emitHeader
virtual inline
virtual inline void emitHeader()Defined in src/http/include/icy/http/packetizers.h:197
Emits the initial HTTP/1.1 200 OK response with Content-Type multipart/x-mixed-replace. If a connection is set, headers are written through it; otherwise a raw response string is emitted.
emitChunkHeader
virtual inline
virtual inline void emitChunkHeader()Defined in src/http/include/icy/http/packetizers.h:231
Emits the MIME boundary and per-part headers (Content-Type, optionally Content-Transfer-Encoding) for the next multipart chunk.
process
virtual inline
virtual inline void process(IPacket & packet)Defined in src/http/include/icy/http/packetizers.h:248
Wraps the incoming packet as a multipart chunk and emits it downstream. Emits the multipart HTTP response headers on the first call.
Parameters
packetPacket containing the raw payload data.
