Skip to main content

plain_text Struct

Writes values as text, as the messages of the checks are written. More...

Declaration​

struct micro_os_plus::micro_test_plus::detail::plain_text { ... }

Included Headers​

Public Static Functions Index​

template <class T>
static voidappend (std::string &text, const T &value)

Appends a value to a text, in the plain mode of the formatter. More...

Description​

Writes values as text, as the messages of the checks are written.

Gives access to the plain mode of the expression_formatter, which is private, so that the names of the test cases generated by test_each() show their values as the messages do: the numbers without the type suffixes, and the strings and the characters unquoted. Also used by expression_formatter::append_operand() for the operands of the application types, so that their operator<< writes them as it writes them in the messages.

Definition at line 1702 of file expression-formatter.h.

Public Static Functions​

append()​

template <class T>
void micro_os_plus::micro_test_plus::detail::plain_text::append (std::string & text, const T & value)
static

Appends a value to a text, in the plain mode of the formatter.

The text is moved into a local formatter, the value is appended, and the text is moved back, so that no other buffer is allocated.

Template Parameters
T

The type of the value, which must satisfy extension::printable.

Parameters
text

The text to which the value is appended.

value

The value to append.

Returns

Nothing.

The text is moved into a formatter in the plain mode, the value is appended with the same operator<< overloads as the messages, and the text is moved back.

Declaration at line 1723 of file expression-formatter.h, definition at line 844 of file expression-formatter-inlines.h.

844 plain_text::append (std::string& text, const T& value)
845 {
846 expression_formatter formatter{ std::move (text) };
847 formatter << value;
848 text = std::move (formatter.buffer_);
849 }

Reference micro_os_plus::micro_test_plus::detail::expression_formatter::buffer_.

Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::append_operand, micro_os_plus::micro_test_plus::detail::anonymous{expression-formatter.cpp}::append_wide_text and micro_os_plus::micro_test_plus::detail::test_each_value.


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


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.