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

Definition

Contains file native API.

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

Protected Static Methods

static int32_t copy (const std::string &source_file, const std::string &target_file)
 Copy a specified source file to a target file.
 
static bool exists (const std::string &path)
 Check if specified file exist.
 
static size_t get_size (const std::string &path)
 Gets file size of specified path.
 
static int32_t move (const std::string &old_path, const std::string &new_path)
 Moves a file or a directory and its contents to a new location.
 
static int32_t remove (const std::string &file)
 Permanently deletes a speccified file.
 

Member Function Documentation

◆ copy()

static int32_t xtd::native::file::copy ( const std::string &  source_file,
const std::string &  target_file 
)
staticprotected

Copy a specified source file to a target file.

Parameters
source_fileThe source file to copy.
target_fileThe target file where copy.
Returns
0 if success; otherwise failed.
Warning
Internal use only

◆ exists()

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

Check if specified file exist.

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

◆ get_size()

static size_t xtd::native::file::get_size ( const std::string &  path)
staticprotected

Gets file size of specified path.

Parameters
pathThe relative or absolute path to the directory to get size.
Returns
The file size.
Warning
Internal use only

◆ move()

static int32_t xtd::native::file::move ( const std::string &  old_path,
const std::string &  new_path 
)
staticprotected

Moves a file or a directory and its contents to a new location.

Parameters
old_pathThe path of the file or directory to move.
new_pathThe path to the new location for old_path. If old_path is a file, then new_path must also be a file name.
Returns
0 if success; otherwise failed.
Warning
Internal use only

◆ remove()

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

Permanently deletes a speccified file.

Parameters
fileThe file name to delete.
Returns
0 if success; otherwise failed.
Warning
Internal use only

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