Terrasync: make whitespace in pathnames work under windows
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user