HTTP module
StringPart
Form part backed by an in-memory string payload.
StringPart
#include <icy/http/form.h>Inherits:
FormPart
Form part backed by an in-memory string payload.
Public Methods
| Return | Name | Description |
|---|---|---|
StringPart | Creates a StringPart with the given data and default content type "application/octet-stream". | |
StringPart | Creates a StringPart with the given data and MIME content type. | |
~StringPart virtual | Destroys the StringPart. | |
bool | writeChunk virtual | Writes the string data as a single chunk to the FormWriter. |
void | write virtual | Writes the string data to the FormWriter. |
void | write virtual | Writes the string data to an output stream. |
uint64_t | length virtual const | Returns the byte length of the string data. |
StringPart
StringPart(const std::string & data)Creates a StringPart with the given data and default content type "application/octet-stream".
Parameters
dataString data to send as this part.
StringPart
StringPart(const std::string & data, const std::string & contentType)Creates a StringPart with the given data and MIME content type.
Parameters
dataString data to send as this part.contentTypeMIME type for this part.
~StringPart
virtual
virtual ~StringPart()Destroys the StringPart.
writeChunk
virtual
virtual bool writeChunk(FormWriter & writer)Writes the string data as a single chunk to the FormWriter.
Parameters
writerThe FormWriter to send data through.
Returns
false always (string data is sent in a single chunk).
write
virtual
virtual void write(FormWriter & writer)Writes the string data to the FormWriter.
Parameters
writerThe FormWriter to send data through.
write
virtual
virtual void write(std::ostream & ostr)Writes the string data to an output stream.
Parameters
ostrOutput stream to write to.
length
virtual const
virtual uint64_t length() constReturns the byte length of the string data.
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::string | _data |
_data
std::string _data