micro-test-plus 4.1.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
expression-formatter.h File Reference

C++ header file with declarations for the µTest++ expression formatter. More...

#include <charconv>
#include <cstdio>
#include <string>
#include <string_view>
#include "type-traits.h"
#include "detail.h"
#include "inlines/expression-formatter-inlines.h"

Go to the source code of this file.

Classes

struct  micro_os_plus::micro_test_plus::detail::colours
 Colours used to highlight pass and fail results in test reports. More...
class  micro_os_plus::micro_test_plus::detail::expression_formatter
 Formats values and expressions into an owned string buffer. More...

Namespaces

namespace  micro_os_plus
 The primary namespace for the µOS++ framework.
namespace  micro_os_plus::micro_test_plus
 Primary namespace for the µTest++ testing framework.
namespace  micro_os_plus::micro_test_plus::detail
 Internal implementation details for the µTest++ framework.

Variables

constexpr colours micro_os_plus::micro_test_plus::detail::colours_red_green

Detailed Description

This header provides the expression_formatter class, which encapsulates all value-formatting logic used by the µTest++ framework. The class owns a std::string buffer and exposes operator<< overloads for every standard arithmetic type, character type, string, pointer, container, and framework expression type derived from detail::op.

By consolidating the formatting operators and their shared append_number_ helper into a single class, the reporter is relieved of those responsibilities, and detail::deferred_reporter can pre-format expression text at construction time without requiring reporter or subtest to be complete at that point.

Colour-code processing is intentionally excluded from this class; it remains the responsibility of the owning reporter.

All definitions reside within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.

This file is intended solely for internal use within the framework and should not be included directly by user code.

Definition in file expression-formatter.h.