![]() |
xtd - Reference Guide
0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <stack_frame.h>
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the call stack for the current thread.
Inherits xtd::object.
Static Public Attributes | |
static constexpr const uint32_t | OFFSET_UNKNOWN |
Defines the value that is returned from the get_offset() method when the offset is unknown. This field is constant. | |
Public Member Functions | |
stack_frame () | |
Initializes a new instance of the xtd::diagnostics::stack_frame class. | |
stack_frame (bool need_file_info) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class, optionally capturing source information. | |
stack_frame (const xtd::ustring &file_name, uint32_t line_number) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, and line number. | |
stack_frame (const xtd::ustring &file_name, uint32_t line_number, const xtd::ustring &method_name) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and method name. | |
stack_frame (const xtd::ustring &file_name, uint32_t line_number, const xtd::ustring &method_name, uint32_t column_number) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and column number. | |
stack_frame (const xtd::ustring &file_name, uint32_t line_number, const xtd::ustring &method_name, uint32_t column_number, uint32_t offset) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, column number, method name, and offset. | |
stack_frame (const xtd::ustring &file_name, uint32_t line_number, uint32_t column_number) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and column number. | |
stack_frame (size_t skip_frame) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame above the current stack frame. | |
stack_frame (size_t skip_frame, bool need_file_info) | |
Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame above the current stack frame, optionally capturing source information. | |
virtual uint32_t | get_file_column_number () const |
Gets the column number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. | |
virtual uint32_t | get_file_line_number () const |
Gets the line number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. | |
virtual const xtd::ustring & | get_file_name () const |
Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. | |
virtual const xtd::ustring & | get_method () const |
Gets the method in which the frame is executing. | |
virtual uint32_t | get_offset () const |
Gets the offset from the start of the code for the method that is being executed. | |
xtd::ustring | to_string () const noexcept override |
Builds a readable representation of the stack trace. | |
![]() | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
template<typename object_t > | |
std::unique_ptr< object_t > | memberwise_clone () const |
Gets the type of the current instance. | |
virtual xtd::ustring | to_string () const noexcept |
Returns a std::string that represents the current object. | |
Static Public Member Functions | |
static stack_frame | empty () noexcept |
Return an empty stack frame. | |
![]() | |
static bool | equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
xtd::diagnostics::stack_frame::stack_frame | ( | ) |
Initializes a new instance of the xtd::diagnostics::stack_frame class.
|
explicit |
Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame above the current stack frame.
skip_frame | The number of frames up the stack to skip. |
|
explicit |
Initializes a new instance of the xtd::diagnostics::stack_frame class, optionally capturing source information.
need_file_info | true to capture the file name, line number, and column number of the stack frame; otherwise, false. |
xtd::diagnostics::stack_frame::stack_frame | ( | size_t | skip_frame, |
bool | need_file_info | ||
) |
Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame above the current stack frame, optionally capturing source information.
skip_frame | The number of frames up the stack to skip. |
need_file_info | true to capture the file name, line number, and column number of the stack frame; otherwise, false. |
xtd::diagnostics::stack_frame::stack_frame | ( | const xtd::ustring & | file_name, |
uint32_t | line_number | ||
) |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, and line number.
file_name | The file name. |
line_number | The line number in the specified file. |
xtd::diagnostics::stack_frame::stack_frame | ( | const xtd::ustring & | file_name, |
uint32_t | line_number, | ||
const xtd::ustring & | method_name | ||
) |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and method name.
file_name | The file name. |
line_number | The line number in the specified file. |
method_name | The method name. |
xtd::diagnostics::stack_frame::stack_frame | ( | const xtd::ustring & | file_name, |
uint32_t | line_number, | ||
const xtd::ustring & | method_name, | ||
uint32_t | column_number | ||
) |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and column number.
file_name | The file name. |
line_number | The line number in the specified file. |
method_name | The method name. |
offset | The offset from the code for the method that is being executed. |
xtd::diagnostics::stack_frame::stack_frame | ( | const xtd::ustring & | file_name, |
uint32_t | line_number, | ||
uint32_t | column_number | ||
) |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and column number.
file_name | The file name. |
line_number | The line number in the specified file. |
method_name | The method name. |
column_number | The column number in the specified file. |
xtd::diagnostics::stack_frame::stack_frame | ( | const xtd::ustring & | file_name, |
uint32_t | line_number, | ||
const xtd::ustring & | method_name, | ||
uint32_t | column_number, | ||
uint32_t | offset | ||
) |
Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, column number, method name, and offset.
file_name | The file name. |
line_number | The line number in the specified file. |
method_name | The method name. |
offset | The offset from the code for the method that is being executed. |
|
staticnoexcept |
Return an empty stack frame.
|
virtual |
Gets the column number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.
|
virtual |
Gets the line number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.
|
virtual |
Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.
|
virtual |
Gets the method in which the frame is executing.
|
virtual |
Gets the offset from the start of the code for the method that is being executed.
|
overridevirtualnoexcept |
Builds a readable representation of the stack trace.
Reimplemented from xtd::object.
|
staticconstexpr |
Defines the value that is returned from the get_offset() method when the offset is unknown. This field is constant.