Skip to content

Commit

Permalink
changed: Add option to not add the path with ChangeBasePath
Browse files Browse the repository at this point in the history
  • Loading branch information
arnova committed Feb 3, 2015
1 parent 67971bd commit 183b945
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions xbmc/utils/URIUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ std::string URLDecodePath(const std::string& strPath)
return StringUtils::Join(segments, "/");
}

std::string URIUtils::ChangeBasePath(const std::string &fromPath, const std::string &fromFile, const std::string &toPath)
std::string URIUtils::ChangeBasePath(const std::string &fromPath, const std::string &fromFile, const std::string &toPath, const bool &bAddPath /* = true */)
{
std::string toFile = fromFile;

Expand All @@ -443,7 +443,10 @@ std::string URIUtils::ChangeBasePath(const std::string &fromPath, const std::str
if (!IsDOSPath(fromPath) && IsDOSPath(toPath))
StringUtils::Replace(toFile, "/", "\\");

return AddFileToFolder(toPath, toFile);
if (bAddPath)
return AddFileToFolder(toPath, toFile);

return toFile;
}

CURL URIUtils::SubstitutePath(const CURL& url, bool reverse /* = false */)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/URIUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class URIUtils
\param toPath the base path of the resulting URL
\return the full path.
*/
static std::string ChangeBasePath(const std::string &fromPath, const std::string &fromFile, const std::string &toPath);
static std::string ChangeBasePath(const std::string &fromPath, const std::string &fromFile, const std::string &toPath, const bool &bAddPath = true);

static CURL SubstitutePath(const CURL& url, bool reverse = false);
static CStdString SubstitutePath(const CStdString& strPath, bool reverse = false);
Expand Down

0 comments on commit 183b945

Please sign in to comment.