mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Implement path::join for initializer lists
This allows passing multiple path components to path::join
This commit is contained in:
@@ -178,6 +178,11 @@ namespace path
|
||||
return !path.empty() && path[0] == '/' ? normalize(path) : normalize(base + "/" + path);
|
||||
}
|
||||
|
||||
std::string join (std::initializer_list<std::string> const& components)
|
||||
{
|
||||
return normalize(text::join(components, "/"));
|
||||
}
|
||||
|
||||
bool is_absolute (std::string const& path)
|
||||
{
|
||||
if(!path.empty() && path[0] == '/')
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace path
|
||||
|
||||
PUBLIC std::string join (std::string const& base, std::string const& path); // this will normalize the (resulting) path
|
||||
|
||||
PUBLIC std::string join (std::initializer_list<std::string> const& components);
|
||||
|
||||
PUBLIC bool is_absolute (std::string const& path);
|
||||
PUBLIC bool is_child (std::string const& nonNormalizedChild, std::string const& nonNormalizedParent);
|
||||
PUBLIC std::string with_tilde (std::string const& path); // /Users/me/foo.html.erb → ~/foo.html.erb
|
||||
|
||||
Reference in New Issue
Block a user