All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | List of all members
openfluid::tools::Filesystem Class Reference

#include <tools/Filesystem.hpp>

Static Public Member Functions

static std::string filename (const std::string &Path)
 
static std::string basename (const std::string &Path)
 
static std::string dirname (const std::string &Path)
 
static std::string extension (const std::string &Path)
 
static std::string currentPath ()
 
static bool isDirectory (const std::string &Path)
 
static bool isFile (const std::string &Path)
 
static bool makeDirectory (const std::string &Path)
 
static bool removeDirectory (const std::string &Path)
 
static bool removeFile (const std::string &Path)
 
static bool copyFile (const std::string &SrcPath, const std::string &DestPath)
 
static bool copyDirectory (const std::string &SrcPath, const std::string &DestPath, const bool DontCopyDotDirs=false)
 

Member Function Documentation

static std::string openfluid::tools::Filesystem::basename ( const std::string &  Path)
static

Returns the complete base name of the file in the given path

name = openfluid::tools::Filesystem::basename("/tmp/archive.tar.gz")
// name = archive.tar
Parameters
[in]Paththe given path
Returns
the base name of the file
static bool openfluid::tools::Filesystem::copyDirectory ( const std::string &  SrcPath,
const std::string &  DestPath,
const bool  DontCopyDotDirs = false 
)
static

Recursively copies a directory from source to destination.

Parameters
[in]SrcPaththe source path
[in]DestPaththe destination path
[in]DontCopyDotDirsif set to true, it ignores the directories beginning with a dot ('.'). Default is false
Returns
true if the directory was successfully copied, false otherwise
static bool openfluid::tools::Filesystem::copyFile ( const std::string &  SrcPath,
const std::string &  DestPath 
)
static

Copies a file from source to destination.

Parameters
[in]SrcPaththe source path
[in]DestPaththe destination path
Returns
true if the file was successfully copied, false otherwise
static std::string openfluid::tools::Filesystem::currentPath ( )
static

Returns the current application path

Returns
the current path
static std::string openfluid::tools::Filesystem::dirname ( const std::string &  Path)
static

Returns the directory name (parent path) of the given path

name = openfluid::tools::Filesystem::dirname("/tmp/archive.tar.gz")
// name = /tmp
Parameters
[in]Paththe given path
Returns
the directory name
static std::string openfluid::tools::Filesystem::extension ( const std::string &  Path)
static

Returns the extension of the file of the given path

name = openfluid::tools::Filesystem::extension("/tmp/archive.tar.gz")
// name = gz
Parameters
[in]Paththe given path
Returns
the extension
static std::string openfluid::tools::Filesystem::filename ( const std::string &  Path)
static

Returns the name of the file in the given path

name = openfluid::tools::Filesystem::filename("/tmp/archive.tar.gz")
// name = archive.tar.gz
Parameters
[in]Paththe given path
Returns
the filename
static bool openfluid::tools::Filesystem::isDirectory ( const std::string &  Path)
static

Returns true if the given path is a directory

Parameters
[in]Paththe given path
Returns
true or false
static bool openfluid::tools::Filesystem::isFile ( const std::string &  Path)
static

Returns true if the given path is a file or a valid symbolic link

Parameters
[in]Paththe given path
Returns
true or false
static bool openfluid::tools::Filesystem::makeDirectory ( const std::string &  Path)
static

Creates the directory of the given path. It creates all parent directories necessary to create the directory. If the directory already exists, it does nothing.

Parameters
[in]Paththe given path
Returns
true if the directory was successfully created, false otherwise
static bool openfluid::tools::Filesystem::removeDirectory ( const std::string &  Path)
static

Removes the directory of the given path. It recursively deletes all contents of the directory.

Parameters
[in]Paththe given path
Returns
true if the directory was successfully deleted, false otherwise
static bool openfluid::tools::Filesystem::removeFile ( const std::string &  Path)
static

Removes the file of the given path.

Parameters
[in]Paththe given path
Returns
true if the file was successfully deleted, false otherwise

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