StringPart
StringPart
#include <icy/http/form.h>class StringPartDefined in src/http/include/icy/http/form.h:306
Inherits:
FormPart
Form part backed by an in-memory string payload.
List of all members
| Name | Kind | Owner |
|---|---|---|
StringPart | function | Declared here |
StringPart | function | Declared here |
~StringPart | function | Declared here |
writeChunk | function | Declared here |
write | function | Declared here |
write | function | Declared here |
length | function | Declared here |
_data | variable | Declared here |
FormPart | function | Inherited from FormPart |
~FormPart | function | Inherited from FormPart |
reset | function | Inherited from FormPart |
writeChunk | function | Inherited from FormPart |
write | function | Inherited from FormPart |
write | function | Inherited from FormPart |
headers | function | Inherited from FormPart |
initialWrite | function | Inherited from FormPart |
contentType | function | Inherited from FormPart |
length | function | Inherited from FormPart |
_contentType | variable | Inherited from FormPart |
_length | variable | Inherited from FormPart |
_headers | variable | Inherited from FormPart |
_initialWrite | variable | Inherited from FormPart |
Inherited from FormPart
| Kind | Name | Description |
|---|---|---|
function | FormPart | Creates the FormPart with the given MIME content type. |
function | ~FormPart virtual | Destroys the FormPart. |
function | reset virtual | Resets the internal state and write position to the beginning. Called by FormWriter when retrying or recalculating content length. |
function | writeChunk virtual | Writes the next chunk of data to the FormWriter. |
function | write virtual | Writes the entire part data to the FormWriter in one call. |
function | write virtual | Writes the entire part data to an output stream (used for content-length calculation). |
function | headers | Returns the extra MIME headers for this part (e.g. Content-Disposition). |
function | initialWrite virtual const | Returns true if this is the first write call since construction or reset(). |
function | contentType const | Returns the MIME content type for this part. |
function | length virtual const | Returns the total byte length of the part data. |
variable | _contentType | |
variable | _length | |
variable | _headers | |
variable | _initialWrite |
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 override | Writes the string data as a single chunk to the FormWriter. |
void | write virtual override | Writes the string data to the FormWriter. |
void | write virtual override | Writes the string data to an output stream. |
uint64_t | length virtual const override | Returns the byte length of the string data. |
StringPart
StringPart(const std::string & data)Defined in src/http/include/icy/http/form.h:311
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)Defined in src/http/include/icy/http/form.h:316
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()Defined in src/http/include/icy/http/form.h:319
Destroys the StringPart.
writeChunk
virtual override
virtual bool writeChunk(FormWriter & writer) overrideDefined in src/http/include/icy/http/form.h:324
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).
Reimplements
write
virtual override
virtual void write(FormWriter & writer) overrideDefined in src/http/include/icy/http/form.h:328
Writes the string data to the FormWriter.
Parameters
writerThe FormWriter to send data through.
Reimplements
write
virtual override
virtual void write(std::ostream & ostr) overrideDefined in src/http/include/icy/http/form.h:332
Writes the string data to an output stream.
Parameters
ostrOutput stream to write to.
Reimplements
length
virtual const override
virtual uint64_t length() const overrideDefined in src/http/include/icy/http/form.h:335
Returns the byte length of the string data.
Reimplements
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::string | _data |
_data
std::string _data