reflection.cpp File
C++ source file with implementations for the µTest++ methods. More...
Included Headers
Namespaces Index
| namespace | micro_os_plus |
|
The primary namespace for the µOS++ framework. More... | |
| namespace | micro_test_plus |
|
Primary namespace for the µTest++ testing framework. More... | |
| namespace | reflection |
|
Reflection utilities for the µTest++ testing framework. More... | |
Functions Index
| const char * | short_name (const char *name) noexcept |
|
Extract a short type or function name from a fully qualified name. More... | |
Description
C++ source file with implementations for the µTest++ methods.
This source file contains the implementation of reflection::short_name(), which extracts the base file name from a fully qualified path by returning the portion after the last / separator, or the original string if no separator is present.
All definitions reside within the micro_os_plus::micro_test_plus::reflection namespace.
This file must be included when building the µTest++ library.
Functions
short_name()
| noexcept |
Extract a short type or function name from a fully qualified name.
- Parameters
-
name The fully qualified name as a C-string.
- Returns
A pointer to the short name within the input string.
This function extracts the short name from a given file path by locating the final folder separator ('/'). If a separator is found, it returns a pointer to the character immediately following it, effectively providing the file or folder name. If no separator is present, the original input string is returned. This utility is useful for reporting concise file or folder names in test output.
Definition at line 74 of file reflection.cpp.
Referenced by micro_os_plus::micro_test_plus::runner::abort, micro_os_plus::micro_test_plus::reporter_human::output_fail_prefix_ and micro_os_plus::micro_test_plus::reporter_tap::output_fail_suffix_.
File Listing
The file content with the documentation metadata removed is:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.