Added Windoze support

git-svn-id: svn://10.0.0.236/trunk@16013 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
law%netscape.com
1998-12-09 01:04:53 +00:00
parent c78482348a
commit f434dd9914
10 changed files with 178 additions and 130 deletions

View File

@@ -41,17 +41,39 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath)
}
} // nsNativeFileSpec::operator =
//----------------------------------------------------------------------------------------
nsFilePath::nsFilePath(const nsNativeFileSpec& inSpec)
//----------------------------------------------------------------------------------------
{
// Convert '\' to '/'
std::string& str = (std::string&)inSpec;
for (std::string::size_type i = 0; i < str.length(); i++)
{
char c = str[i];
if (c == '\\')
c = '/';
mPath.append(&c, 1);
}
} // nsFilePath::nsFilePath
//----------------------------------------------------------------------------------------
void nsNativeFileSpec::SetLeafName(const std::string& inLeafName)
//----------------------------------------------------------------------------------------
{
nsFileHelpers::LeafReplace(mPath, '\\', inLeafName);
nsFileSpecHelpers::LeafReplace(mPath, '\\', inLeafName);
} // nsNativeFileSpec::SetLeafName
//----------------------------------------------------------------------------------------
std::string nsNativeFileSpec::GetLeafName() const
//----------------------------------------------------------------------------------------
{
return nsFileHelpers::GetLeaf(mPath, '\\');
return nsFileSpecHelpers::GetLeaf(mPath, '\\');
} // nsNativeFileSpec::GetLeafName
//----------------------------------------------------------------------------------------
bool nsNativeFileSpec::Exists() const
//----------------------------------------------------------------------------------------
{
return false; // fixme
} // nsNativeFileSpec::Exists