CppCommon
1.0.4.1
C++ Common Library
|
Source location. More...
#include <source_location.h>
Public Member Functions | |
SourceLocation (const char *filename, int line) noexcept | |
Create a new source location with the given file name and line number. More... | |
SourceLocation (const SourceLocation &) noexcept=default | |
SourceLocation (SourceLocation &&) noexcept=default | |
~SourceLocation () noexcept=default | |
SourceLocation & | operator= (const SourceLocation &) noexcept=default |
SourceLocation & | operator= (SourceLocation &&) noexcept=default |
const char * | filename () const noexcept |
Get file name. More... | |
int | line () const noexcept |
Get line number. More... | |
std::string | string () const |
Get the string from the current source location. More... | |
Friends | |
class | Exception |
std::ostream & | operator<< (std::ostream &os, const SourceLocation &source_location) |
Output source location into the given output stream. More... | |
Source location.
Source location wraps file name and line number into single object with easy-to-use interface.
Thread-safe.
Definition at line 31 of file source_location.h.
|
inlineexplicitnoexcept |
Create a new source location with the given file name and line number.
filename | - File name |
line | - Line number |
Definition at line 41 of file source_location.h.
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
Get file name.
Definition at line 50 of file source_location.h.
|
inlinenoexcept |
Get line number.
Definition at line 52 of file source_location.h.
|
defaultnoexcept |
|
defaultnoexcept |
|
inline |
Get the string from the current source location.
Definition at line 55 of file source_location.h.
|
friend |
Definition at line 33 of file source_location.h.
|
friend |
Output source location into the given output stream.
Definition at line 11 of file source_location.inl.