FormPart
FormPart
#include <icy/http/form.h>class FormPartDefined in src/http/include/icy/http/form.h:183
Subclassed by:
FilePart,StringPart
An implementation of FormPart.
List of all members
| Name | Kind | Owner |
|---|---|---|
FormPart | function | Declared here |
~FormPart | function | Declared here |
reset | function | Declared here |
writeChunk | function | Declared here |
write | function | Declared here |
write | function | Declared here |
headers | function | Declared here |
initialWrite | function | Declared here |
contentType | function | Declared here |
length | function | Declared here |
_contentType | variable | Declared here |
_length | variable | Declared here |
_headers | variable | Declared here |
_initialWrite | variable | Declared here |
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
contentTypeMIME 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.
Parameters
writerThe FormWriter to send the chunk through.
Returns
true if more data remains to be written; false when complete.
Reimplemented by
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.
Parameters
writerThe FormWriter to send data through.
Reimplemented by
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).
Parameters
ostrOutput stream to write to.
Reimplemented by
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 _headersDefined in src/http/include/icy/http/form.h:225
_initialWrite
bool _initialWrite