14#ifndef OR_TOOLS_BASE_PATH_H_
15#define OR_TOOLS_BASE_PATH_H_
17#include <initializer_list>
21#include "absl/strings/string_view.h"
53 std::initializer_list<absl::string_view> paths);
82inline std::string
JoinPath() {
return std::string(); }
83inline std::string
JoinPath(absl::string_view path) {
84 return std::string(path.data(), path.size());
86std::string
JoinPath(absl::string_view path1, absl::string_view path2);
87template <
typename... T>
88inline std::string
JoinPath(absl::string_view path1, absl::string_view path2,
89 absl::string_view path3,
const T&... args) {
91 {path1, path2, path3, args...});
103template <
typename... T>
113std::string
AddSlash(absl::string_view path);
120absl::string_view
Dirname(absl::string_view path);
126std::pair<absl::string_view, absl::string_view>
SplitPath(
127 absl::string_view path);
134absl::string_view
Basename(absl::string_view path);
138absl::string_view
Stem(absl::string_view path);
142absl::string_view
Extension(absl::string_view path);
165std::string
CleanPath(absl::string_view path);
std::string JoinPathImpl(bool honor_abs, std::initializer_list< absl::string_view > paths)
Not part of the public API.
std::string AddSlash(absl::string_view path)
absl::string_view Extension(absl::string_view path)
std::string CleanPath(const absl::string_view unclean_path)
std::pair< absl::string_view, absl::string_view > SplitPath(absl::string_view path)
bool IsAbsolutePath(absl::string_view path)
Return true if path is absolute.
absl::string_view Stem(absl::string_view path)
absl::string_view Basename(absl::string_view path)
absl::string_view Dirname(absl::string_view path)
std::string CollapseSlashes(absl::string_view path)
std::string JoinPathRespectAbsolute(const T &... args)