More tweaks.

git-svn-id: svn://10.0.0.236/trunk@16224 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mcmullen%netscape.com
1998-12-11 03:17:47 +00:00
parent 004db7d894
commit e0be47d98f
6 changed files with 38 additions and 26 deletions

View File

@@ -111,21 +111,23 @@
#endif
#ifdef NS_USING_NAMESPACE
#define NS_NAMESPACE_PROTOTYPE
#define NS_NAMESPACE namespace
#define NS_NAMESPACE_END
#include <ostream>
using std::ostream;
#else
#define NS_NAMESPACE_PROTOTYPE static
#define NS_NAMESPACE struct
#define NS_NAMESPACE_END ;
#include <ostream.h>
#endif
//=========================== End Compiler-specific macros ===============================
#include "nsDebug.h"
#ifdef XP_MAC
#include <Files.h>
#endif

View File

@@ -21,13 +21,14 @@
#include "prtypes.h"
#ifdef NS_USING_NAMESPACE
#include <ostream>
#include <strstream>
#include <string>
#else
#include <ostream.h>
#include <strstream.h>
#include <string.h>
#endif
#ifdef NS_USING_NAMESPACE
@@ -35,6 +36,9 @@
using std::ostrstream;
#endif
#include <string.h>
#include "nsDebug.h"
//========================================================================================
NS_NAMESPACE nsFileSpecHelpers
//========================================================================================
@@ -132,10 +136,10 @@ char* nsFileSpecHelpers::GetLeaf(const char* inPath, char inSeparator)
} // nsNativeFileSpec::GetLeaf
#ifdef XP_MAC
#include "nsFileSpecMac.cpp" // Macintosh-specific implementations
#elif defined(XP_PC)
#if defined(XP_PC)
#include "nsFileSpecWin.cpp" // Windows-specific implementations
#elif defined(XP_MAC)
#include "nsFileSpecMac.cpp" // Macintosh-specific implementations
#elif defined(XP_UNIX)
#include "nsFileSpecUnix.cpp" // Unix-specific implementations
#endif
@@ -414,7 +418,7 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath)
//----------------------------------------------------------------------------------------
nsNativeFileSpec::nsNativeFileSpec(const nsNativeFileSpec& inSpec)
//----------------------------------------------------------------------------------------
: mPath(nsFileSpecHelpers::StringDup((const char*)inSpec))
: mPath(nsFileSpecHelpers::StringDup(inSpec.mPath))
{
}
#endif //XP_UNIX

View File

@@ -32,8 +32,8 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath)
//----------------------------------------------------------------------------------------
{
// Convert '/' to '\'
nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath);
for (const char* cp = mPath; *cp; cp++)
nsFileSpecHelpers::StringAssign(mPath, (const char*)mPath);
for (char* cp = mPath; *cp; cp++)
{
if (*cp == '/')
*cp = '\\';
@@ -54,7 +54,7 @@ void nsFilePath::operator = (const nsNativeFileSpec& inSpec)
{
// Convert '\' to '/'
nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath);
for (const char* cp = mPath; *cp; cp++)
for (char* cp = mPath; *cp; cp++)
{
if (*cp == '\\')
*cp = '/';
@@ -69,7 +69,7 @@ void nsNativeFileSpec::SetLeafName(const char* inLeafName)
} // nsNativeFileSpec::SetLeafName
//----------------------------------------------------------------------------------------
const char* nsNativeFileSpec::GetLeafName() const
char* nsNativeFileSpec::GetLeafName() const
//----------------------------------------------------------------------------------------
{
return nsFileSpecHelpers::GetLeaf(mPath, '\\');

View File

@@ -21,13 +21,14 @@
#include "prtypes.h"
#ifdef NS_USING_NAMESPACE
#include <ostream>
#include <strstream>
#include <string>
#else
#include <ostream.h>
#include <strstream.h>
#include <string.h>
#endif
#ifdef NS_USING_NAMESPACE
@@ -35,6 +36,9 @@
using std::ostrstream;
#endif
#include <string.h>
#include "nsDebug.h"
//========================================================================================
NS_NAMESPACE nsFileSpecHelpers
//========================================================================================
@@ -132,10 +136,10 @@ char* nsFileSpecHelpers::GetLeaf(const char* inPath, char inSeparator)
} // nsNativeFileSpec::GetLeaf
#ifdef XP_MAC
#include "nsFileSpecMac.cpp" // Macintosh-specific implementations
#elif defined(XP_PC)
#if defined(XP_PC)
#include "nsFileSpecWin.cpp" // Windows-specific implementations
#elif defined(XP_MAC)
#include "nsFileSpecMac.cpp" // Macintosh-specific implementations
#elif defined(XP_UNIX)
#include "nsFileSpecUnix.cpp" // Unix-specific implementations
#endif
@@ -414,7 +418,7 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath)
//----------------------------------------------------------------------------------------
nsNativeFileSpec::nsNativeFileSpec(const nsNativeFileSpec& inSpec)
//----------------------------------------------------------------------------------------
: mPath(nsFileSpecHelpers::StringDup((const char*)inSpec))
: mPath(nsFileSpecHelpers::StringDup(inSpec.mPath))
{
}
#endif //XP_UNIX

View File

@@ -111,21 +111,23 @@
#endif
#ifdef NS_USING_NAMESPACE
#define NS_NAMESPACE_PROTOTYPE
#define NS_NAMESPACE namespace
#define NS_NAMESPACE_END
#include <ostream>
using std::ostream;
#else
#define NS_NAMESPACE_PROTOTYPE static
#define NS_NAMESPACE struct
#define NS_NAMESPACE_END ;
#include <ostream.h>
#endif
//=========================== End Compiler-specific macros ===============================
#include "nsDebug.h"
#ifdef XP_MAC
#include <Files.h>
#endif

View File

@@ -32,8 +32,8 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath)
//----------------------------------------------------------------------------------------
{
// Convert '/' to '\'
nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath);
for (const char* cp = mPath; *cp; cp++)
nsFileSpecHelpers::StringAssign(mPath, (const char*)mPath);
for (char* cp = mPath; *cp; cp++)
{
if (*cp == '/')
*cp = '\\';
@@ -54,7 +54,7 @@ void nsFilePath::operator = (const nsNativeFileSpec& inSpec)
{
// Convert '\' to '/'
nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath);
for (const char* cp = mPath; *cp; cp++)
for (char* cp = mPath; *cp; cp++)
{
if (*cp == '\\')
*cp = '/';
@@ -69,7 +69,7 @@ void nsNativeFileSpec::SetLeafName(const char* inLeafName)
} // nsNativeFileSpec::SetLeafName
//----------------------------------------------------------------------------------------
const char* nsNativeFileSpec::GetLeafName() const
char* nsNativeFileSpec::GetLeafName() const
//----------------------------------------------------------------------------------------
{
return nsFileSpecHelpers::GetLeaf(mPath, '\\');