Go to the documentation of this file.
18 #ifndef SDF_FILESYSTEM_HH_
19 #define SDF_FILESYSTEM_HH_
24 #include <sdf/sdf_config.h>
31 #pragma warning(disable: 4251)
37 inline namespace SDF_VERSION_NAMESPACE {
46 bool exists(
const std::string &_path);
69 std::string
const separator(std::string
const &_s);
75 template<
typename... Args>
76 std::string
append(Args
const &... args)
81 static_cast<void>(unpack);
82 return result.substr(0, result.length() - 1);
94 std::string
basename(
const std::string &_path);
105 public:
explicit DirIter(
const std::string &_in);
112 public: std::string operator*()
const;
116 public:
const DirIter& operator++();
122 public:
bool operator!=(
const DirIter &_other)
const;
128 private:
void next();
131 private:
void set_internal_empty();
134 private:
void close_handle();
137 private: std::unique_ptr<DirIterPrivate> dataPtr;
A class for iterating over all items in a directory.
Definition: Filesystem.hh:101
SDFORMAT_VISIBLE std::string current_path()
Get the current working path.
std::string append(Args const &... args)
Append one or more additional path elements to the first passed in argument.
Definition: Filesystem.hh:76
namespace for Simulation Description Format parser
Definition: Actor.hh:32
SDFORMAT_VISIBLE std::string basename(const std::string &_path)
Given a path, get just the basename portion.
#define SDFORMAT_VISIBLE
Definition: system_util.hh:48
SDFORMAT_VISIBLE bool create_directory(const std::string &_path)
Create a new directory on the filesystem.
SDFORMAT_VISIBLE const std::string separator(std::string const &_s)
Append the preferred path separator character for this platform onto the passed-in string.
SDFORMAT_VISIBLE bool exists(const std::string &_path)
Determine whether the given path exists on the filesystem.
SDFORMAT_VISIBLE bool is_directory(const std::string &_path)
Determine whether the given path is a directory.