ERR: Replaced std::string with kwsys_stl::string for portability.
This commit is contained in:
parent
b221d046a6
commit
bc6ae0649b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue