XBT
- Define class simgrid::xbt::Path to manage file names.
- Removed unused functions:
- - xbt/file.h: xbt_getline()
+ - xbt/file.h: xbt_dirname(), xbt_getline()
SimGrid (3.17) Released October 8 2017
/** @defgroup XBT_file File manipulation functions
* @ingroup XBT_misc
*
- * This module redefine some quite classical functions such as xbt_dirname() or xbt_basename() for the platforms
- * lacking them.
+ * This module redefine some quite classical functions such as xbt_basename() for the platforms lacking them.
* @{
*/
-/* Our own implementation of dirname, that does not exist on windows */
-XBT_PUBLIC(char *) xbt_dirname(const char *path);
+/* Our own implementation of basename, that does not exist on windows */
XBT_PUBLIC(char *) xbt_basename(const char *path);
/**@}*/
#include <cstring>
#include <libgen.h> /* POSIX dirname */
-/** @brief Returns the directory component of a path (reimplementation of POSIX dirname)
- *
- * The argument is never modified, and the returned value must be freed after use.
- */
-char *xbt_dirname(const char *path)
-{
- return xbt_strdup(simgrid::xbt::Path(path).getDirname().c_str());
-}
-
/** @brief Returns the file component of a path (reimplementation of POSIX basename)
*
* The argument is never modified, and the returned value must be freed after use.