зеркало из https://github.com/mozilla/pjs.git
Now using PL_* functions in nsprPath()
ifdef'ing the deallocation of nsprPath()
This commit is contained in:
Родитель
e2e2fb5cc8
Коммит
10c079470d
|
@ -282,10 +282,11 @@ class NS_BASE nsFileSpec
|
|||
{
|
||||
public:
|
||||
nsFileSpec();
|
||||
|
||||
|
||||
// These two meathods take *native* file paths.
|
||||
NS_EXPLICIT nsFileSpec(const char* inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFileSpec(const nsString& inString, PRBool inCreateDirs = PR_FALSE);
|
||||
// These above two meathods take *native* file paths.
|
||||
|
||||
|
||||
NS_EXPLICIT nsFileSpec(const nsFilePath& inPath);
|
||||
NS_EXPLICIT nsFileSpec(const nsFileURL& inURL);
|
||||
|
@ -293,12 +294,14 @@ class NS_BASE nsFileSpec
|
|||
nsFileSpec(const nsFileSpec& inPath);
|
||||
virtual ~nsFileSpec();
|
||||
|
||||
// These two operands take *native* file paths.
|
||||
void operator = (const char* inPath);
|
||||
void operator = (const nsString& inPath)
|
||||
{
|
||||
const nsAutoCString path(inPath);
|
||||
*this = path;
|
||||
}
|
||||
|
||||
void operator = (const nsFilePath& inPath);
|
||||
void operator = (const nsFileURL& inURL);
|
||||
void operator = (const nsFileSpec& inOther);
|
||||
|
|
|
@ -1159,7 +1159,7 @@ nsprPath::operator const char*()
|
|||
if (modifiedNSPRPath != nsnull)
|
||||
delete [] modifiedNSPRPath;
|
||||
|
||||
modifiedNSPRPath = strdup( mFilePath );
|
||||
modifiedNSPRPath = PL_strdup( mFilePath );
|
||||
char* resultPath = modifiedNSPRPath;
|
||||
|
||||
/* strip the leading seperator */
|
||||
|
@ -1171,8 +1171,8 @@ nsprPath::operator const char*()
|
|||
resultPath[1] = ':';
|
||||
|
||||
/* Remove the ending seperator */
|
||||
if(resultPath[strlen(resultPath) - 1 ] == '/')
|
||||
resultPath[strlen(resultPath) - 1 ] = '\0';
|
||||
if(resultPath[PL_strlen(resultPath) - 1 ] == '/')
|
||||
resultPath[PL_strlen(resultPath) - 1 ] = '\0';
|
||||
|
||||
return resultPath;
|
||||
|
||||
|
@ -1185,6 +1185,8 @@ nsprPath::operator const char*()
|
|||
nsprPath::~nsprPath()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef XP_PC
|
||||
if (modifiedNSPRPath != nsnull)
|
||||
delete [] modifiedNSPRPath;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1159,7 +1159,7 @@ nsprPath::operator const char*()
|
|||
if (modifiedNSPRPath != nsnull)
|
||||
delete [] modifiedNSPRPath;
|
||||
|
||||
modifiedNSPRPath = strdup( mFilePath );
|
||||
modifiedNSPRPath = PL_strdup( mFilePath );
|
||||
char* resultPath = modifiedNSPRPath;
|
||||
|
||||
/* strip the leading seperator */
|
||||
|
@ -1171,8 +1171,8 @@ nsprPath::operator const char*()
|
|||
resultPath[1] = ':';
|
||||
|
||||
/* Remove the ending seperator */
|
||||
if(resultPath[strlen(resultPath) - 1 ] == '/')
|
||||
resultPath[strlen(resultPath) - 1 ] = '\0';
|
||||
if(resultPath[PL_strlen(resultPath) - 1 ] == '/')
|
||||
resultPath[PL_strlen(resultPath) - 1 ] = '\0';
|
||||
|
||||
return resultPath;
|
||||
|
||||
|
@ -1185,6 +1185,8 @@ nsprPath::operator const char*()
|
|||
nsprPath::~nsprPath()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef XP_PC
|
||||
if (modifiedNSPRPath != nsnull)
|
||||
delete [] modifiedNSPRPath;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -282,10 +282,11 @@ class NS_BASE nsFileSpec
|
|||
{
|
||||
public:
|
||||
nsFileSpec();
|
||||
|
||||
|
||||
// These two meathods take *native* file paths.
|
||||
NS_EXPLICIT nsFileSpec(const char* inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFileSpec(const nsString& inString, PRBool inCreateDirs = PR_FALSE);
|
||||
// These above two meathods take *native* file paths.
|
||||
|
||||
|
||||
NS_EXPLICIT nsFileSpec(const nsFilePath& inPath);
|
||||
NS_EXPLICIT nsFileSpec(const nsFileURL& inURL);
|
||||
|
@ -293,12 +294,14 @@ class NS_BASE nsFileSpec
|
|||
nsFileSpec(const nsFileSpec& inPath);
|
||||
virtual ~nsFileSpec();
|
||||
|
||||
// These two operands take *native* file paths.
|
||||
void operator = (const char* inPath);
|
||||
void operator = (const nsString& inPath)
|
||||
{
|
||||
const nsAutoCString path(inPath);
|
||||
*this = path;
|
||||
}
|
||||
|
||||
void operator = (const nsFilePath& inPath);
|
||||
void operator = (const nsFileURL& inURL);
|
||||
void operator = (const nsFileSpec& inOther);
|
||||
|
|
Загрузка…
Ссылка в новой задаче