Commit bc6ae064 authored by Brad King's avatar Brad King 💬
Browse files

ERR: Replaced std::string with kwsys_stl::string for portability.

parent b221d046
......@@ -2010,15 +2010,15 @@ bool SystemTools::SetPermissions(const char* file, mode_t mode)
return true;
}
std::string SystemTools::GetParentDirectory(const char* fileOrDir)
kwsys_stl::string SystemTools::GetParentDirectory(const char* fileOrDir)
{
if ( !fileOrDir || !*fileOrDir )
{
return "";
}
std::string res = fileOrDir;
kwsys_stl::string res = fileOrDir;
SystemTools::ConvertToUnixSlashes(res);
std::string::size_type cc = res.size()-1;
kwsys_stl::string::size_type cc = res.size()-1;
if ( res[cc] == '/' )
{
cc --;
......@@ -2035,10 +2035,10 @@ std::string SystemTools::GetParentDirectory(const char* fileOrDir)
bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir)
{
std::string subdir = cSubdir;
std::string dir = cDir;
kwsys_stl::string subdir = cSubdir;
kwsys_stl::string dir = cDir;
SystemTools::ConvertToUnixSlashes(dir);
std::string path = subdir;
kwsys_stl::string path = subdir;
do
{
path = SystemTools::GetParentDirectory(path.c_str());
......
......@@ -317,7 +317,7 @@ public:
static bool SetPermissions(const char* file, mode_t mode);
/** Get the parent directory of the directory or file */
static std::string GetParentDirectory(const char* fileOrDir);
static kwsys_stl::string GetParentDirectory(const char* fileOrDir);
/** Check if the given file or directory is in subdirectory of dir */
static bool IsSubDirectory(const char* fileOrDir, const char* dir);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment