18#ifndef _SDF_FILESYSTEM_HH_
19#define _SDF_FILESYSTEM_HH_
30#pragma warning(disable: 4251)
41 bool exists(
const std::string &_path);
70 template<
typename... Args>
71 std::string
append(Args
const &... args)
76 static_cast<void>(unpack);
77 return result.substr(0, result.length() - 1);
89 std::string
basename(
const std::string &_path);
100 public:
explicit DirIter(
const std::string &_in);
123 private:
void next();
126 private:
void set_internal_empty();
129 private:
void close_handle();
132 private: std::unique_ptr<DirIterPrivate> dataPtr;
DirIter(const std::string &_in)
Constructor.
bool operator!=(const DirIter &_other) const
Comparison operator to see if this iterator is at the same point as another iterator.
const DirIter & operator++()
Pre-increment operator; moves to next directory record.
std::string operator*() const
Dereference operator; returns current directory record.
DirIter()
Constructor for end element.
Definition Filesystem.hh:36
SDFORMAT_VISIBLE std::string basename(const std::string &_path)
Given a path, get just the basename portion.
SDFORMAT_VISIBLE std::string const separator(std::string const &_s)
Append the preferred path separator character for this platform onto the passed-in string.
std::string append(Args const &... args)
Append one or more additional path elements to the first passed in argument.
Definition Filesystem.hh:71
SDFORMAT_VISIBLE std::string current_path()
Get the current working path.
SDFORMAT_VISIBLE bool create_directory(const std::string &_path)
Create a new directory on the filesystem.
SDFORMAT_VISIBLE bool is_directory(const std::string &_path)
Determine whether the given path is a directory.
SDFORMAT_VISIBLE bool exists(const std::string &_path)
Determine whether the given path exists on the filesystem.
namespace for Simulation Description Format parser
Definition Console.hh:36
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48