13 namespace diagnostics {
74 bool operator==(
const stack_frame& sf)
const {
return file_name_ == sf.file_name_ && file_line_number_ == sf.file_line_number_ && method_name_ == sf.method_name_ && file_column_number_ == sf.file_column_number_ && offset_ == sf.offset_;}
75 bool operator!=(
const stack_frame& sf)
const {
return !operator==(sf);}
177 static constexpr const uint32_t
OFFSET_UNKNOWN = std::numeric_limits<uint32_t>::max();
181 static std::vector<stack_frame> get_stack_frames(
const xtd::ustring& str,
size_t skip_frames,
bool need_file_info);
184 uint32_t file_line_number_ = 0;
186 uint32_t file_column_number_ = 0;
201#define current_stack_frame_ \
202xtd::diagnostics::stack_frame {__FILE__, __LINE__, __func__}
213#define csf_ current_stack_frame_
215#define add_current_stack_frame_(...) \
216__VA_ARGS__ __VA_ARGS_COMMA__(__VA_ARGS__) current_stack_frame_
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:29
virtual const xtd::ustring & get_method() const
Gets the method in which the frame is executing.
stack_frame(size_t skip_frame)
Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame abo...
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 typi...
virtual const xtd::ustring & get_file_name() const
Gets the file name that contains the code that is executing. This information is typically extracted ...
stack_frame()
Initializes a new instance of the xtd::diagnostics::stack_frame class.
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 fi...
xtd::ustring to_string() const noexcept override
Builds a readable representation of the stack trace.
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 typica...
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 fi...
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 fi...
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 fi...
static stack_frame empty() noexcept
Return an empty stack frame.
static constexpr const uint32_t OFFSET_UNKNOWN
Defines the value that is returned from the get_offset() method when the offset is unknown....
Definition: stack_frame.h:177
stack_frame(bool need_file_info)
Initializes a new instance of the xtd::diagnostics::stack_frame class, optionally capturing source in...
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 abo...
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 fi...
virtual uint32_t get_offset() const
Gets the offset from the start of the code for the method that is being executed.
Represents a stack trace, which is an ordered collection of one or more stack frames.
Definition: stack_trace.h:32
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17