ToyGine2 26.2.0
Game Engine for retro consoles
Loading...
Searching...
No Matches
toy::OStringStream< StringType > Class Template Reference

Output stream that appends formatted values into a toy::StringLike backend. More...

Public Types

using char_type = char
 Type of characters stored in the string.
using pos_type = size_t
 Type of positions in the string.

Public Member Functions

constexpr OStringStream () noexcept=default
 Default constructor.
template<StringLike SourceStringType>
constexpr OStringStream (const SourceStringType &string) noexcept
 Constructs an OStringStream from a string-like object.
constexpr void swap (OStringStream &other) noexcept
 Swaps the contents of this stream with another stream.
constexpr OStringStreamoperator<< (bool value) noexcept
 Inserts a boolean value into the stream.
constexpr OStringStreamoperator<< (long value) noexcept
 Inserts a signed long integer value into the stream.
constexpr OStringStreamoperator<< (unsigned long value) noexcept
 Inserts an unsigned long integer value into the stream.
constexpr OStringStreamoperator<< (long long value) noexcept
 Inserts a signed long long integer value into the stream.
constexpr OStringStreamoperator<< (unsigned long long value) noexcept
 Inserts an unsigned long long integer value into the stream.
constexpr OStringStreamoperator<< (double value) noexcept
 Inserts a double-precision floating-point value into the stream.
constexpr OStringStreamoperator<< (const void *value) noexcept
 Inserts a pointer value into the stream.
constexpr OStringStreamoperator<< (nullptr_t) noexcept
 Inserts a null pointer literal into the stream.
constexpr OStringStreamoperator<< (short value) noexcept
 Inserts a signed short integer value into the stream.
constexpr OStringStreamoperator<< (int value) noexcept
 Inserts a signed integer value into the stream.
constexpr OStringStreamoperator<< (unsigned short value) noexcept
 Inserts an unsigned short integer value into the stream.
constexpr OStringStreamoperator<< (unsigned int value) noexcept
 Inserts an unsigned integer value into the stream.
constexpr OStringStreamoperator<< (float value) noexcept
 Inserts a single-precision floating-point value into the stream.
constexpr OStringStreamoperator<< (signed char value) noexcept
 Inserts a signed 8-bit integer value into the stream.
constexpr OStringStreamoperator<< (unsigned char value) noexcept
 Inserts an unsigned 8-bit integer value into the stream.
constexpr OStringStreamoperator<< (char_type value) noexcept
 Inserts a single character into the stream.
template<StringLike SourceStringType>
constexpr OStringStreamoperator<< (const SourceStringType &value) noexcept
 Inserts a string-like object into the stream.
constexpr OStringStreamoperator<< (const char_type *value) noexcept
 Inserts a C string into the stream.
constexpr const StringType & str () const noexcept
 Returns a const reference to the underlying string.
template<StringLike SourceStringType>
constexpr void str (const SourceStringType &string) noexcept
 Sets the content of the stream from a string-like object.
constexpr CStringView view () const noexcept
 Returns a non-owning view of the underlying string.
constexpr OStringStreamput (char_type character) noexcept
 Appends a single character to the end of the stream.
constexpr OStringStreamwrite (const char_type *string, size_t count) noexcept
 Writes a specified number of characters from a buffer to the stream.
constexpr pos_type tellp () const noexcept
 Returns the current write position in the stream.
constexpr size_t precision () const noexcept
 Returns the current floating-point precision setting.
constexpr size_t setPrecision (size_t newPrecision) noexcept
 Sets the floating-point precision and returns the previous value.
template<StringLike SourceStringType>
constexpr OStringStream< StringType > & operator<< (const SourceStringType &value) noexcept

Private Attributes

StringType _string
 Internal string storage for the stream content.
size_t _precision = 6
 Floating-point precision value used for number formatting.

Detailed Description

template<typename StringType>
class toy::OStringStream< StringType >

Output stream that appends formatted values into a toy::StringLike backend.

OStringStream provides a std::ostringstream-like operator<< surface; allocation and capacity follow StringType (e.g. toy::FixedString). Integral, floating-point, boolean, pointer, character, C-string, and string-like inserts are supported where exposed by the template API.

Template Parameters
StringTypeThe type of the underlying storage. Must satisfy the toy::StringLike concept.

Key Features

  • Storage policy: No separate allocator; behavior and limits come from StringType.
  • constexpr: Construction and many inserts are usable in constant evaluation when StringType allows it.
  • noexcept: Members are noexcept; failed capacity is handled per StringType (typically debug assertions).
  • Floating-point precision: precision() / setPrecision() affect subsequent floating inserts.

Usage Example

#include "core.hpp"
stream << "Value: " << 42 << ", Pi: " << 3.14159;
stream << '!' << toy::CStringView(" ok: ") << true;
const auto result = stream.str();
(void)result;
Non-owning string view class for C-style strings.
Definition c_string_view.hpp:109
Output stream that appends formatted values into a toy::StringLike backend.
Definition o_string_stream.hpp:89
constexpr const StringType & str() const noexcept
Returns a const reference to the underlying string.
Definition o_string_stream.inl:253
Umbrella header for the engine core module.

Performance Characteristics

  • Construction / swap: O(1) relative to string state.
  • Append: Depends on StringType growth and content; each operator<< forwards to string append or formatting helpers.
  • str(): Returns a view or copy per StringType; typically O(1) or O(n) with n the current length.

Safety Guarantees

  • Bounds: Overflow is governed by StringType; violating capacity is undefined if assertions are disabled.
  • Exception safety: No exceptions; all operations are noexcept.

Compatibility

  • C++ standard: C++20 or later (concepts, constexpr usage as implemented).
  • Embedded: Suitable when StringType uses fixed storage (e.g. toy::FixedString).
Note
Only end-of-string appends are supported; there is no seek or insert-at-offset API.
The effective write position matches the end of the underlying string after each successful append.
See also
FixedString, StringLike, CStringView

Member Typedef Documentation

◆ char_type

template<typename StringType>
using toy::OStringStream< StringType >::char_type = char

Type of characters stored in the string.

◆ pos_type

template<typename StringType>
using toy::OStringStream< StringType >::pos_type = size_t

Type of positions in the string.

Constructor & Destructor Documentation

◆ OStringStream() [1/2]

template<typename StringType>
toy::OStringStream< StringType >::OStringStream ( )
constexprdefaultnoexcept

Default constructor.

◆ OStringStream() [2/2]

template<typename StringType>
template<StringLike SourceStringType>
toy::OStringStream< StringType >::OStringStream ( const SourceStringType & string)
explicitconstexprnoexcept

Constructs an OStringStream from a string-like object.

This constructor initializes the stream by copying the content from a string-like object.

Template Parameters
SourceStringTypeThe type of the source string. Must satisfy the toy::StringLike concept.
Parameters
stringThe source string-like object to copy content from.
Precondition
The string must be valid and properly initialized.
Postcondition
The stream contains a copy of the source string content.
Note
The constructor performs a deep copy of the string content.
The source string type can be different from StringType as long as both satisfy toy::StringLike.

Member Function Documentation

◆ operator<<() [1/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( bool value)
constexprnoexcept

Inserts a boolean value into the stream.

This operator converts the boolean value to its string representation and appends it to the stream. The value true is converted to the string "true", and the value false is converted to the string "false".

Parameters
valueThe boolean value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Note
This operator follows the same pattern as std::ostringstream::operator<<(bool).
Postcondition
The write position is advanced by the length of the appended string (4 for "true", 5 for "false").
See also
put(char_type)
write(const char_type *, size_t)
tellp()

◆ operator<<() [2/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( char_type value)
constexprnoexcept

Inserts a single character into the stream.

This operator appends the specified value character to the end of the stream. The character is added directly without any conversion or formatting.

Parameters
valueThe character to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by one character.
Note
This operator follows the same pattern as std::ostringstream::operator<<(char_type).
See also
operator<<(const char_type *)
operator<<(const SourceStringType &)
put(char_type)
tellp()

◆ operator<<() [3/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( const char_type * value)
constexprnoexcept

Inserts a C string into the stream.

This operator appends the content of a C string to the end of the stream. The string is copied and appended to the current stream content.

Parameters
valueThe C string to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Precondition
The value must not be null.
Postcondition
The write position is advanced by the length of the appended string (excluding the null terminator).
Note
This operator follows the same pattern as std::ostringstream::operator<<(const char*).
The string is appended up to but not including the null terminator.
This operator is useful for inserting C-style string literals and null-terminated character arrays.
See also
operator<<(const SourceStringType &)
operator<<(char_type)
put(char_type)
write(const char_type *, size_t)
tellp()

◆ operator<<() [4/19]

template<typename StringType>
template<StringLike SourceStringType>
OStringStream & toy::OStringStream< StringType >::operator<< ( const SourceStringType & value)
constexprnoexcept

Inserts a string-like object into the stream.

This operator appends the content of a string-like object to the end of the stream. The string content is copied and appended to the current stream content.

Template Parameters
SourceStringTypeThe type of the source string. Must satisfy the toy::StringLike concept.
Parameters
valueThe string-like object to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Precondition
The value must be valid and properly initialized.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(const std::string&).
The source string type can be different from StringType as long as both satisfy toy::StringLike.
This operator is useful for inserting string literals, toy::FixedString objects, and other string-like types.
See also
operator<<(const char_type *)
operator<<(char_type)
put(char_type)
write(const char_type *, size_t)
tellp()

◆ operator<<() [5/19]

template<typename StringType>
template<StringLike SourceStringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( const SourceStringType & value)
constexprnoexcept

◆ operator<<() [6/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( const void * value)
constexprnoexcept

Inserts a pointer value into the stream.

This operator converts the pointer value to its hexadecimal string representation with "0x" prefix and appends it to the stream. The value is zero-padded to the pointer width: 8 hex digits for 32-bit pointers, 16 for 64-bit, so the output length is fixed for a given platform (e.g. "0x00000000" or "0x0000000000000000").

Parameters
valueThe pointer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string (2 + sizeof(void*) * 2 characters).
Note
This operator follows the same pattern as std::ostringstream::operator<<(const void*).
For null pointers, use operator<<(nullptr_t) for consistent "nullptr" output.
See also
operator<<(nullptr_t)
put(char_type)
tellp()

◆ operator<<() [7/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( double value)
constexprnoexcept

Inserts a double-precision floating-point value into the stream.

This operator converts the double value to its decimal string representation with the current precision setting and appends it to the stream. The precision controls the number of digits displayed.

Parameters
valueThe double-precision floating-point value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(double).
The precision is controlled by setPrecision(size_t) and defaults to 6 digits.
See also
precision() const
setPrecision(size_t)
operator<<(float)
put(char_type)
tellp()

◆ operator<<() [8/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( float value)
constexprnoexcept

Inserts a single-precision floating-point value into the stream.

This operator converts the float value to its decimal string representation with the current precision setting and appends it to the stream. The precision controls the number of digits displayed.

Parameters
valueThe single-precision floating-point value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(float).
The precision is controlled by setPrecision() and defaults to 6 digits.
See also
precision() const
setPrecision(size_t)
operator<<(double)
put(char_type)
tellp()

◆ operator<<() [9/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( int value)
constexprnoexcept

Inserts a signed integer value into the stream.

This operator converts the signed integer value to its decimal string representation and appends it to the stream. Negative values are prefixed with a minus sign.

Parameters
valueThe signed integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(int).
See also
operator<<(unsigned int)
put(char_type)
tellp()

◆ operator<<() [10/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( long long value)
constexprnoexcept

Inserts a signed long long integer value into the stream.

This operator converts the signed long long integer value to its decimal string representation and appends it to the stream. Negative values are prefixed with a minus sign.

Parameters
valueThe signed long long integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(long long).
See also
operator<<(unsigned long long)
put(char_type)
tellp()

◆ operator<<() [11/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( long value)
constexprnoexcept

Inserts a signed long integer value into the stream.

This operator converts the signed long integer value to its decimal string representation and appends it to the stream. Negative values are prefixed with a minus sign.

Parameters
valueThe signed long integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(long).
See also
operator<<(unsigned long)
put(char_type)
tellp()

◆ operator<<() [12/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( nullptr_t )
constexprnoexcept

Inserts a null pointer literal into the stream.

This operator inserts the string "nullptr" into the stream when a null pointer literal is provided. This provides a consistent and readable representation for null pointers.

Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by 7 characters (length of "nullptr").
Note
This operator follows the same pattern as std::ostringstream::operator<<(nullptr_t).
The output is always the string "nullptr", regardless of the actual null pointer value.
This operator is preferred over operator<<(const void*) for null pointer literals.
See also
operator<<(const void *)
put(char_type)
tellp()

◆ operator<<() [13/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( short value)
constexprnoexcept

Inserts a signed short integer value into the stream.

This operator converts the signed short integer value to its decimal string representation and appends it to the stream. Negative values are prefixed with a minus sign.

Parameters
valueThe signed short integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(short).
See also
operator<<(unsigned short)
put(char_type)
tellp()

◆ operator<<() [14/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( signed char value)
constexprnoexcept

Inserts a signed 8-bit integer value into the stream.

This operator converts the signed 8-bit integer value to its decimal string representation and appends it to the stream. Negative values are prefixed with a minus sign.

Parameters
valueThe signed 8-bit integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(signed char).
See also
operator<<(unsigned char)
put(char_type)
tellp()

◆ operator<<() [15/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( unsigned char value)
constexprnoexcept

Inserts an unsigned 8-bit integer value into the stream.

This operator converts the unsigned 8-bit integer value to its decimal string representation and appends it to the stream.

Parameters
valueThe unsigned 8-bit integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(unsigned char).
See also
operator<<(signed char)
put(char_type)
tellp()

◆ operator<<() [16/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( unsigned int value)
constexprnoexcept

Inserts an unsigned integer value into the stream.

This operator converts the unsigned integer value to its decimal string representation and appends it to the stream.

Parameters
valueThe unsigned integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(unsigned int).
See also
operator<<(int)
put(char_type)
tellp()

◆ operator<<() [17/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( unsigned long long value)
constexprnoexcept

Inserts an unsigned long long integer value into the stream.

This operator converts the unsigned long long integer value to its decimal string representation and appends it to the stream.

Parameters
valueThe unsigned long long integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(unsigned long long).
See also
operator<<(long long)
put(char_type)
tellp()

◆ operator<<() [18/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( unsigned long value)
constexprnoexcept

Inserts an unsigned long integer value into the stream.

This operator converts the unsigned long integer value to its decimal string representation and appends it to the stream.

Parameters
valueThe unsigned long integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(unsigned long).
See also
operator<<(long)
put(char_type)
tellp()

◆ operator<<() [19/19]

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::operator<< ( unsigned short value)
constexprnoexcept

Inserts an unsigned short integer value into the stream.

This operator converts the unsigned short integer value to its decimal string representation and appends it to the stream.

Parameters
valueThe unsigned short integer value to insert into the stream.
Returns
A reference to this OStringStream, allowing operator chaining.
Postcondition
The write position is advanced by the length of the appended string.
Note
This operator follows the same pattern as std::ostringstream::operator<<(unsigned short).
See also
operator<<(short)
put(char_type)
tellp()

◆ precision()

template<typename StringType>
size_t toy::OStringStream< StringType >::precision ( ) const
nodiscardconstexprnoexcept

Returns the current floating-point precision setting.

This method returns the precision value that will be used for formatting floating-point numbers when writing to the stream. The precision specifies the number of digits to display.

Returns
The current precision value.
Note
The precision value affects how floating-point numbers are formatted when written to the stream.
See also
setPrecision(size_t)

◆ put()

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::put ( char_type character)
constexprnoexcept

Appends a single character to the end of the stream.

This method appends the specified character to the end of the underlying string storage. The character is added to the current content without replacing it.

Parameters
characterThe character to append to the stream.
Returns
A reference to this OStringStream, allowing method chaining.
Precondition
The character must not be the null character ('\0').
Postcondition
The character is appended to the end of the stream content.
The write position is advanced by one character.
See also
write(const char_type *, size_t)
tellp()

◆ setPrecision()

template<typename StringType>
size_t toy::OStringStream< StringType >::setPrecision ( size_t newPrecision)
constexprnoexcept

Sets the floating-point precision and returns the previous value.

This method sets the precision value that will be used for formatting floating-point numbers when writing to the stream. The precision specifies the number of digits to display.

Parameters
newPrecisionThe new precision value to set.
Returns
The previous precision value before the change.
Precondition
The newPrecision must be lower than or equal to the maximum supported digits for long double.
Note
The precision value affects how floating-point numbers are formatted when written to the stream.
See also
precision() const

◆ str() [1/2]

template<typename StringType>
const StringType & toy::OStringStream< StringType >::str ( ) const
nodiscardconstexprnoexcept

Returns a const reference to the underlying string.

This method provides read-only access to the internal string storage.

Returns
A const reference to the underlying string.
Note
The returned reference is valid for the lifetime of the OStringStream object.
See also
view()

◆ str() [2/2]

template<typename StringType>
template<StringLike SourceStringType>
void toy::OStringStream< StringType >::str ( const SourceStringType & string)
constexprnoexcept

Sets the content of the stream from a string-like object.

This method replaces the current content of the stream with the content from a string-like object.

Template Parameters
SourceStringTypeThe type of the source string. Must satisfy the toy::StringLike concept.
Parameters
stringThe source string-like object to set the content from.
Precondition
The string must be valid and properly initialized.
Postcondition
The stream contains a copy of the source string content.
The previous content of the stream is replaced.
Note
The method performs a deep copy of the string content.
The source string type can be different from StringType as long as both satisfy toy::StringLike.
This method provides a convenient way to update the stream content after construction.
See also
str() const

◆ swap()

template<typename StringType>
void toy::OStringStream< StringType >::swap ( OStringStream< StringType > & other)
constexprnoexcept

Swaps the contents of this stream with another stream.

This method exchanges the underlying string storage between this stream and the other stream. Both streams must have the same StringType template parameter.

Parameters
otherThe stream to swap contents with.
Postcondition
The contents of this stream and other are exchanged.
Both streams remain valid after the swap operation.
Note
Self-swap is safe and has no effect.
The operation is noexcept and provides strong exception guarantee.
This method is useful for efficient content exchange without copying.

◆ tellp()

template<typename StringType>
OStringStream< StringType >::pos_type toy::OStringStream< StringType >::tellp ( ) const
nodiscardconstexprnoexcept

Returns the current write position in the stream.

This method returns the position where the next write operation will append data. Since OStringStream only supports appending operations (all writes go to the end), the write position always equals the number of characters currently in the stream, which is the same as the size of the underlying string.

Returns
The current write position, representing the index where the next character will be appended. This value is always equal to the number of characters written so far and to str().size().
Note
Since all operations append to the end, the write position is always equal to the stream size.
See also
str() const, put(char_type), write(const char_type *, size_t)

◆ view()

template<typename StringType>
CStringView toy::OStringStream< StringType >::view ( ) const
nodiscardconstexprnoexcept

Returns a non-owning view of the underlying string.

This method creates and returns a toy::CStringView that provides read-only access to the underlying string storage without copying the content. The view is lightweight and does not own the string data.

Returns
A toy::CStringView representing the current content of the stream.
Note
The returned view is valid for the lifetime of the OStringStream object.
The view does not own the string data and should not be used after the OStringStream is destroyed.
This method is useful for passing the stream content to functions that accept toy::CStringView without creating a copy.
The view reflects the current state of the stream at the time of the call.
See also
str() const
toy::CStringView

◆ write()

template<typename StringType>
OStringStream< StringType > & toy::OStringStream< StringType >::write ( const char_type * string,
size_t count )
constexprnoexcept

Writes a specified number of characters from a buffer to the stream.

This method appends count characters from the buffer pointed to by string to the end of the stream. The characters are copied directly from the buffer without requiring null termination.

Parameters
stringThe pointer to the character buffer to write from. Must not be null if count is greater than zero.
countThe number of characters to write from the buffer.
Returns
A reference to this OStringStream, allowing method chaining.
Precondition
If count is greater than zero, string must not be null and must point to a valid buffer of at least count characters.
All characters in the buffer must not be null characters ('\0').
Postcondition
count characters from the buffer are appended to the end of the stream content.
The write position is advanced by count characters.
Note
This method is useful for writing binary data or partial strings that may not be null-terminated.
If count is zero, the method returns without modifying the stream.
See also
put(char_type), tellp()

Member Data Documentation

◆ _precision

template<typename StringType>
size_t toy::OStringStream< StringType >::_precision = 6
private

Floating-point precision value used for number formatting.

◆ _string

template<typename StringType>
StringType toy::OStringStream< StringType >::_string
private

Internal string storage for the stream content.


The documentation for this class was generated from the following files: