/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
static bool containsDirectory(const std::string &path);
static bool isAbsolute(const char *path);
static bool isAbsolute(const std::string &path);
- static bool startsWith(const std::string &path,
- const std::string &prefix);
+ static bool isEquivalent(const std::string &path1,
+ const std::string &path2);
static std::string join(const std::string &path1,
const std::string &path2);
static std::string normalize(const std::string &path);
static std::string getParentPath(const std::string &path);
static std::string getFilename(const std::string &path);
+ static bool hasExtension(const std::string &path);
static std::string stripExtension(const std::string &path);
static bool exists(const char *path);
Path();
};
+class File
+{
+ public:
+ /*! \brief
+ * Checks whether a file exists and is a regular file.
+ *
+ * \param[in] filename Path to the file to check.
+ * \returns `true` if \p filename exists and is accessible.
+ *
+ * Does not throw.
+ */
+ static bool exists(const char *filename);
+ //! \copydoc exists(const char *)
+ static bool exists(const std::string &filename);
+
+ private:
+ // Disallow instantiation.
+ File();
+};
class Directory
{