Loading...
Searching...
No Matches
Classes | Functions
sdf::v12::filesystem Namespace Reference

Classes

class  DirIter
 A class for iterating over all items in a directory. More...
 

Functions

template<typename... Args>
std::string append (Args const &... args)
 Append one or more additional path elements to the first passed in argument.
 
std::string basename (const std::string &_path)
 Given a path, get just the basename portion.
 
bool create_directory (const std::string &_path)
 Create a new directory on the filesystem.
 
std::string current_path ()
 Get the current working path.
 
bool exists (const std::string &_path)
 Determine whether the given path exists on the filesystem.
 
bool is_directory (const std::string &_path)
 Determine whether the given path is a directory.
 
std::string const separator (std::string const &_s)
 Append the preferred path separator character for this platform onto the passed-in string.
 

Function Documentation

◆ append()

template<typename... Args>
std::string sdf::v12::filesystem::append ( Args const &...  args)

Append one or more additional path elements to the first passed in argument.

Parameters
[in]argsThe paths to append together
Returns
A new string with the paths appended together.

References append(), and separator().

Referenced by append().

◆ basename()

std::string sdf::v12::filesystem::basename ( const std::string &  _path)

Given a path, get just the basename portion.

Parameters
[in]_pathThe full path.
Returns
A new string with just the basename portion of the path.

References basename().

Referenced by basename().

◆ create_directory()

bool sdf::v12::filesystem::create_directory ( const std::string &  _path)

Create a new directory on the filesystem.

Intermediate directories must already exist.

Parameters
[in]_pathThe new directory path to create
Returns
True if directory creation was successful, false otherwise.

References create_directory().

Referenced by create_directory().

◆ current_path()

std::string sdf::v12::filesystem::current_path ( )

Get the current working path.

Returns
Current working path if successful, the empty path on error.

References current_path().

Referenced by current_path().

◆ exists()

bool sdf::v12::filesystem::exists ( const std::string &  _path)

Determine whether the given path exists on the filesystem.

Parameters
[in]_pathThe path to check for existence
Returns
True if the path exists on the filesystem, false otherwise.

References exists().

Referenced by exists().

◆ is_directory()

bool sdf::v12::filesystem::is_directory ( const std::string &  _path)

Determine whether the given path is a directory.

Parameters
[in]_pathThe path to check
Returns
True if given path exists and is a directory, false otherwise.

References is_directory().

Referenced by is_directory().

◆ separator()

std::string const sdf::v12::filesystem::separator ( std::string const &  _s)

Append the preferred path separator character for this platform onto the passed-in string.

Parameters
[in]_sThe path to start with.
Returns
The original path with the platform path separator appended.

References separator().

Referenced by append(), and separator().