Terrasync: make whitespace in pathnames work under windows

This commit is contained in:
Torsten Dreyer
2011-06-25 00:04:44 +02:00
parent 204e483c08
commit d36170879c
3 changed files with 37 additions and 4 deletions
+17
View File
@@ -366,3 +366,20 @@ bool SGPath::isNull() const
{
return path.empty() || (path == "");
}
std::string SGPath::str_native() const
{
#ifdef _WIN32
std::string s = str();
std::string::size_type pos;
std::string nativeSeparator;
nativeSeparator = sgDirPathSepBad;
while( (pos=s.find( sgDirPathSep )) != std::string::npos ) {
s.replace( pos, 1, nativeSeparator );
}
return s;
#else
return str();
#endif
}
+5
View File
@@ -141,6 +141,11 @@ public:
*/
const char* c_str() const { return path.c_str(); }
/**
* Get the path string in OS native form
*/
std::string str_native() const;
/**
* Determine if file exists by attempting to fopen it.
* @return true if file exists, otherwise returns false.