|
AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
|
inlineinherited |
Use DRAMA to send a message to the user - format using fmt::format.
The fmt::format library (see https://fmt.dev/) is a modern C++ formatting library inspired by python's formatting facilities, providing python fmt style formatting with C++ type safety. This interface to MessageUser() uses this approach to formatting.
For example:
MessageUserF("Don't {}!", "panic");
The message would be of the form:
<task>:Don't panic!
Formatting specifications are available to set width, white space, number of decimal points etc. If you include "drama/fmt/chrono.h", you can format C++ time variables (from the chrono library).
You can also generate formatting for your own types, see https://fmt.dev/11.0/api/#formatting-user-defined-types for details
References for the format strings:
#ifdef D2_NO_FMT_DEPRECATION_ALERTS #pragma GCC warning "Remember to disable D2_NO_FMT_DEPRECATION_ALERTS and resolve depreciated interfaces" #endifThis will produce a message in both CLang (Mac) and GCC, and if you have it in only one file, it won't hide other warnings.
| fmt | The string for formatting. See fmt::format/stdformat for details. |
| args | Arguments to the format. See fmt::format/stdformat for details. |
| Args... | the remaining argument types. |
References drama::CreateRunDramaTask(), and drama::MessageHandler::MessageUser().