xtd 0.2.0
Loading...
Searching...
No Matches
xtd::native::directory Class Referencefinal

Definition

Contains directory native API.

Namespace
xtd::native
Library
xtd.core.native
Warning
Internal use only

Classes

class  directory_iterator
 Represent directory iterator used by xtd::native::directory::enumerate_directories. More...
 
class  file_and_directory_iterator
 Represent file iterator used by xtd::native::directory::enumerate_files. More...
 
class  file_iterator
 Represent file iterator used by xtd::native::directory::enumerate_files. More...
 

Protected Static Methods

static int32_t create (const std::string &directory_name)
 Creates all directories and subdirectories in the specified path unless they already exist.
 
static directory_iterator enumerate_directories (const std::string &path, const std::string &pattern)
 Returns an enumerable collection of directory full names that match a search pattern in a specified path.
 
static file_iterator enumerate_files (const std::string &path, const std::string &pattern)
 Returns an iterator of full file names that match a search pattern in a specified path.
 
static file_and_directory_iterator enumerate_files_and_directories (const std::string &path, const std::string &pattern)
 Returns an iterator of full file names and full direcctory names that match a search pattern in a specified path.
 
static bool exists (const std::string &path)
 Check if specified directory exist.
 
static std::string get_current_directory ()
 Gets the current directory.
 
static int32_t remove (const std::string &directory_name)
 Deletes an empty directory from a specified path.
 
static int32_t set_current_directory (const std::string &directory_name)
 Sets the current directory.
 

Member Function Documentation

◆ create()

static int32_t xtd::native::directory::create ( const std::string &  directory_name)
staticprotected

Creates all directories and subdirectories in the specified path unless they already exist.

Parameters
directory_nameThe directory to create.
Returns
0 if success; otherwise failed.
Warning
Internal use only

◆ enumerate_directories()

static directory_iterator xtd::native::directory::enumerate_directories ( const std::string &  path,
const std::string &  pattern 
)
staticprotected

Returns an enumerable collection of directory full names that match a search pattern in a specified path.

Parameters
pathThe relative or absolute path to the directory to search.
patternThe search string to match against the names of directories in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.
Returns
An iterator of the full names (including paths) for the directories in the directory specified by path and that match the specified search pattern.
Warning
Internal use only

◆ enumerate_files()

static file_iterator xtd::native::directory::enumerate_files ( const std::string &  path,
const std::string &  pattern 
)
staticprotected

Returns an iterator of full file names that match a search pattern in a specified path.

Parameters
pathThe relative or absolute path to the directory to search.
patternThe search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.
Returns
An iterator of the full names (including paths) for the files in the directory specified by path and that match the specified search pattern.
Warning
Internal use only

◆ enumerate_files_and_directories()

static file_and_directory_iterator xtd::native::directory::enumerate_files_and_directories ( const std::string &  path,
const std::string &  pattern 
)
staticprotected

Returns an iterator of full file names and full direcctory names that match a search pattern in a specified path.

Parameters
pathThe relative or absolute path to the directory to search.
patternThe search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.
Returns
An iterator of the full names (including paths) for the files in the directory specified by path and that match the specified search pattern.
Warning
Internal use only

◆ exists()

static bool xtd::native::directory::exists ( const std::string &  path)
staticprotected

Check if specified directory exist.

Parameters
pathThe diretory path to check.
Returns
true is file exist; otherwise false.
Warning
Internal use only

◆ get_current_directory()

static std::string xtd::native::directory::get_current_directory ( )
staticprotected

Gets the current directory.

Returns
The currrent directory.
Remarks
On error the return value is an empty string ("").
Warning
Internal use only

◆ remove()

static int32_t xtd::native::directory::remove ( const std::string &  directory_name)
staticprotected

Deletes an empty directory from a specified path.

Parameters
directory_nameThe name of the empty directory to remove. This directory must be writable and empty.
Returns
0 if success; otherwise failed.
Warning
Internal use only

◆ set_current_directory()

static int32_t xtd::native::directory::set_current_directory ( const std::string &  directory_name)
staticprotected

Sets the current directory.

Parameters
dirrectory_nameThe currrent directory.
Returns
0 if success; -1 operation is not supported; otherwise failed.
Warning
Internal use only

The documentation for this class was generated from the following file: