Utopia  2
Framework for studying models of complex & adaptive systems.
Public Member Functions | Public Attributes | List of all members
Utopia::TestTools::LocationInfo Struct Reference

Bundles and handles file location information: file path and line number. More...

#include <utils.hh>

Public Member Functions

 LocationInfo ()=default
 Constructs a location object without information. More...
 
 LocationInfo (const std::size_t line, const std::string_view file_path)
 Constructs a location object from line and file path information. More...
 
std::string string () const
 A string representation of the location, using the fstr member. More...
 

Public Attributes

std::size_t line = 0
 Some line, e.g. as provided by LINE macro. More...
 
std::filesystem::path file_path = ""
 Some file path, e.g. as provided by FILE macro. More...
 
std::string_view fstr = "@ {file_name:}::{line:d} : "
 A fmt library format string. More...
 

Detailed Description

Bundles and handles file location information: file path and line number.

Constructor & Destructor Documentation

◆ LocationInfo() [1/2]

Utopia::TestTools::LocationInfo::LocationInfo ( )
default

Constructs a location object without information.

◆ LocationInfo() [2/2]

Utopia::TestTools::LocationInfo::LocationInfo ( const std::size_t  line,
const std::string_view  file_path 
)
inline

Constructs a location object from line and file path information.

Member Function Documentation

◆ string()

std::string Utopia::TestTools::LocationInfo::string ( ) const
inline

A string representation of the location, using the fstr member.

Will return an empty string if no location was specified.

Member Data Documentation

◆ file_path

std::filesystem::path Utopia::TestTools::LocationInfo::file_path = ""

Some file path, e.g. as provided by FILE macro.

◆ fstr

std::string_view Utopia::TestTools::LocationInfo::fstr = "@ {file_name:}::{line:d} : "

A fmt library format string.

Available keys: file_name, file_path, line

◆ line

std::size_t Utopia::TestTools::LocationInfo::line = 0

Some line, e.g. as provided by LINE macro.


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