2019-06-13 15:42:39 -05:00
|
|
|
#ifndef VTR_PATH_H
|
|
|
|
#define VTR_PATH_H
|
|
|
|
#include <string>
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
namespace vtr {
|
|
|
|
|
2020-01-03 17:14:42 -06:00
|
|
|
//Splits off the name and extension (including ".") of the specified filename
|
|
|
|
std::array<std::string, 2> split_ext(const std::string& filename);
|
2019-06-13 15:42:39 -05:00
|
|
|
|
2020-01-03 17:14:42 -06:00
|
|
|
//Returns the basename of path (i.e. the last filename component)
|
|
|
|
// For example, the path "/home/user/my_files/test.blif" -> "test.blif"
|
|
|
|
std::string basename(const std::string& path);
|
2019-06-13 15:42:39 -05:00
|
|
|
|
2020-01-03 17:14:42 -06:00
|
|
|
//Returns the dirname of path (i.e. everything except the last filename component)
|
|
|
|
// For example, the path "/home/user/my_files/test.blif" -> "/home/user/my_files/"
|
|
|
|
std::string dirname(const std::string& path);
|
2019-06-13 15:42:39 -05:00
|
|
|
|
2020-01-03 17:14:42 -06:00
|
|
|
//Returns the current working directory
|
|
|
|
std::string getcwd();
|
2019-06-13 15:42:39 -05:00
|
|
|
|
2020-01-03 17:14:42 -06:00
|
|
|
} // namespace vtr
|
2019-06-13 15:42:39 -05:00
|
|
|
#endif
|