FormPart
#include <icy/http/form.h>
class FormPartDefined in src/http/include/icy/http/form.h:183
- Subclassed by
FilePart,StringPart
Public Methods
| Return | Name | Description |
|---|---|---|
FormPart | Creates the FormPart with the given MIME content type. | |
~FormPart virtual | Destroys the FormPart. | |
void | reset virtual | Resets the internal state and write position to the beginning. Called by FormWriter when retrying or recalculating content length. |
bool | writeChunk virtual | Writes the next chunk of data to the FormWriter. |
void | write virtual | Writes the entire part data to the FormWriter in one call. |
void | write virtual | Writes the entire part data to an output stream (used for content-length calculation). |
NVCollection & | headers | Returns the extra MIME headers for this part (e.g. Content-Disposition). |
bool | initialWrite virtual const | Returns true if this is the first write call since construction or reset(). |
const std::string & | contentType const | Returns the MIME content type for this part. |
uint64_t | length virtual const | Returns the total byte length of the part data. |
FormPart
FormPart(const std::string & contentType = "application/octet-stream")Defined in src/http/include/icy/http/form.h:188
Creates the FormPart with the given MIME content type.
Parameters
| Parameter | Type | Description |
|---|---|---|
contentType | const std::string & | MIME type for this part (default: "application/octet-stream"). |
~FormPart
virtual
virtual ~FormPart()Defined in src/http/include/icy/http/form.h:191
Destroys the FormPart.
reset
virtual
virtual void reset()Defined in src/http/include/icy/http/form.h:195
Resets the internal state and write position to the beginning. Called by FormWriter when retrying or recalculating content length.
Reimplemented by
writeChunk
virtual
virtual bool writeChunk(FormWriter & writer)Defined in src/http/include/icy/http/form.h:200
Writes the next chunk of data to the FormWriter.
Returns
true if more data remains to be written; false when complete.
Reimplemented by
Parameters
| Parameter | Type | Description |
|---|---|---|
writer | FormWriter & | The FormWriter to send the chunk through. |
write
virtual
virtual void write(FormWriter & writer)Defined in src/http/include/icy/http/form.h:204
Writes the entire part data to the FormWriter in one call.
Reimplemented by
Parameters
| Parameter | Type | Description |
|---|---|---|
writer | FormWriter & | The FormWriter to send data through. |
write
virtual
virtual void write(std::ostream & ostr)Defined in src/http/include/icy/http/form.h:208
Writes the entire part data to an output stream (used for content-length calculation).
Reimplemented by
Parameters
| Parameter | Type | Description |
|---|---|---|
ostr | std::ostream & | Output stream to write to. |
headers
NVCollection & headers()Defined in src/http/include/icy/http/form.h:211
Returns the extra MIME headers for this part (e.g. Content-Disposition).
initialWrite
virtual const
virtual bool initialWrite() constDefined in src/http/include/icy/http/form.h:214
Returns true if this is the first write call since construction or reset().
contentType
const
const std::string & contentType() constDefined in src/http/include/icy/http/form.h:217
Returns the MIME content type for this part.
length
virtual const
virtual uint64_t length() constDefined in src/http/include/icy/http/form.h:220
Returns the total byte length of the part data.
Reimplemented by
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::string | _contentType | |
uint64_t | _length | |
NVCollection | _headers | |
bool | _initialWrite |
_contentType
std::string _contentTypeDefined in src/http/include/icy/http/form.h:223
_length
uint64_t _lengthDefined in src/http/include/icy/http/form.h:224
_headers
NVCollection _headersType: NVCollection
Defined in src/http/include/icy/http/form.h:225
_initialWrite
bool _initialWrite