xtd 0.2.0

◆ name()

xtd::string xtd::io::directory_info::name ( ) const
overridevirtual

Gets the name of this xtd::io::directory_info instance.

Returns
The directory name.
Examples
The following example displays the name of the current xtd::io::directory_info instance only.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::io;
class program {
public:
static auto main() {
directory_info dir(".");
string dir_name = dir.name();
console::write_line("directory_info name is {0}.", dir_name);
}
};
startup_(program::main);
Exposes instance methods for creating, moving, and enumerating through directories and subdirectories...
Definition directory_info.h:129
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:175
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.h:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Remarks
This xtd::io::directory_info::name property returns only the name of the directory, such as "Bin". To get the full path, such as "c:\public\Bin", use the xtd::io::directory_info::full_name property.
The xtd::io::directory_info::name property of a xtd::io::directory_info requires no permission (beyond the read permission to the directory necessary to construct the Exists) but can give out the directory name. If it is necessary to hand out a xtd::io::directory_info to a protected directory with a cryptographically secure name, create a dummy directory for the untrusted code's use.
For a list of common I/O tasks, see Common I/O Tasks.

Implements xtd::io::file_system_info.