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

Description:

This struct is used to format caller information provided with type 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 4.3. Formatting Custom Types of the Programmer's Manual of module ALib BaseCamp.

Definition at line 34 of file fmtcallerinfo.hpp.

#include <fmtcallerinfo.hpp>

Collaboration diagram for FMTCallerInfo:
[legend]

Public Field Index:

const lang::CallerInfoci
 The wrapped caller information.
 

Public Method Index:

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

Field Details:

◆ ci

const lang::CallerInfo& ci

The wrapped caller information.

Definition at line 36 of file fmtcallerinfo.hpp.

Method Details:

◆ Format()

AString & 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 generated with DbgTypeDemangler::GetShort, 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).

Definition at line 36 of file fmtcallerinfo.cpp.

Here is the call graph for this function:

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