Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
SourceLocation Struct Reference

provide information about the source location More...

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

+ Collaboration diagram for SourceLocation:

Public Types

using srcloc = shambase::cxxstd::source_location
 

Public Member Functions

 SourceLocation (srcloc _loc=srcloc::current())
 
std::string format_multiline () const
 format the location in multiple lines
 
std::string format_multiline (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 :

provide information about the source location

Definition at line 30 of file SourceLocation.hpp.

Member Typedef Documentation

◆ srcloc

Definition at line 32 of file SourceLocation.hpp.

Constructor & Destructor Documentation

◆ SourceLocation()

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

Definition at line 36 of file SourceLocation.hpp.

Member Function Documentation

◆ format_multiline() [1/2]

std::string SourceLocation::format_multiline ( ) const

format the location in multiple lines

Returns
std::string the formated location

Definition at line 23 of file SourceLocation.cpp.

+ Here is the call graph for this function:

◆ format_multiline() [2/2]

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

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 32 of file SourceLocation.cpp.

◆ format_one_line()

std::string SourceLocation::format_one_line ( ) const

format the location in a one liner

Returns
std::string the formated location

Definition at line 42 of file SourceLocation.cpp.

◆ format_one_line_func()

std::string SourceLocation::format_one_line_func ( ) const

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

Returns
std::string the formated location

Definition at line 46 of file SourceLocation.cpp.

Member Data Documentation

◆ loc

srcloc SourceLocation::loc

Definition at line 34 of file SourceLocation.hpp.


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