Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SourceLocation Struct Reference

provide information about the source location More...

#include <shambase/include/shambase/SourceLocation.hpp>

Public Types

using srcloc = std::source_location

Public Member Functions

constexpr SourceLocation (srcloc _loc=srcloc::current()) noexcept
std::string format_multiline () const
 format the location in multiple lines
std::string format_multiline (const std::string &stacktrace) const
 format the location in multiple lines with a given stacktrace
std::string format_one_line () const
 format the location in a one liner
std::string format_one_line_func () const
 format the location in a one liner with the function name displayed

Public Attributes

srcloc loc

Detailed Description

provide information about the source location

Example :

SourceLocation loc = SourceLocation{};

Definition at line 61 of file SourceLocation.hpp.

Member Typedef Documentation

◆ srcloc

using SourceLocation::srcloc = std::source_location

Definition at line 63 of file SourceLocation.hpp.

Constructor & Destructor Documentation

◆ SourceLocation()

SourceLocation::SourceLocation ( srcloc _loc = srcloc::current())
inlineexplicitconstexprnoexcept

Definition at line 67 of file SourceLocation.hpp.

Member Function Documentation

◆ format_multiline() [1/2]

std::string SourceLocation::format_multiline ( ) const
inline

format the location in multiple lines

Returns
std::string the formated location

Definition at line 75 of file SourceLocation.hpp.

Here is the call graph for this function:

◆ format_multiline() [2/2]

std::string SourceLocation::format_multiline ( const std::string & stacktrace) const
inline

format the location in multiple lines with a given stacktrace

Parameters
stacktracethe stacktrace to add to the location
Returns
std::string the formated location

Definition at line 83 of file SourceLocation.hpp.

Here is the call graph for this function:

◆ format_one_line()

std::string SourceLocation::format_one_line ( ) const
inline

format the location in a one liner

Returns
std::string the formated location

Definition at line 92 of file SourceLocation.hpp.

Here is the call graph for this function:

◆ format_one_line_func()

std::string SourceLocation::format_one_line_func ( ) const
inline

format the location in a one liner with the function name displayed

Returns
std::string the formated location

Definition at line 99 of file SourceLocation.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ loc

srcloc SourceLocation::loc

Definition at line 65 of file SourceLocation.hpp.


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