Change PBD::sys::path_is_within to take string params and use Glib
git-svn-id: svn://localhost/ardour2/branches/3.0@12859 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1d3594cc9b
commit
fb76229f7b
@ -235,15 +235,15 @@ equivalent_paths (const std::string& a, const std::string& b)
|
||||
* @return true if it is.
|
||||
*/
|
||||
bool
|
||||
path_is_within (path const & haystack, path needle)
|
||||
path_is_within (std::string const & haystack, std::string needle)
|
||||
{
|
||||
while (1) {
|
||||
if (equivalent_paths (haystack.to_string(), needle.to_string())) {
|
||||
if (equivalent_paths (haystack, needle)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
needle = needle.branch_path ();
|
||||
if (needle.to_string().empty() || needle.to_string() == "/") {
|
||||
needle = Glib::path_get_dirname (needle);
|
||||
if (needle == "." || needle == "/") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ std::string extension (const path& p);
|
||||
|
||||
path get_absolute_path (const path &);
|
||||
|
||||
bool path_is_within (const path &, path);
|
||||
bool path_is_within (const std::string &, std::string);
|
||||
|
||||
/**
|
||||
* @return true if p1 and p2 both resolve to the same file
|
||||
|
Loading…
Reference in New Issue
Block a user