Salome HOME
Get results from sub directories.
[tools/libbatch.git] / src / Core / Utils.hxx
index 561d014f78d995bc0e1101c084d476ed6754fb52..ed208125ea58825c20b722f3db8814af48882398 100644 (file)
@@ -48,6 +48,14 @@ public:
    */
   static bool isAbsolutePath(const std::string & path);
 
+  /**
+   * Returns the directory name of a path.
+   * "/a/b/file.txt" -> "/a/b"
+   * "a/file.txt" -> "a"
+   * "file.txt" -> "."
+   */
+  static std::string dirname(const std::string & path);
+
   /**
    * Create a temporary file and open an output stream to write into this file.
    * The file is created with the pattern "<tmpdir>/libbatch-<prefix>-XXXXXX" where <tmpdir> is the