Home
HTTP module

FormPart

An implementation of FormPart.

FormPart

#include <icy/http/form.h>
class FormPart

Defined in src/http/include/icy/http/form.h:183

Subclassed by: FilePart, StringPart

An implementation of FormPart.

List of all members

NameKindOwner
FormPartfunctionDeclared here
~FormPartfunctionDeclared here
resetfunctionDeclared here
writeChunkfunctionDeclared here
writefunctionDeclared here
writefunctionDeclared here
headersfunctionDeclared here
initialWritefunctionDeclared here
contentTypefunctionDeclared here
lengthfunctionDeclared here
_contentTypevariableDeclared here
_lengthvariableDeclared here
_headersvariableDeclared here
_initialWritevariableDeclared here

Public Methods

ReturnNameDescription
FormPartCreates the FormPart with the given MIME content type.
~FormPart virtualDestroys the FormPart.
voidreset virtualResets the internal state and write position to the beginning. Called by FormWriter when retrying or recalculating content length.
boolwriteChunk virtualWrites the next chunk of data to the FormWriter.
voidwrite virtualWrites the entire part data to the FormWriter in one call.
voidwrite virtualWrites the entire part data to an output stream (used for content-length calculation).
NVCollection &headersReturns the extra MIME headers for this part (e.g. Content-Disposition).
boolinitialWrite virtual constReturns true if this is the first write call since construction or reset().
const std::string &contentType constReturns the MIME content type for this part.
uint64_tlength virtual constReturns 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

  • contentType 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.

Parameters

  • writer The 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

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

  • ostr Output 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() const

Defined 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() const

Defined in src/http/include/icy/http/form.h:217

Returns the MIME content type for this part.


length

virtual const

virtual uint64_t length() const

Defined in src/http/include/icy/http/form.h:220

Returns the total byte length of the part data.

Reimplemented by

Protected Attributes

ReturnNameDescription
std::string_contentType
uint64_t_length
NVCollection_headers
bool_initialWrite

_contentType

std::string _contentType

Defined in src/http/include/icy/http/form.h:223


_length

uint64_t _length

Defined in src/http/include/icy/http/form.h:224


_headers

NVCollection _headers

Defined in src/http/include/icy/http/form.h:225


_initialWrite

bool _initialWrite

Defined in src/http/include/icy/http/form.h:226