Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::file Namespace Reference

Namespaces

namespace  xml
 

Functions

bool canWrite (const std::filesystem::path &path)
 
std::string changeExtension (const std::string_view filePath, const std::string &targetExtension)
 
void copy (const std::string_view from, const std::string_view to, const bool overwrite)
 
void copyFolder (const std::string_view from, const std::string_view to, const bool recursive, const bool overwrite)
 
bool createDirectory (const std::string_view path)
 
bool exists (const std::string_view path)
 
bool isFile (const std::string_view path)
 
bool isDirectory (const std::string_view path)
 
std::string getExtensionFile (const std::string_view filePath, const bool includeDot)
 
std::string getFileName (const std::string_view filePath, const bool includeExtension)
 
std::string getFinalDirectoryName (const std::string_view path)
 
std::vector< std::string > getFolderFiles (const std::string &foldersPath, const bool recursively, const bool absolutePath)
 
iv::types::timestamp getLastModifiedTime (const std::string_view path)
 
std::string getParentDirectoryPath (const std::string_view path)
 
std::string makePath (const std::string_view dirOpt, const std::string_view fNameOpt, const std::string_view extOpt)
 
std::string escapePathForShell (const std::string_view path)
 
bool remove (const std::string_view path)
 
void rename (const std::string_view oldPath, const std::string_view newPath)
 

Function Documentation

◆ canWrite()

bool iv::file::canWrite ( const std::filesystem::path & path)

◆ changeExtension()

std::string iv::file::changeExtension ( const std::string_view filePath,
const std::string & targetExtension )

Change the extension of a file in the given path.

Parameters
filePathThe path of the file whose extension needs to be changed.
targetExtensionThe new extension to be applied to the file.
Returns
The path of the file with the new extension.

◆ copy()

void iv::file::copy ( const std::string_view from,
const std::string_view to,
const bool overwrite )

◆ copyFolder()

void iv::file::copyFolder ( const std::string_view from,
const std::string_view to,
const bool recursive,
const bool overwrite )

◆ createDirectory()

bool iv::file::createDirectory ( const std::string_view path)

◆ escapePathForShell()

std::string iv::file::escapePathForShell ( const std::string_view path)

◆ exists()

bool iv::file::exists ( const std::string_view path)

◆ getExtensionFile()

std::string iv::file::getExtensionFile ( const std::string_view filePath,
const bool includeDot )

◆ getFileName()

std::string iv::file::getFileName ( const std::string_view filePath,
const bool includeExtension )

This function extract the name of file from given path

Parameters
filePathPath of the file
includeExtensionIndicates whether to include the file extension in the returned name.
Returns
The file name extracted from the path.

◆ getFinalDirectoryName()

std::string iv::file::getFinalDirectoryName ( const std::string_view path)

This function extract the name of file from given path

Parameters
pathPath of the file
Returns
The file name extracted from the path.

◆ getFolderFiles()

std::vector< std::string > iv::file::getFolderFiles ( const std::string & foldersPath,
const bool recursively,
const bool absolutePath )

◆ getLastModifiedTime()

iv::types::timestamp iv::file::getLastModifiedTime ( const std::string_view path)

◆ getParentDirectoryPath()

std::string iv::file::getParentDirectoryPath ( const std::string_view path)

Given a path of a specified file, look after its parent directory

Parameters
pathPath of a file
Returns
It returns the parent directory of the file specified by path. If path is nullptr, an emptyNode string, or contains no '/' characters,then "." is returned

◆ isDirectory()

bool iv::file::isDirectory ( const std::string_view path)

◆ isFile()

bool iv::file::isFile ( const std::string_view path)

◆ makePath()

std::string iv::file::makePath ( const std::string_view dirOpt,
const std::string_view fNameOpt,
const std::string_view extOpt )

Create a path for a specified file

Parameters
dirOptDirectory where the file is found
fNameOptFile name
extOptFile extension
Returns
Complete Path based on input parameters

◆ remove()

bool iv::file::remove ( const std::string_view path)

◆ rename()

void iv::file::rename ( const std::string_view oldPath,
const std::string_view newPath )