Bifrost SDK
Bifrost SDK documentation
Amino::MessageText Class Referencefinal

The text content from which to construct a message (with optional formatting specifiers). More...

#include <Message.h>

Public Member Functions

constexpr MessageText (StringLiteral literal) noexcept
 Constructor from a string literal. More...
 
StringView getFormat () const &
 Get the format string. More...
 

Detailed Description

The text content from which to construct a message (with optional formatting specifiers).

The MessageText can contain format specifiers that will be replaced with the given format arguments when the Message is constructed.

The format specifiers are similar to the ones used in std::format. They use curly braces {} to specify where to insert the format arguments. For example:

// The message will contain "Hello, World!".
MessageText text{"Hello, {}!"_asv};
Message msg{source, MessageKind::eInfo, cls, text, "World"};
// Or alternatively, with zero-based indexed formatting:
MessageText text{"Hello, {0}!"_asv};
Message msg{source, MessageKind::eInfo, cls, text, "World"};
The text content from which to construct a message (with optional formatting specifiers).
Definition: Message.h:135
constexpr MessageText(StringLiteral literal) noexcept
Constructor from a string literal.
Definition: Message.h:139
A Message object that of a specific MessageKind, optional MessageClass, and a MessageText that relate...
Definition: Message.h:170

Definition at line 135 of file Message.h.

Constructor & Destructor Documentation

◆ MessageText()

constexpr Amino::MessageText::MessageText ( StringLiteral  literal)
inlineconstexprnoexcept

Constructor from a string literal.

Definition at line 139 of file Message.h.

Member Function Documentation

◆ getFormat()

StringView Amino::MessageText::getFormat ( ) const &
inline

Get the format string.

Definition at line 143 of file Message.h.