Veethree D7 SDK
Loading...
Searching...
No Matches
vsdk::io::source_location Class Reference

Detailed Description

The source_location class.

This is a helper class to be used to pin point where the exception has been thrown.

In later C++ versions, there is a std::source_location available.

#include <libio_error.h>

Public Member Functions

 source_location (std::string file, int line, std::string func)
 The class constructor.
int line () const
 The source file line.
std::string function_name () const
 The source file function_name.
std::string file_name () const
 The source file name.

Static Public Member Functions

static source_location current (std::string file=__builtin_FILE(), int line=__builtin_LINE(), std::string func=__builtin_FUNCTION())
 Calling this function will gather all info about file, line and function.

Detailed Description

The source_location class.

This is a helper class to be used to pin point where the exception has been thrown.

In later C++ versions, there is a std::source_location available.

Constructor & Destructor Documentation

◆ source_location()

vsdk::io::source_location::source_location ( std::string file,
int line,
std::string func )

The class constructor.

Parameters
fileFilename where the exception happened
lineLine number where the exception happened
funcFunction where the exception happened

Member Function Documentation

◆ current()

source_location vsdk::io::source_location::current ( std::string file = __builtin_FILE(),
int line = __builtin_LINE(),
std::string func = __builtin_FUNCTION() )
static

Calling this function will gather all info about file, line and function.

Use this function with the default values!

Parameters
fileDefaults to the file where the function was called.
lineDefaults to the line where the function was called.
funcDefaults to the function where the function was called.
Returns
A source_location instance with file, line and function set.

◆ file_name()

std::string vsdk::io::source_location::file_name ( ) const

The source file name.

Returns
The file name

◆ function_name()

std::string vsdk::io::source_location::function_name ( ) const

The source file function_name.

Returns
The function name

◆ line()

int vsdk::io::source_location::line ( ) const

The source file line.

Returns
The line number

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