This commit is contained in:
mcmullen%netscape.com 1999-04-20 19:31:11 +00:00
parent e99db1efbc
commit 0c1a07d566
6 changed files with 6 additions and 4 deletions

View File

@ -253,6 +253,7 @@ public:
PRBool IsEmpty() const { return Length() == 0; }
PRUint32 Length() const { return mData ? mData->mLength : 0; }
void SetLength(PRUint32 inLength) { ReallocData(inLength); }
void CopyFrom(const char* inData, PRUint32 inLength);
void LeafReplace(char inSeparator, const char* inLeafName);
char* GetLeaf(char inSeparator) const; // use PR_Free()

View File

@ -182,7 +182,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
chars[outSpec.mPath.Length() - 1] = '\0'; // avoid trailing separator, if any
char* cp = strrchr(chars, '/');
if (cp++)
outSpec.mPath.ReallocData(cp - chars); // truncate.
outSpec.mPath.SetLength(cp - chars); // truncate.
} // nsFileSpec::GetParent
//----------------------------------------------------------------------------------------

View File

@ -226,7 +226,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
chars[outSpec.mPath.Length() - 1] = '\0'; // avoid trailing separator, if any
char* cp = strrchr(chars, '\\');
if (cp++)
outSpec.mPath.ReallocData(cp - chars); // truncate.
outSpec.mPath.SetLength(cp - chars); // truncate.
} // nsFileSpec::GetParent
//----------------------------------------------------------------------------------------

View File

@ -253,6 +253,7 @@ public:
PRBool IsEmpty() const { return Length() == 0; }
PRUint32 Length() const { return mData ? mData->mLength : 0; }
void SetLength(PRUint32 inLength) { ReallocData(inLength); }
void CopyFrom(const char* inData, PRUint32 inLength);
void LeafReplace(char inSeparator, const char* inLeafName);
char* GetLeaf(char inSeparator) const; // use PR_Free()

View File

@ -182,7 +182,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
chars[outSpec.mPath.Length() - 1] = '\0'; // avoid trailing separator, if any
char* cp = strrchr(chars, '/');
if (cp++)
outSpec.mPath.ReallocData(cp - chars); // truncate.
outSpec.mPath.SetLength(cp - chars); // truncate.
} // nsFileSpec::GetParent
//----------------------------------------------------------------------------------------

View File

@ -226,7 +226,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
chars[outSpec.mPath.Length() - 1] = '\0'; // avoid trailing separator, if any
char* cp = strrchr(chars, '\\');
if (cp++)
outSpec.mPath.ReallocData(cp - chars); // truncate.
outSpec.mPath.SetLength(cp - chars); // truncate.
} // nsFileSpec::GetParent
//----------------------------------------------------------------------------------------