v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::SourceLocation Class Referencefinal

#include <v8-source-location.h>

Collaboration diagram for v8::SourceLocation:

Public Member Functions

constexpr SourceLocation ()=default
 
constexpr const char * Function () const
 
constexpr const char * FileName () const
 
constexpr size_t Line () const
 
std::string ToString () const
 

Static Public Member Functions

static constexpr SourceLocation Current ()
 

Private Member Functions

constexpr SourceLocation (const char *function, const char *file, size_t line)
 

Private Attributes

const char * function_ = nullptr
 
const char * file_ = nullptr
 
size_t line_ = 0u
 

Detailed Description

Encapsulates source location information. Mimics C++20's std::source_location.

Definition at line 31 of file v8-source-location.h.

Constructor & Destructor Documentation

◆ SourceLocation() [1/2]

v8::SourceLocation::SourceLocation ( )
constexprdefault

Constructs unspecified source location information.

◆ SourceLocation() [2/2]

v8::SourceLocation::SourceLocation ( const char * function,
const char * file,
size_t line )
inlineconstexprprivate

Definition at line 87 of file v8-source-location.h.

Member Function Documentation

◆ Current()

static constexpr SourceLocation v8::SourceLocation::Current ( )
inlinestaticconstexpr

Construct source location information corresponding to the location of the call site.

Definition at line 44 of file v8-source-location.h.

◆ FileName()

const char * v8::SourceLocation::FileName ( ) const
inlineconstexpr

Returns the name of the current source file represented by this object.

Returns
the file name as cstring.

Definition at line 65 of file v8-source-location.h.

Here is the caller graph for this function:

◆ Function()

const char * v8::SourceLocation::Function ( ) const
inlineconstexpr

Returns the name of the function associated with the position represented by this object, if any.

Returns
the function name as cstring.

Definition at line 58 of file v8-source-location.h.

◆ Line()

size_t v8::SourceLocation::Line ( ) const
inlineconstexpr

Returns the line number represented by this object.

Returns
the line number.

Definition at line 72 of file v8-source-location.h.

Here is the caller graph for this function:

◆ ToString()

std::string v8::SourceLocation::ToString ( ) const
inline

Returns a human-readable string representing this object.

Returns
a human-readable string representing source location information.

Definition at line 79 of file v8-source-location.h.

Here is the caller graph for this function:

Member Data Documentation

◆ file_

const char* v8::SourceLocation::file_ = nullptr
private

Definition at line 91 of file v8-source-location.h.

◆ function_

const char* v8::SourceLocation::function_ = nullptr
private

Definition at line 90 of file v8-source-location.h.

◆ line_

size_t v8::SourceLocation::line_ = 0u
private

Definition at line 92 of file v8-source-location.h.


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