Class Poco::Net::StringPartSource
Author: Applied Informatics Software Engineering GmbH and Contributors

# Poco::Net

# class StringPartSource

Library: Net
Package: Messages
Header: Poco/Net/StringPartSource.h

## Description

An implementation of PartSource for strings.

## Inheritance

Direct Base Classes: PartSource

All Base Classes: PartSource

## Member Summary

Member Functions: filename, getContentLength, stream

Inherited Functions: filename, getContentLength, headers, mediaType, stream

## Constructors

### StringPartSource

StringPartSource(
const std::string & str
);

Creates the StringPartSource for the given string.

The MIME type is set to text/plain.

### StringPartSource

StringPartSource(
const std::string & str,
const std::string & mediaType
);

Creates the StringPartSource for the given string and MIME type.

### StringPartSource

StringPartSource(
const std::string & str,
const std::string & mediaType,
const std::string & filename
);

Creates the StringPartSource for the given string, MIME type and filename.

## Destructor

### ~StringPartSource

~StringPartSource();

Destroys the StringPartSource.

## Member Functions

### filename

const std::string & filename() const;

Returns the filename portion of the path.

See also: Poco::Net::PartSource::filename()

### getContentLength

std::streamsize getContentLength() const;

Returns the string size.

See also: Poco::Net::PartSource::getContentLength()

### stream

std::istream & stream();

Returns a string input stream for the string.

See also: Poco::Net::PartSource::stream()