oops, back myself out - forward declared enums don't work on linux!
git-svn-id: svn://10.0.0.236/trunk@114534 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "nsStrPrivate.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsDebug.h"
|
||||
@@ -67,11 +66,11 @@ nsCString::GetFlatBufferHandle() const
|
||||
* Default constructor.
|
||||
*/
|
||||
nsCString::nsCString() {
|
||||
nsStrPrivate::Initialize(*this,eOneByte);
|
||||
Initialize(*this,eOneByte);
|
||||
}
|
||||
|
||||
nsCString::nsCString(const char* aCString) {
|
||||
nsStrPrivate::Initialize(*this,eOneByte);
|
||||
Initialize(*this,eOneByte);
|
||||
Assign(aCString);
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ nsCString::nsCString(const char* aCString) {
|
||||
* @param aLength tells us how many chars to copy from given CString
|
||||
*/
|
||||
nsCString::nsCString(const char* aCString,PRInt32 aLength) {
|
||||
nsStrPrivate::Initialize(*this,eOneByte);
|
||||
Initialize(*this,eOneByte);
|
||||
Assign(aCString,aLength);
|
||||
}
|
||||
|
||||
@@ -92,15 +91,15 @@ nsCString::nsCString(const char* aCString,PRInt32 aLength) {
|
||||
* @param reference to another nsCString
|
||||
*/
|
||||
nsCString::nsCString(const nsCString& aString) {
|
||||
nsStrPrivate::Initialize(*this,aString.GetCharSize());
|
||||
nsStrPrivate::StrAssign(*this,aString,0,aString.mLength);
|
||||
Initialize(*this,aString.GetCharSize());
|
||||
StrAssign(*this,aString,0,aString.mLength);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
nsCString::~nsCString() {
|
||||
nsStrPrivate::Destroy(*this);
|
||||
Destroy(*this);
|
||||
}
|
||||
|
||||
const char* nsCString::GetReadableFragment( nsReadableFragment<char>& aFragment, nsFragmentRequest aRequest, PRUint32 aOffset ) const {
|
||||
@@ -134,7 +133,7 @@ char* nsCString::GetWritableFragment( nsWritableFragment<char>& aFragment, nsFra
|
||||
}
|
||||
|
||||
nsCString::nsCString( const nsACString& aReadable ) {
|
||||
nsStrPrivate::Initialize(*this,eOneByte);
|
||||
Initialize(*this,eOneByte);
|
||||
Assign(aReadable);
|
||||
}
|
||||
|
||||
@@ -159,7 +158,7 @@ void nsCString::SetLength(PRUint32 anIndex) {
|
||||
// |SetCapacity| normally doesn't guarantee the use we are putting it to here (see its interface comment in nsAWritableString.h),
|
||||
// we can only use it since our local implementation, |nsCString::SetCapacity|, is known to do what we want
|
||||
|
||||
nsStrPrivate::StrTruncate(*this,anIndex);
|
||||
nsStr::StrTruncate(*this,anIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -175,13 +174,13 @@ nsCString::SetCapacity( PRUint32 aNewCapacity )
|
||||
if ( aNewCapacity )
|
||||
{
|
||||
if( aNewCapacity > GetCapacity() )
|
||||
nsStrPrivate::GrowCapacity(*this,aNewCapacity);
|
||||
GrowCapacity(*this,aNewCapacity);
|
||||
AddNullTerminator(*this);
|
||||
}
|
||||
else
|
||||
{
|
||||
nsStrPrivate::Destroy(*this);
|
||||
nsStrPrivate::Initialize(*this, eOneByte);
|
||||
nsStr::Destroy(*this);
|
||||
nsStr::Initialize(*this, eOneByte);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +248,7 @@ nsCString::StripChar(PRUnichar aChar,PRInt32 anOffset){
|
||||
*/
|
||||
void
|
||||
nsCString::StripChars(const char* aSet){
|
||||
nsStrPrivate::StripChars1(*this,aSet);
|
||||
nsStr::StripChars1(*this,aSet);
|
||||
}
|
||||
|
||||
|
||||
@@ -354,19 +353,19 @@ nsCString::ReplaceSubstring(const nsCString& aTarget,const nsCString& aNewValue)
|
||||
}
|
||||
else {
|
||||
PRInt32 theIndex=0;
|
||||
while(kNotFound!=(theIndex=nsStrPrivate::FindSubstr1in1(*this,aTarget,PR_FALSE,theIndex,mLength))) {
|
||||
while(kNotFound!=(theIndex=nsStr::FindSubstr1in1(*this,aTarget,PR_FALSE,theIndex,mLength))) {
|
||||
if(aNewValue.mLength<aTarget.mLength) {
|
||||
//Since target is longer than newValue, we should delete a few chars first, then overwrite.
|
||||
PRInt32 theDelLen=aTarget.mLength-aNewValue.mLength;
|
||||
nsStrPrivate::Delete1(*this,theIndex,theDelLen);
|
||||
nsStrPrivate::Overwrite(*this,aNewValue,theIndex);
|
||||
nsStr::Delete1(*this,theIndex,theDelLen);
|
||||
nsStr::Overwrite(*this,aNewValue,theIndex);
|
||||
}
|
||||
else {
|
||||
//this is the worst case: the newvalue is larger than the substr it's replacing
|
||||
//so we have to insert some characters...
|
||||
PRInt32 theInsLen=aNewValue.mLength-aTarget.mLength;
|
||||
nsStrPrivate::StrInsert1into1(*this,theIndex,aNewValue,0,theInsLen);
|
||||
nsStrPrivate::Overwrite(*this,aNewValue,theIndex);
|
||||
StrInsert1into1(*this,theIndex,aNewValue,0,theInsLen);
|
||||
nsStr::Overwrite(*this,aNewValue,theIndex);
|
||||
theIndex += aNewValue.mLength;
|
||||
}
|
||||
}
|
||||
@@ -405,7 +404,7 @@ nsCString::Trim(const char* aTrimSet, PRBool aEliminateLeading,PRBool aEliminate
|
||||
}
|
||||
}
|
||||
|
||||
nsStrPrivate::Trim(*this,aTrimSet,aEliminateLeading,aEliminateTrailing);
|
||||
nsStr::Trim(*this,aTrimSet,aEliminateLeading,aEliminateTrailing);
|
||||
|
||||
if(aIgnoreQuotes && theQuotesAreNeeded) {
|
||||
InsertWithConversion(theFirstChar,0);
|
||||
@@ -429,7 +428,7 @@ void
|
||||
nsCString::CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading,PRBool aEliminateTrailing){
|
||||
if(aSet){
|
||||
ReplaceChar(aSet,aChar);
|
||||
nsStrPrivate::CompressSet1(*this,aSet,aEliminateLeading,aEliminateTrailing);
|
||||
nsStr::CompressSet1(*this,aSet,aEliminateLeading,aEliminateTrailing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,11 +599,11 @@ PRInt32 nsCString::ToInteger(PRInt32* anErrorCode,PRUint32 aRadix) const {
|
||||
* @return this
|
||||
*/
|
||||
void nsCString::AssignWithConversion(const PRUnichar* aString,PRInt32 aCount) {
|
||||
nsStrPrivate::StrTruncate(*this,0);
|
||||
nsStr::StrTruncate(*this,0);
|
||||
|
||||
if(aString && aCount){
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mUStr=(PRUnichar*)aString;
|
||||
|
||||
if(0<aCount) {
|
||||
@@ -613,7 +612,7 @@ void nsCString::AssignWithConversion(const PRUnichar* aString,PRInt32 aCount) {
|
||||
// If this assertion fires, the caller is probably lying about the length of
|
||||
// the passed-in string. File a bug on the caller.
|
||||
#ifdef NS_DEBUG
|
||||
PRInt32 len=nsStrPrivate::FindChar2(temp,0,PR_FALSE,temp.mLength);
|
||||
PRInt32 len=nsStr::FindChar2(temp,0,PR_FALSE,temp.mLength);
|
||||
if(kNotFound<len) {
|
||||
NS_WARNING(kPossibleNull);
|
||||
}
|
||||
@@ -623,7 +622,7 @@ void nsCString::AssignWithConversion(const PRUnichar* aString,PRInt32 aCount) {
|
||||
else aCount=temp.mLength=nsCRT::strlen(aString);
|
||||
|
||||
if(0<aCount)
|
||||
nsStrPrivate::StrAppend(*this,temp,0,aCount);
|
||||
StrAppend(*this,temp,0,aCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,7 +631,7 @@ void nsCString::AssignWithConversion( const nsString& aString ) {
|
||||
}
|
||||
|
||||
void nsCString::AssignWithConversion( const nsAString& aString ) {
|
||||
nsStrPrivate::StrTruncate(*this,0);
|
||||
nsStr::StrTruncate(*this,0);
|
||||
PRInt32 count = aString.Length();
|
||||
|
||||
if(count){
|
||||
@@ -643,12 +642,12 @@ void nsCString::AssignWithConversion( const nsAString& aString ) {
|
||||
PRUint32 fraglen = start.size_forward();
|
||||
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mUStr=(PRUnichar*)start.get();
|
||||
|
||||
temp.mLength=fraglen;
|
||||
|
||||
nsStrPrivate::StrAppend(*this,temp,0,fraglen);
|
||||
StrAppend(*this,temp,0,fraglen);
|
||||
|
||||
start.advance(fraglen);
|
||||
}
|
||||
@@ -666,12 +665,12 @@ void nsCString::AppendWithConversion( const nsAString& aString ) {
|
||||
PRUint32 fraglen = start.size_forward();
|
||||
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mUStr=(PRUnichar*)start.get();
|
||||
|
||||
temp.mLength=fraglen;
|
||||
|
||||
nsStrPrivate::StrAppend(*this,temp,0,fraglen);
|
||||
StrAppend(*this,temp,0,fraglen);
|
||||
|
||||
start.advance(fraglen);
|
||||
}
|
||||
@@ -685,7 +684,7 @@ void nsCString::AppendWithConversion( const nsAString& aString ) {
|
||||
* @return this
|
||||
*/
|
||||
void nsCString::AssignWithConversion(PRUnichar aChar) {
|
||||
nsStrPrivate::StrTruncate(*this,0);
|
||||
nsStr::StrTruncate(*this,0);
|
||||
AppendWithConversion(aChar);
|
||||
}
|
||||
|
||||
@@ -701,16 +700,16 @@ void nsCString::AppendWithConversion(PRUnichar aChar) {
|
||||
buf[0]=aChar;
|
||||
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mUStr=buf;
|
||||
temp.mLength=1;
|
||||
nsStrPrivate::StrAppend(*this,temp,0,1);
|
||||
StrAppend(*this,temp,0,1);
|
||||
}
|
||||
|
||||
void nsCString::AppendWithConversion( const PRUnichar* aBuffer, PRInt32 aLength )
|
||||
{
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp, eTwoByte);
|
||||
nsStr::Initialize(temp, eTwoByte);
|
||||
temp.mUStr = NS_CONST_CAST(PRUnichar*, aBuffer);
|
||||
|
||||
if ( aLength < 0 )
|
||||
@@ -719,7 +718,7 @@ void nsCString::AppendWithConversion( const PRUnichar* aBuffer, PRInt32 aLength
|
||||
if ( aLength > 0 )
|
||||
{
|
||||
temp.mLength = aLength;
|
||||
nsStrPrivate::StrAppend(*this, temp, 0, aLength);
|
||||
StrAppend(*this, temp, 0, aLength);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -789,7 +788,7 @@ void nsCString::AppendWithConversion(const nsString& aString,PRInt32 aCount) {
|
||||
else aCount=MinInt(aCount,aString.mLength);
|
||||
|
||||
if(0<aCount)
|
||||
nsStrPrivate::StrAppend(*this,aString,0,aCount);
|
||||
StrAppend(*this,aString,0,aCount);
|
||||
}
|
||||
|
||||
|
||||
@@ -805,21 +804,21 @@ void nsCString::InsertWithConversion(PRUnichar aChar,PRUint32 anOffset){
|
||||
PRUnichar theBuffer[2]={0,0};
|
||||
theBuffer[0]=aChar;
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mUStr=theBuffer;
|
||||
temp.mLength=1;
|
||||
nsStrPrivate::StrInsert2into1(*this,anOffset,temp,0,1);
|
||||
StrInsert2into1(*this,anOffset,temp,0,1);
|
||||
}
|
||||
|
||||
|
||||
void nsCString::Adopt(char* aPtr, PRInt32 aLength) {
|
||||
NS_ASSERTION(aPtr, "Can't adopt |0|");
|
||||
nsStrPrivate::Destroy(*this);
|
||||
nsStr::Destroy(*this);
|
||||
if (aLength == -1)
|
||||
aLength = nsCharTraits<char>::length(aPtr);
|
||||
// We don't know the capacity, so we'll just have to assume
|
||||
// capacity = length.
|
||||
nsStrPrivate::Initialize(*this, aPtr, aLength, aLength, eOneByte, PR_TRUE);
|
||||
nsStr::Initialize(*this, aPtr, aLength, aLength, eOneByte, PR_TRUE);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
@@ -841,10 +840,10 @@ PRInt32 nsCString::Find(const char* aCString,PRBool aIgnoreCase,PRInt32 anOffset
|
||||
PRInt32 result=kNotFound;
|
||||
if(aCString) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eOneByte);
|
||||
nsStr::Initialize(temp,eOneByte);
|
||||
temp.mLength = nsCRT::strlen(aCString);
|
||||
temp.mStr=(char*)aCString;
|
||||
result=nsStrPrivate::FindSubstr1in1(*this,temp,aIgnoreCase,anOffset,aCount);
|
||||
result=nsStr::FindSubstr1in1(*this,temp,aIgnoreCase,anOffset,aCount);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -865,10 +864,10 @@ PRInt32 nsCString::Find(const PRUnichar* aString,PRBool aIgnoreCase,PRInt32 anOf
|
||||
PRInt32 result=kNotFound;
|
||||
if(aString) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mLength = nsCRT::strlen(aString);
|
||||
temp.mUStr=(PRUnichar*)aString;
|
||||
result=nsStrPrivate::FindSubstr2in1(*this,temp,aIgnoreCase,anOffset,aCount);
|
||||
result=nsStr::FindSubstr2in1(*this,temp,aIgnoreCase,anOffset,aCount);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -884,12 +883,12 @@ PRInt32 nsCString::Find(const PRUnichar* aString,PRBool aIgnoreCase,PRInt32 anOf
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 nsCString::Find(const nsCString& aString,PRBool aIgnoreCase,PRInt32 anOffset,PRInt32 aCount) const{
|
||||
PRInt32 result=nsStrPrivate::FindSubstr1in1(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
PRInt32 result=nsStr::FindSubstr1in1(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32 nsCString::Find(const nsString& aString,PRBool aIgnoreCase,PRInt32 anOffset,PRInt32 aCount) const{
|
||||
PRInt32 result=nsStrPrivate::FindSubstr1in2(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
PRInt32 result=nsStr::FindSubstr1in2(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -905,7 +904,7 @@ PRInt32 nsCString::Find(const nsString& aString,PRBool aIgnoreCase,PRInt32 anOff
|
||||
* @return index in aDest where member of aSet occurs, or -1 if not found
|
||||
*/
|
||||
PRInt32 nsCString::FindChar(PRUnichar aChar,PRInt32 anOffset,PRInt32 aCount) const{
|
||||
PRInt32 result=nsStrPrivate::FindChar1(*this,aChar,anOffset,aCount);
|
||||
PRInt32 result=nsStr::FindChar1(*this,aChar,anOffset,aCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -924,10 +923,10 @@ PRInt32 nsCString::FindCharInSet(const char* aCStringSet,PRInt32 anOffset) const
|
||||
PRInt32 result=kNotFound;
|
||||
if(aCStringSet) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eOneByte);
|
||||
nsStr::Initialize(temp,eOneByte);
|
||||
temp.mLength=nsCRT::strlen(aCStringSet);
|
||||
temp.mStr=(char*)aCStringSet;
|
||||
result=nsStrPrivate::FindCharInSet1(*this,temp,PR_FALSE,anOffset);
|
||||
result=nsStr::FindCharInSet1(*this,temp,PR_FALSE,anOffset);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -947,10 +946,10 @@ PRInt32 nsCString::FindCharInSet(const PRUnichar* aStringSet,PRInt32 anOffset) c
|
||||
PRInt32 result=kNotFound;
|
||||
if(aStringSet) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mLength=nsCRT::strlen(aStringSet);
|
||||
temp.mStr=(char*)aStringSet;
|
||||
result=nsStrPrivate::FindCharInSet2(*this,temp,anOffset);
|
||||
result=nsStr::FindCharInSet2(*this,temp,anOffset);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -965,12 +964,12 @@ PRInt32 nsCString::FindCharInSet(const PRUnichar* aStringSet,PRInt32 anOffset) c
|
||||
* @return
|
||||
*/
|
||||
PRInt32 nsCString::FindCharInSet(const nsCString& aSet,PRInt32 anOffset) const{
|
||||
PRInt32 result=nsStrPrivate::FindCharInSet1(*this,aSet,PR_FALSE,anOffset);
|
||||
PRInt32 result=nsStr::FindCharInSet1(*this,aSet,PR_FALSE,anOffset);
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32 nsCString::FindCharInSet(const nsString& aSet,PRInt32 anOffset) const{
|
||||
PRInt32 result=nsStrPrivate::FindCharInSet2(*this,aSet,anOffset);
|
||||
PRInt32 result=nsStr::FindCharInSet2(*this,aSet,anOffset);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -985,12 +984,12 @@ PRInt32 nsCString::FindCharInSet(const nsString& aSet,PRInt32 anOffset) const{
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 nsCString::RFind(const nsCString& aString,PRBool aIgnoreCase,PRInt32 anOffset,PRInt32 aCount) const{
|
||||
PRInt32 result=nsStrPrivate::RFindSubstr1in1(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
PRInt32 result=nsStr::RFindSubstr1in1(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32 nsCString::RFind(const nsString& aString,PRBool aIgnoreCase,PRInt32 anOffset,PRInt32 aCount) const{
|
||||
PRInt32 result=nsStrPrivate::RFindSubstr2in1(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
PRInt32 result=nsStr::RFindSubstr2in1(*this,aString,aIgnoreCase,anOffset,aCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1011,10 +1010,10 @@ PRInt32 nsCString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset
|
||||
PRInt32 result=kNotFound;
|
||||
if(aString) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eOneByte);
|
||||
nsStr::Initialize(temp,eOneByte);
|
||||
temp.mLength=nsCRT::strlen(aString);
|
||||
temp.mStr=(char*)aString;
|
||||
result=nsStrPrivate::RFindSubstr1in1(*this,temp,aIgnoreCase,anOffset,aCount);
|
||||
result=nsStr::RFindSubstr1in1(*this,temp,aIgnoreCase,anOffset,aCount);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1030,7 +1029,7 @@ PRInt32 nsCString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset
|
||||
* @return index in aDest where member of aSet occurs, or -1 if not found
|
||||
*/
|
||||
PRInt32 nsCString::RFindChar(PRUnichar aChar,PRInt32 anOffset,PRInt32 aCount) const{
|
||||
PRInt32 result=nsStrPrivate::RFindChar1(*this,aChar,anOffset,aCount);
|
||||
PRInt32 result=nsStr::RFindChar1(*this,aChar,anOffset,aCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1048,10 +1047,10 @@ PRInt32 nsCString::RFindCharInSet(const char* aCStringSet,PRInt32 anOffset) cons
|
||||
PRInt32 result=kNotFound;
|
||||
if(aCStringSet) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eOneByte);
|
||||
nsStr::Initialize(temp,eOneByte);
|
||||
temp.mLength=nsCRT::strlen(aCStringSet);
|
||||
temp.mStr=(char*)aCStringSet;
|
||||
result=nsStrPrivate::RFindCharInSet1(*this,temp,PR_FALSE,anOffset);
|
||||
result=nsStr::RFindCharInSet1(*this,temp,PR_FALSE,anOffset);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1070,10 +1069,10 @@ PRInt32 nsCString::RFindCharInSet(const PRUnichar* aStringSet,PRInt32 anOffset)
|
||||
PRInt32 result=kNotFound;
|
||||
if(aStringSet) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mLength=nsCRT::strlen(aStringSet);
|
||||
temp.mUStr=(PRUnichar*)aStringSet;
|
||||
result=nsStrPrivate::RFindCharInSet2(*this,temp,anOffset);
|
||||
result=nsStr::RFindCharInSet2(*this,temp,anOffset);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1088,12 +1087,12 @@ PRInt32 nsCString::RFindCharInSet(const PRUnichar* aStringSet,PRInt32 anOffset)
|
||||
* @return offset of found char, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 nsCString::RFindCharInSet(const nsCString& aSet,PRInt32 anOffset) const{
|
||||
PRInt32 result=nsStrPrivate::RFindCharInSet1(*this,aSet,PR_FALSE,anOffset);
|
||||
PRInt32 result=nsStr::RFindCharInSet1(*this,aSet,PR_FALSE,anOffset);
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32 nsCString::RFindCharInSet(const nsString& aSet,PRInt32 anOffset) const{
|
||||
PRInt32 result=nsStrPrivate::RFindCharInSet2(*this,aSet,anOffset);
|
||||
PRInt32 result=nsStr::RFindCharInSet2(*this,aSet,anOffset);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1116,10 +1115,10 @@ PRInt32 nsCString::CompareWithConversion(const PRUnichar* aString,PRBool aIgnore
|
||||
|
||||
if(aString) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eTwoByte);
|
||||
nsStr::Initialize(temp,eTwoByte);
|
||||
temp.mLength=nsCRT::strlen(aString);
|
||||
temp.mUStr=(PRUnichar*)aString;
|
||||
return nsStrPrivate::StrCompare1To2(*this,temp,aCount,aIgnoreCase);
|
||||
return nsStr::StrCompare1To2(*this,temp,aCount,aIgnoreCase);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1137,10 +1136,10 @@ PRInt32 nsCString::CompareWithConversion(const char *aCString,PRBool aIgnoreCase
|
||||
|
||||
if(aCString) {
|
||||
nsStr temp;
|
||||
nsStrPrivate::Initialize(temp,eOneByte);
|
||||
nsStr::Initialize(temp,eOneByte);
|
||||
temp.mLength=nsCRT::strlen(aCString);
|
||||
temp.mStr=(char*)aCString;
|
||||
return nsStrPrivate::StrCompare1To1(*this,temp,aCount,aIgnoreCase);
|
||||
return nsStr::StrCompare1To1(*this,temp,aCount,aIgnoreCase);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1316,25 +1315,25 @@ NS_LossyConvertUCS2toASCII::NS_LossyConvertUCS2toASCII( const nsAString& aString
|
||||
*
|
||||
*/
|
||||
nsCAutoString::nsCAutoString() : nsCString(){
|
||||
nsStrPrivate::Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
AddNullTerminator(*this);
|
||||
|
||||
}
|
||||
|
||||
nsCAutoString::nsCAutoString( const nsCString& aString ) : nsCString(){
|
||||
nsStrPrivate::Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
AddNullTerminator(*this);
|
||||
Append(aString);
|
||||
}
|
||||
|
||||
nsCAutoString::nsCAutoString( const nsACString& aString ) : nsCString(){
|
||||
nsStrPrivate::Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
AddNullTerminator(*this);
|
||||
Append(aString);
|
||||
}
|
||||
|
||||
nsCAutoString::nsCAutoString(const char* aCString) : nsCString() {
|
||||
nsStrPrivate::Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
AddNullTerminator(*this);
|
||||
Append(aCString);
|
||||
}
|
||||
@@ -1344,7 +1343,7 @@ nsCAutoString::nsCAutoString(const char* aCString) : nsCString() {
|
||||
* @param aCString is a ptr to a 1-byte cstr
|
||||
*/
|
||||
nsCAutoString::nsCAutoString(const char* aCString,PRInt32 aLength) : nsCString() {
|
||||
nsStrPrivate::Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
AddNullTerminator(*this);
|
||||
Append(aCString,aLength);
|
||||
}
|
||||
@@ -1355,10 +1354,10 @@ nsCAutoString::nsCAutoString(const char* aCString,PRInt32 aLength) : nsCString()
|
||||
*/
|
||||
nsCAutoString::nsCAutoString(const CBufDescriptor& aBuffer) : nsCString() {
|
||||
if(!aBuffer.mBuffer) {
|
||||
nsStrPrivate::Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
Initialize(*this,mBuffer,sizeof(mBuffer)-1,0,eOneByte,PR_FALSE);
|
||||
}
|
||||
else {
|
||||
nsStrPrivate::Initialize(*this,aBuffer.mBuffer,aBuffer.mCapacity,aBuffer.mLength,aBuffer.mCharSize,!aBuffer.mStackBased);
|
||||
Initialize(*this,aBuffer.mBuffer,aBuffer.mCapacity,aBuffer.mLength,aBuffer.mCharSize,!aBuffer.mStackBased);
|
||||
}
|
||||
if(!aBuffer.mIsConst)
|
||||
AddNullTerminator(*this); //this isn't really needed, but it guarantees that folks don't pass string constants.
|
||||
|
||||
Reference in New Issue
Block a user