ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::format::FMTCallerInfo Struct Reference

Description:

This struct is used to format caller information provided with type lang::CallerInfo.

Besides using method Format "manually", instances of type CallerInfo may be passed as arguments to type FormatterPythonStyle using the according placeholder syntax. If done, internally an instance of this type is created and its Format method called.

Note
This is achieved by boxed function FFormat_CallerInfo, as explained in chapter 3. Formatting Custom Types of the Programmer's Manual of module ALib Format.

Definition at line 21 of file fmtcallerinfo.inl.

Collaboration diagram for alib::format::FMTCallerInfo:
[legend]

Public Field Index:

const lang::CallerInfoci
 The wrapped caller information.
 

Public Method Index:

ALIB_DLL AStringFormat (Substring format, AString &target, lang::CurrentData targetData=lang::CurrentData::Keep) const
 

Field Details:

◆ ci

const lang::CallerInfo& alib::format::FMTCallerInfo::ci

The wrapped caller information.

Definition at line 23 of file fmtcallerinfo.inl.

Method Details:

◆ Format()

ALIB_DLL AString & alib::format::FMTCallerInfo::Format ( Substring format,
AString & target,
lang::CurrentData targetData = lang::CurrentData::Keep ) const

Formats the wrapped caller information using a given pattern string. Within the pattern string, different symbols are interpreted as tokens.

Strings within the format text that should not be interpreted as tokens may be given in single quotes. Two consecutive single quotes will be replaced to one single quote.

The following tokens are supported:

Token
Description
sf Prints the source file name.
sl Prints the line number in the source file.
sm Prints the function or method name in the source file.
tn Prints the ALib tread name. If no thread is set, the string "<None>" is written, which is resourced with "FMTCINT".
ti Prints the ALib tread ID. If no thread is set, the string "<Null>" is written, which is resourced with "FMTCINR".
tc Prints the native tread ID of type std::thread::id in hexadecimal format. If no thread is set, this value is 0.
ta Prints a combination of 'tn', 'ti', and 'tc'.
yf Prints the full type name. If the CallerInfo does originate a static or global function, the string "<None>" is written, which is resourced with "FMTCINY".
(With release-builds, nothing is printed.)
yn Prints shortened type name, otherwise like 'yf'.
ya Like 'sm' but in case the CallerInfo originates from a non-static member function, the shortened type name and "::" are prepended.
(With release-builds, nothing is printed.)
Parameters
formatThe format pattern string.
targetA reference to an AString that gets the result of the format processing appended.
targetDataIf CurrentData::Keep (the default) the string is appended to target. if CurrentData::Clear, target is cleared.
Returns
target (for convenience).

The documentation for this struct was generated from the following file: