Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::SourceLocation Class Reference

A class representing the source location of the current code. More...

#include <SourceLocation.hpp>

Public Member Functions

constexpr SourceLocation (char const *file, std::size_t line)
 Construct a new Source Location object.
 
constexpr std::string_view file_name () const
 Get the file name.
 
constexpr std::size_t line () const
 Get the line number.
 

Detailed Description

A class representing the source location of the current code.

Note
This is a workaround for AppleClang that is lacking source_location atm. TODO: remove this class when all compilers catch up to c++20

Constructor & Destructor Documentation

◆ SourceLocation()

util::SourceLocation::SourceLocation ( char const * file,
std::size_t line )
inlineconstexpr

Construct a new Source Location object.

Parameters
fileThe file name
lineThe line number

Member Function Documentation

◆ file_name()

std::string_view util::SourceLocation::file_name ( ) const
inlineconstexpr

Get the file name.

Returns
The file name

◆ line()

std::size_t util::SourceLocation::line ( ) const
inlineconstexpr

Get the line number.

Returns
The line number

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