About
Typically a Maxon API interface or a data type defines a "ToString()" function. This function returns a maxon::String describing the given object. Such a "ToString()" function accepts a maxon::FormatStatement argument that can contain additional information on how the object should be described.
Class
A maxon::FormatStatement object contains string stored under a given string identifier.
ToString
A "ToString()" function can read information from the given maxon::FormatStatement to define how it formats the returned maxon::String.
{
if (formatStatement)
{
}
if (longFormat)
result =
FormatString(
"Value A: @, Value B: @, Value C: @", _a, _b, _c);
else
return result;
}
Definition: string.h:1599
Bool IsEmpty() const
Definition: string.h:1698
Definition: string.h:1287
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:180
#define FormatString(...)
Definition: string.h:2275
maxon::String ToString(const Filename &val, const maxon::FormatStatement *formatStatement, maxon::Bool checkDatatype=false)
Usage
When calling a "ToString()" function the call can hand over a maxon::FormatStatement argument to modify the behaviour of the function.
For more information about the output syntax see Output Syntax.
- Note
- Not all "ToString()" functions do handle the maxon::FormatStatement argument. When a function does not handle the argument, a nullptr can be handed over.
FloatTriplet triplet;
triplet._a = 1.1;
triplet._b = 1.2;
triplet._c = 1.3;
const maxon::String longFormatString = triplet.ToString(&longFormat);
const maxon::String shortFormatString = triplet.ToString(&shortFormat);
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
#define iferr_return
Definition: resultbase.h:1531
Further Reading