//
static PathCompList_t&
-s_PathMakeCanonical(PathCompList_t& CList, char separator, bool is_absolute)
+s_PathMakeCanonical(PathCompList_t& CList, bool is_absolute)
{
PathCompList_t::iterator ci, ri; // component and removal iterators
{
PathCompList_t CList;
bool is_absolute = PathIsAbsolute(Path, separator);
- s_PathMakeCanonical(PathToComponents(Path, CList, separator), separator, is_absolute);
+ s_PathMakeCanonical(PathToComponents(Path, CList, separator), is_absolute);
if ( is_absolute )
return ComponentsToAbsolutePath(CList, separator);
}
PathCompList_t CList;
- CList.push_back(cwd_buf);
+ PathToComponents(cwd_buf, CList);
CList.push_back(Path);
- return ComponentsToAbsolutePath(s_PathMakeCanonical(CList, separator, true), separator);
+ return ComponentsToAbsolutePath(s_PathMakeCanonical(CList, true), separator);
}
//
return Basename + "." + Extension;
}
+//
+std::string
+Kumu::PathJoin(const std::string& Path1, const std::string& Path2, char separator)
+{
+ return Path1 + separator + Path2;
+}
+
+//
+std::string
+Kumu::PathJoin(const std::string& Path1, const std::string& Path2, const std::string& Path3, char separator)
+{
+ return Path1 + separator + Path2 + separator + Path3;
+}
+
+//
+std::string
+Kumu::PathJoin(const std::string& Path1, const std::string& Path2,
+ const std::string& Path3, const std::string& Path4, char separator)
+{
+ return Path1 + separator + Path2 + separator + Path3 + separator + Path4;
+}
+
//
Kumu::PathList_t&
Kumu::FindInPaths(const IPathMatch& Pattern, const Kumu::PathList_t& SearchPaths,
Kumu::CreateDirectoriesInPath(const std::string& Path)
{
bool abs = PathIsAbsolute(Path);
- assert(abs);
PathCompList_t PathComps, TmpPathComps;
PathToComponents(Path, PathComps);
Result_t
h__DeletePath(const std::string& pathname)
{
- fprintf(stderr, "h__DeletePath %s\n", pathname.c_str());
+ if ( pathname.empty() )
+ return RESULT_NULL_STR;
+
Result_t result = RESULT_OK;
if ( ! PathIsDirectory(pathname) )