Home
HTTP module

StringPart

Form part backed by an in-memory string payload.

StringPart

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

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

Inherits: FormPart

Form part backed by an in-memory string payload.

List of all members

NameKindOwner
StringPartfunctionDeclared here
StringPartfunctionDeclared here
~StringPartfunctionDeclared here
writeChunkfunctionDeclared here
writefunctionDeclared here
writefunctionDeclared here
lengthfunctionDeclared here
_datavariableDeclared here
FormPartfunctionInherited from FormPart
~FormPartfunctionInherited from FormPart
resetfunctionInherited from FormPart
writeChunkfunctionInherited from FormPart
writefunctionInherited from FormPart
writefunctionInherited from FormPart
headersfunctionInherited from FormPart
initialWritefunctionInherited from FormPart
contentTypefunctionInherited from FormPart
lengthfunctionInherited from FormPart
_contentTypevariableInherited from FormPart
_lengthvariableInherited from FormPart
_headersvariableInherited from FormPart
_initialWritevariableInherited from FormPart

Inherited from FormPart

KindNameDescription
functionFormPartCreates the FormPart with the given MIME content type.
function~FormPart virtualDestroys the FormPart.
functionreset virtualResets the internal state and write position to the beginning. Called by FormWriter when retrying or recalculating content length.
functionwriteChunk virtualWrites the next chunk of data to the FormWriter.
functionwrite virtualWrites the entire part data to the FormWriter in one call.
functionwrite virtualWrites the entire part data to an output stream (used for content-length calculation).
functionheadersReturns the extra MIME headers for this part (e.g. Content-Disposition).
functioninitialWrite virtual constReturns true if this is the first write call since construction or reset().
functioncontentType constReturns the MIME content type for this part.
functionlength virtual constReturns the total byte length of the part data.
variable_contentType
variable_length
variable_headers
variable_initialWrite

Public Methods

ReturnNameDescription
StringPartCreates a StringPart with the given data and default content type "application/octet-stream".
StringPartCreates a StringPart with the given data and MIME content type.
~StringPart virtualDestroys the StringPart.
boolwriteChunk virtual overrideWrites the string data as a single chunk to the FormWriter.
voidwrite virtual overrideWrites the string data to the FormWriter.
voidwrite virtual overrideWrites the string data to an output stream.
uint64_tlength virtual const overrideReturns 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

  • data String 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

  • data String data to send as this part.

  • contentType MIME 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) override

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

Writes the string data as a single chunk to the FormWriter.

Parameters

Returns

false always (string data is sent in a single chunk).

Reimplements

write

virtual override

virtual void write(FormWriter & writer) override

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

Writes the string data to the FormWriter.

Parameters

Reimplements

write

virtual override

virtual void write(std::ostream & ostr) override

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

Writes the string data to an output stream.

Parameters

  • ostr Output stream to write to.
Reimplements

length

virtual const override

virtual uint64_t length() const override

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

Returns the byte length of the string data.

Reimplements

Protected Attributes

ReturnNameDescription
std::string_data

_data

std::string _data

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