Shiokaze Framework
A research-oriented fluid solver for computer graphics
filesystem Class Reference

Class that perform file system related tasks. More...

#include <filesystem.h>

Static Public Member Functions

static bool is_exist (std::string path)
 Check if the file to a path exists. More...
 
static bool has_parent (std::string path)
 Check if a path contains a parent directory. More...
 
static std::string parent_path (std::string path)
 Get the path to the parent directory. More...
 
static bool has_root (std::string path)
 Check if a path contains a root path. More...
 
static bool create_directory (std::string path)
 Create directory to a path. More...
 
static bool create_directories (std::string path)
 Recursively create directory to a path. More...
 
static void rename (std::string old_path, std::string new_path)
 Rename the path (equivalently moving a file/directory) More...
 
static void remove_file (std::string path)
 Delete the file to a path. More...
 
static void remove_dir_contents (std::string path)
 Delete all the files in a directory. More...
 
static std::string find_resource_path (std::string directory, std::string name)
 Get a file path in the resource directory. More...
 
static std::string resolve_libname (std::string name)
 Get a file path in the dynamic library directory. More...
 

Detailed Description

Class that perform file system related tasks.

Member Function Documentation

◆ create_directories()

static bool filesystem::create_directories ( std::string  path)
static

Recursively create directory to a path.

Returns
true if successful false otherwise.

◆ create_directory()

static bool filesystem::create_directory ( std::string  path)
static

Create directory to a path.

Returns
true if successful false otherwise.

◆ find_resource_path()

static std::string filesystem::find_resource_path ( std::string  directory,
std::string  name 
)
static

Get a file path in the resource directory.

Parameters
[in]directoryName of the directory
[in]nameName of the file.

◆ has_parent()

static bool filesystem::has_parent ( std::string  path)
static

Check if a path contains a parent directory.

Parameters
[in]pathPath to check.
Returns
true if exists false otherwise.

◆ has_root()

static bool filesystem::has_root ( std::string  path)
static

Check if a path contains a root path.

Parameters
[in]pathPath to check.
Returns
true if exists false otherwise.

◆ is_exist()

static bool filesystem::is_exist ( std::string  path)
static

Check if the file to a path exists.

Parameters
[in]pathPath to check.
Returns
true if exists false otherwise.

◆ parent_path()

static std::string filesystem::parent_path ( std::string  path)
static

Get the path to the parent directory.

Parameters
[in]pathFull path.
Returns
Path to the parent directory.

◆ remove_dir_contents()

static void filesystem::remove_dir_contents ( std::string  path)
static

Delete all the files in a directory.

Parameters
[in]pathPath to the directory.

◆ remove_file()

static void filesystem::remove_file ( std::string  path)
static

Delete the file to a path.

Parameters
[in]pathPath to the file to delete.

◆ rename()

static void filesystem::rename ( std::string  old_path,
std::string  new_path 
)
static

Rename the path (equivalently moving a file/directory)

Parameters
[in]old_pathOld path.
[in]new_pathNew path.

◆ resolve_libname()

static std::string filesystem::resolve_libname ( std::string  name)
static

Get a file path in the dynamic library directory.

Parameters
[in]nameName of the dynamic library without "lib" prefix and ".so" suffix.

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