exposed objectAt in deque, and fixed toInteger bug

This commit is contained in:
rickg%netscape.com 1999-01-15 19:20:51 +00:00
parent 9fe347aafc
commit 214c399537
8 changed files with 46 additions and 28 deletions

View File

@ -16,7 +16,7 @@
* Reserved.
*/
#include "nsDeque.h"
#include "nsCRT.h"

View File

@ -131,6 +131,16 @@ friend class nsDequeIterator;
*/
void* Peek(void);
/**
* method used to retrieve ptr to
* ith member in container. DOesn't remove
* that item.
*
* @update gess4/18/98
* @param index of desired item
* @return ptr to ith element in list
*/
void* ObjectAt(int anIndex) const;
/**
* Remove all items from container without destroying them
@ -240,17 +250,6 @@ private:
*/
nsDeque& operator=(const nsDeque& anOther);
/**
* PRIVATE method used to retrieve ptr to
* ith member in container. DOesn't remove
* that item.
*
* @update gess4/18/98
* @param index of desired item
* @return ptr to ith element in list
*/
void* ObjectAt(int anIndex) const;
};
/******************************************************

View File

@ -664,7 +664,10 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const {
result=-result;
break;
}
else if('+'==theChar) {
else if('+'==theChar) { //stop in a good state if you see this...
break;
}
else if(' '==theChar){ //stop in a good state if you see this...
break;
}
else{
@ -2066,9 +2069,11 @@ void nsString::SelfTest(void) {
nsAutoString a("foobar");
nsAutoString b("foo");
nsAutoString c(".5111");
nsAutoString d(" 5");
PRInt32 result=a.Compare(b);
PRInt32 result2=result;
result=c.ToInteger(&result2);
result=d.ToInteger(&result2);
result2=result;
#if 0

View File

@ -664,7 +664,10 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const {
result=-result;
break;
}
else if('+'==theChar) {
else if('+'==theChar) { //stop in a good state if you see this...
break;
}
else if(' '==theChar){ //stop in a good state if you see this...
break;
}
else{
@ -2066,9 +2069,11 @@ void nsString::SelfTest(void) {
nsAutoString a("foobar");
nsAutoString b("foo");
nsAutoString c(".5111");
nsAutoString d(" 5");
PRInt32 result=a.Compare(b);
PRInt32 result2=result;
result=c.ToInteger(&result2);
result=d.ToInteger(&result2);
result2=result;
#if 0

View File

@ -16,7 +16,7 @@
* Reserved.
*/
#include "nsDeque.h"
#include "nsCRT.h"

View File

@ -131,6 +131,16 @@ friend class nsDequeIterator;
*/
void* Peek(void);
/**
* method used to retrieve ptr to
* ith member in container. DOesn't remove
* that item.
*
* @update gess4/18/98
* @param index of desired item
* @return ptr to ith element in list
*/
void* ObjectAt(int anIndex) const;
/**
* Remove all items from container without destroying them
@ -240,17 +250,6 @@ private:
*/
nsDeque& operator=(const nsDeque& anOther);
/**
* PRIVATE method used to retrieve ptr to
* ith member in container. DOesn't remove
* that item.
*
* @update gess4/18/98
* @param index of desired item
* @return ptr to ith element in list
*/
void* ObjectAt(int anIndex) const;
};
/******************************************************

View File

@ -664,7 +664,10 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const {
result=-result;
break;
}
else if('+'==theChar) {
else if('+'==theChar) { //stop in a good state if you see this...
break;
}
else if(' '==theChar){ //stop in a good state if you see this...
break;
}
else{
@ -2066,9 +2069,11 @@ void nsString::SelfTest(void) {
nsAutoString a("foobar");
nsAutoString b("foo");
nsAutoString c(".5111");
nsAutoString d(" 5");
PRInt32 result=a.Compare(b);
PRInt32 result2=result;
result=c.ToInteger(&result2);
result=d.ToInteger(&result2);
result2=result;
#if 0

View File

@ -664,7 +664,10 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const {
result=-result;
break;
}
else if('+'==theChar) {
else if('+'==theChar) { //stop in a good state if you see this...
break;
}
else if(' '==theChar){ //stop in a good state if you see this...
break;
}
else{
@ -2066,9 +2069,11 @@ void nsString::SelfTest(void) {
nsAutoString a("foobar");
nsAutoString b("foo");
nsAutoString c(".5111");
nsAutoString d(" 5");
PRInt32 result=a.Compare(b);
PRInt32 result2=result;
result=c.ToInteger(&result2);
result=d.ToInteger(&result2);
result2=result;
#if 0