cuDDL
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cuddl::SourceLocation Struct Reference

File, line, and column for a C++ call site or FASTX input position. More...

#include <error.hpp>

Public Member Functions

std::string to_string () const
 

Static Public Member Functions

static SourceLocation from (std::source_location location)
 

Public Attributes

std::string file
 
uint32_t line {}
 
uint32_t column {}
 

Detailed Description

File, line, and column for a C++ call site or FASTX input position.

Definition at line 21 of file error.hpp.

Member Function Documentation

◆ from()

static SourceLocation cuddl::SourceLocation::from ( std::source_location  location)
inlinestatic

Definition at line 26 of file error.hpp.

26 {
27 return SourceLocation{
28 location.file_name(),
29 static_cast<uint32_t>(location.line()),
30 static_cast<uint32_t>(location.column()),
31 };
32 }
Here is the caller graph for this function:

◆ to_string()

std::string cuddl::SourceLocation::to_string ( ) const
inline

Definition at line 34 of file error.hpp.

34 {
35 return std::format("{}:{}:{}", file, line, column);
36 }
std::string file
Definition error.hpp:22

Member Data Documentation

◆ column

uint32_t cuddl::SourceLocation::column {}

Definition at line 24 of file error.hpp.

24{};

◆ file

std::string cuddl::SourceLocation::file

Definition at line 22 of file error.hpp.

◆ line

uint32_t cuddl::SourceLocation::line {}

Definition at line 23 of file error.hpp.

23{};

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