Skip to content

Stringstream

Spice
import "std/text/stringstream";

StringStream struct

Helper data structure to construct strings. It is useful to avoid copying large strings around.

Constructors

ctor

Spice
public p StringStream.ctor()

Construct an empty string stream

ctor

Spice
public p StringStream.ctor(string input)

Construct a string stream initialized with a raw string

Parameters

Name Type Description
input string Initial buffer content

ctor

Spice
public p StringStream.ctor(const String& input)

Construct a string stream initialized with a String

Parameters

Name Type Description
input const String& Initial buffer content

Methods

clear

Spice
public p StringStream.clear()

Clear the buffer

str

Spice
public f<const String&> StringStream.str()

Get the value of the buffer

Returns: const String& — Resulting String object

Functions

endl

Spice
public f<char> endl()

Return end line character

Returns: char — End line character

Operators

operator

Spice
public f<StringStream&> operator<<(StringStream& ss, string input)

Append a raw string to the buffer

Returns: StringStream&

operator

Spice
public f<StringStream&> operator<<(StringStream& ss, const String& input)

Append a String to the buffer

Returns: StringStream&

operator

Spice
public f<StringStream&> operator<<(StringStream& ss, char input)

Append a single char to the buffer

Returns: StringStream&