xtd 0.2.0
Loading...
Searching...
No Matches
source_location_invoked_directly.cpp

Shows how to use xtd::source_location class.

#include <xtd/io/path>
#include <xtd/console>
#include <xtd/diagnostics/source_location>
using namespace xtd;
using namespace xtd::diagnostics;
using namespace xtd::io;
void print_this_file_name() {
auto location = source_location::current();
console::write_line("File: {}", path::get_file_name(location.file_name()));
}
auto main() -> int {
print_this_file_name();
}
// This code can produce the following output :
//
// File: source_location_invoked_directly.cpp
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10