The plssvm::source_location class represents certain information about the source code, such as file names, line numbers, or function names.
More...
#include <source_location.hpp>
|
| constexpr std::string_view | function_name () const noexcept |
| | Returns the absolute path name of the file or "unknown" if no information could be retrieved. More...
|
| |
| constexpr std::string_view | file_name () const noexcept |
| | Returns the function name without additional signature information (i.e. return type and parameters) or "unknown" if no information could be retrieved. More...
|
| |
| constexpr std::uint_least32_t | line () const noexcept |
| | Returns the line number or 0 if no information could be retrieved. More...
|
| |
| constexpr std::uint_least32_t | column () const noexcept |
| | Returns the column number. More...
|
| |
|
|
std::uint_least32_t | line_ { 0 } |
| | The line number as retrieved by __builtin_LINE().
|
| |
|
std::uint_least32_t | column_ { 0 } |
| | The column number (always 0).
|
| |
|
const char * | file_name_ { "unknown" } |
| | The file name as retrieved by __builtin_FILE().
|
| |
|
const char * | function_name_ { "unknown" } |
| | The function name as retrieved by __builtin_FUNCTION().
|
| |
The plssvm::source_location class represents certain information about the source code, such as file names, line numbers, or function names.
Based on std::source_location.
◆ current()
| static constexpr source_location plssvm::source_location::current |
( |
const char * |
file_name = __builtin_FILE(), |
|
|
const char * |
function_name = __builtin_FUNCTION(), |
|
|
int |
line = __builtin_LINE(), |
|
|
int |
column = 0 |
|
) |
| |
|
inlinestaticconstexprnoexcept |
Construct new source location information about the current call side.
- Parameters
-
| [in] | file_name | the file name including its absolute path, as given by __builtin_FILE() |
| [in] | function_name | the function name (without return type and parameters), as given by __builtin_FUNCTION() |
| [in] | line | the line number, as given by __builtin_LINE() |
| [in] | column | the column number, always 0 |
- Returns
- the source location object holding the information about the current call side (
[[nodiscard]])
◆ function_name()
| constexpr std::string_view plssvm::source_location::function_name |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the absolute path name of the file or "unknown" if no information could be retrieved.
- Returns
- the file name (
[[nodiscard]])
◆ file_name()
| constexpr std::string_view plssvm::source_location::file_name |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the function name without additional signature information (i.e. return type and parameters) or "unknown" if no information could be retrieved.
- Returns
- the function name (
[[nodiscard]])
◆ line()
| constexpr std::uint_least32_t plssvm::source_location::line |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the line number or 0 if no information could be retrieved.
- Returns
- the line number (
[[nodiscard]])
◆ column()
| constexpr std::uint_least32_t plssvm::source_location::column |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the column number.
- Attention
- Always
0!
- Returns
0 ([[nodiscard]])
The documentation for this class was generated from the following file: