Skip to content

Commit

Permalink
move xtd::source_location to xtd::diagnostics::source_location
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 18, 2024
1 parent 54b1978 commit 42775fd
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 39 deletions.
1 change: 0 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* [Parse](xtd.core.examples/parse/README.md) contains parse examples.
* [Processes](xtd.core.examples/processes/README.md) contains process examples.
* [Random](xtd.core.examples/random/README.md) contains random examples.
* [Source location](xtd.core.examples/source_location/README.md) contains source location examples.
* [Strings](xtd.core.examples/strings/README.md) contains strings examples.
* [Text](xtd.core.examples/text/README.md) contains text examples.
* [Threading](xtd.core.examples/threading/README.md) contains threading examples.
Expand Down
1 change: 0 additions & 1 deletion examples/xtd.core.examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ add_projects(
parse
processes
random
source_location
sprintf
startups
strings
Expand Down
5 changes: 1 addition & 4 deletions examples/xtd.core.examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
* [console_trace_listener](diagnostics/console_trace_listener/README.md) shows how to use [xtd::diagnostics::console_trace_listener](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1console__trace__listener.html) class.
* [debug](diagnostics/debug/README.md) shows how to use [xtd::diagnostics::debug](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1debug.html) class.
* [debug_cassert](diagnostics/debug_cassert/README.md) shows how to use [xtd::diagnostics::debug::cassert](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1debug.html#acdb0d00e4b12fccc037cf3f965110d72) method.
* [source_location_invoked_directly](diagnostics/source_location_invoked_directly/README.md) shows how to use [xtd::source_location](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1source__location.html) class.
* [stack_frame](diagnostics/stack_frame/README.md) shows how to use [xtd::diagnostics::stack_frame](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1stack__frame.html) class.
* [stack_trace](diagnostics/stack_trace/README.md) shows how to use [xtd::diagnostics::stack_trace](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1stack__trace.html) class.
* [stack_trace_simple](diagnostics/stack_trace_simple/README.md) demonstrates how to create a simple [xtd::diagnostics::stack_trace](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1stack__trace.html) class and iterate through its frames to obtain debugging and diagnostic information.
Expand Down Expand Up @@ -328,10 +329,6 @@
* [random2](random/random2/README.md) shows how to use [xtd::random](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1random.html) class.
* [random3](random/random3/README.md) shows how to use [xtd::random::next](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1random.html#aea69230c5fe2a5ecc5026aa568dc349c) method.

## [source_location](source_location/README.md)

* [source_location_invoked_directly](source_location/source_location_invoked_directly/README.md) shows how to use [xtd::source_location](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1source__location.html) class.

## [sprintf](sprintf/README.md)

* [sprintf](sprintf/sprintf/README.md) shows how to use [xtd::ustring::sprintf](https://gammasoft71.github.io/xtd/reference_guides/latest/group__sprintf__parse.html#ga0c65606fb81f84e4d9ea43002114d8de) method.
Expand Down
1 change: 1 addition & 0 deletions examples/xtd.core.examples/diagnostics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_projects(
debug
debug_cassert
default_trace_listener
source_location_invoked_directly
stack_frame
stack_trace
stack_trace_simple
Expand Down
1 change: 1 addition & 0 deletions examples/xtd.core.examples/diagnostics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [console_trace_listener](console_trace_listener/README.md) shows how to use [xtd::diagnostics::console_trace_listener](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1console__trace__listener.html) class.
* [debug](debug/README.md) shows how to use [xtd::diagnostics::debug](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1debug.html) class.
* [debug_cassert](debug_cassert/README.md) shows how to use [xtd::diagnostics::debug::cassert](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1debug.html#acdb0d00e4b12fccc037cf3f965110d72) method.
* [source_location_invoked_directly](source_location_invoked_directly/README.md) shows how to use [xtd::source_location](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1source__location.html) class.
* [stack_frame](stack_frame/README.md) shows how to use [xtd::diagnostics::stack_frame](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1stack__frame.html) class.
* [stack_trace](stack_trace/README.md) shows how to use [xtd::diagnostics::stack_trace](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1stack__trace.html) class.
* [stack_trace_simple](stack_trace_simple/README.md) demonstrates how to create a simple [xtd::diagnostics::stack_trace](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1diagnostics_1_1stack__trace.html) class and iterate through its frames to obtain debugging and diagnostic information.
Expand Down
9 changes: 0 additions & 9 deletions examples/xtd.core.examples/source_location/CMakeLists.txt

This file was deleted.

13 changes: 0 additions & 13 deletions examples/xtd.core.examples/source_location/README.md

This file was deleted.

6 changes: 3 additions & 3 deletions src/xtd.core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,6 @@ add_sources(
include/xtd/slong_object
include/xtd/software_termination_exception.h
include/xtd/software_termination_exception
include/xtd/source_location
include/xtd/source_location.h
include/xtd/sptr.h
include/xtd/sptr
include/xtd/startup.h
Expand Down Expand Up @@ -634,6 +632,8 @@ add_sources(
include/xtd/diagnostics/source_filter
include/xtd/diagnostics/source_levels.h
include/xtd/diagnostics/source_levels
include/xtd/diagnostics/source_location.h
include/xtd/diagnostics/source_location
include/xtd/diagnostics/source_switch.h
include/xtd/diagnostics/source_switch
include/xtd/diagnostics/stack_frame.h
Expand Down Expand Up @@ -1063,7 +1063,6 @@ add_sources(
src/xtd/processor.cpp
src/xtd/random.cpp
src/xtd/signal_cancel_event_args.cpp
src/xtd/source_location.cpp
src/xtd/startup.cpp
src/xtd/system_exception.cpp
src/xtd/target_type.cpp
Expand All @@ -1090,6 +1089,7 @@ add_sources(
src/xtd/diagnostics/process.cpp
src/xtd/diagnostics/process_start_info.cpp
src/xtd/diagnostics/source_filter.cpp
src/xtd/diagnostics/source_location.cpp
src/xtd/diagnostics/source_switch.cpp
src/xtd/diagnostics/stack_frame.cpp
src/xtd/diagnostics/stack_trace.cpp
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/// @copyright Copyright (c) 2024 Gammasoft. All rights reserved.
#pragma once
#define __XTD_CORE_INTERNAL__
#include "internal/__xtd_source_location.h"
#include "../internal/__xtd_source_location.h"
#undef __XTD_CORE_INTERNAL__
#include "object.h"
#include "ptr.h"
#include "size.h"
#include "../object.h"
#include "../ptr.h"
#include "../size.h"
/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
namespace xtd {
/// @brief The xtd::source_location class represents certain information about the source code, such as file names, line numbers, and function names. Previously, functions that desire to obtain this information about the call site (for logging, testing, or debugging purposes) must use macros so that [predefined macros](https://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros) like `__LINE__` and `__FILE__` are expanded in the context of the caller. The xtd::source_location class provides a better alternative.
Expand Down
2 changes: 1 addition & 1 deletion src/xtd.core/include/xtd/diagnostics/stack_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

#include <cstdint>
#include <vector>
#include "source_location.h"
#include "../core_export.h"
#include "../iequatable.h"
#include "../object.h"
#include "../ptr.h"
#include "../source_location.h"
#include "../size.h"
#define __XTD_CORE_INTERNAL__
#include "../internal/__string_definitions.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "../../include/xtd/source_location.h"
#include "../../include/xtd/string.h"
#include "../../../include/xtd/diagnostics/source_location.h"
#include "../../../include/xtd/string.h"

using namespace xtd;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include "unit_test_error.h"
#include <xtd/diagnostics/source_location>
#include <xtd/foreground_color>
#include <xtd/reset_color>
#include <xtd/source_location>
#include <iostream>
#include <sstream>
#include <string>
Expand Down

0 comments on commit 42775fd

Please sign in to comment.