зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 85548 (Move Transformiix to PRInt32/PRUint32), mostly search and replace. r=Pike, sr=jst.
This commit is contained in:
Родитель
145cbcd4d6
Коммит
9a4903e107
|
@ -21,14 +21,14 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: CommandLineUtils.cpp,v 1.3 2000/06/11 11:41:52 Peter.VanderBeken%pandora.be Exp $
|
||||
* $Id: CommandLineUtils.cpp,v 1.4 2001/06/26 14:07:29 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "CommandLineUtils.h"
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.3 $ $Date: 2000/06/11 11:41:52 $
|
||||
* @version $Revision: 1.4 $ $Date: 2001/06/26 14:07:29 $
|
||||
**/
|
||||
void CommandLineUtils::getOptions
|
||||
(NamedMap& options, int argc, char** argv, StringList& flags)
|
||||
|
@ -52,7 +52,7 @@ void CommandLineUtils::getOptions
|
|||
//-- check full flag, otherwise try to find
|
||||
//-- flag within string
|
||||
if (!flags.contains(flag)) {
|
||||
Int32 idx = 1;
|
||||
PRInt32 idx = 1;
|
||||
String tmpFlag;
|
||||
while(idx <= flag.length()) {
|
||||
flag.subString(0,idx, tmpFlag);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: DefaultStringComparator.cpp,v 1.1 2000/04/12 10:49:27 kvisco%ziplink.net Exp $
|
||||
* $Id: DefaultStringComparator.cpp,v 1.2 2001/06/26 14:07:34 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "StringComparator.h"
|
||||
|
@ -51,8 +51,8 @@ int DefaultStringComparator::compare(const String& str1, const String& str2) {
|
|||
|
||||
int c = 0;
|
||||
while ((c < len1) && (c < len2)) {
|
||||
Int32 ch1 = str1.charAt(c);
|
||||
Int32 ch2 = str2.charAt(c);
|
||||
PRInt32 ch1 = str1.charAt(c);
|
||||
PRInt32 ch2 = str2.charAt(c);
|
||||
if (ch1 < ch2) return -1;
|
||||
else if (ch2 < ch1) return 1;
|
||||
++c;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* Eric Du, duxy@leyou.com.cn
|
||||
* -- added fix for FreeBSD
|
||||
*
|
||||
* $Id: Double.cpp,v 1.4 2001/04/08 14:38:13 peterv%netscape.com Exp $
|
||||
* $Id: Double.cpp,v 1.5 2001/06/26 14:07:45 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "primitives.h"
|
||||
|
@ -149,7 +149,7 @@ double Double::toDouble(const String& src) {
|
|||
double dbl = 0.0;
|
||||
double fraction = 1.0;
|
||||
double multiplier = 10.0;
|
||||
Int32 idx = 0;
|
||||
PRInt32 idx = 0;
|
||||
|
||||
double sign = 1.0;
|
||||
|
||||
|
@ -159,7 +159,7 @@ double Double::toDouble(const String& src) {
|
|||
|
||||
//-- check first character for sign
|
||||
if ( idx < src.length() ) {
|
||||
Int32 ch = src.charAt(idx);
|
||||
PRInt32 ch = src.charAt(idx);
|
||||
if ( ch == '-' ) {
|
||||
sign = -1.0;
|
||||
++idx;
|
||||
|
@ -172,7 +172,7 @@ double Double::toDouble(const String& src) {
|
|||
//-- convert remaining to number
|
||||
for ( ; idx < src.length(); idx++ ) {
|
||||
|
||||
Int32 ch = src.charAt(idx);
|
||||
PRInt32 ch = src.charAt(idx);
|
||||
|
||||
if (( ch >= '0') && (ch <= '9')) {
|
||||
if ( multiplier > 1.0 ) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: Integer.cpp,v 1.2 1999/11/15 07:12:39 nisheeth%netscape.com Exp $
|
||||
* $Id: Integer.cpp,v 1.3 2001/06/26 14:08:02 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "primitives.h"
|
||||
|
@ -35,7 +35,7 @@
|
|||
* A wrapper for the primitive int type, and provides some simple
|
||||
* integer related routines
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.2 $ $Date: 1999/11/15 07:12:39 $
|
||||
* @version $Revision: 1.3 $ $Date: 2001/06/26 14:08:02 $
|
||||
**/
|
||||
|
||||
/**
|
||||
|
@ -56,8 +56,8 @@ Integer::Integer(int value) {
|
|||
* Creates a new Integer based on the value of the given String
|
||||
**/
|
||||
Integer::Integer(const String& str) {
|
||||
Int32 val = 0;
|
||||
for (Int32 i = 0; i < str.length(); i++) {
|
||||
PRInt32 val = 0;
|
||||
for (PRInt32 i = 0; i < str.length(); i++) {
|
||||
val = (val * 10) + (str.charAt(i) - 48);
|
||||
}
|
||||
} //-- Integer
|
||||
|
@ -66,7 +66,7 @@ Integer::Integer(const String& str) {
|
|||
* Returns the int value of this Integer
|
||||
**/
|
||||
|
||||
Int32 Integer::intValue() {
|
||||
PRInt32 Integer::intValue() {
|
||||
return value;
|
||||
} //-- intValue;
|
||||
|
||||
|
@ -76,7 +76,7 @@ Int32 Integer::intValue() {
|
|||
int Integer::intValue(const String& src) {
|
||||
|
||||
int result = 0;
|
||||
Int32 idx = 0;
|
||||
PRInt32 idx = 0;
|
||||
int sign = 1;
|
||||
|
||||
//-- trim leading whitespace
|
||||
|
@ -85,7 +85,7 @@ int Integer::intValue(const String& src) {
|
|||
|
||||
//-- check first character for sign
|
||||
if ( idx < src.length() ) {
|
||||
Int32 ch = src.charAt(idx);
|
||||
PRInt32 ch = src.charAt(idx);
|
||||
if ( ch == '-' ) {
|
||||
sign = -1;
|
||||
++idx;
|
||||
|
@ -97,7 +97,7 @@ int Integer::intValue(const String& src) {
|
|||
|
||||
//-- convert remaining to number
|
||||
for ( ; idx < src.length(); idx++ ) {
|
||||
Int32 ch = src.charAt(idx);
|
||||
PRInt32 ch = src.charAt(idx);
|
||||
if (( ch >= '0') && (ch <= '9')) {
|
||||
result = result*10;
|
||||
result += (ch-48);
|
||||
|
@ -115,7 +115,7 @@ String& Integer::toString(int value, String& dest) {
|
|||
|
||||
String result;
|
||||
UNICODE_CHAR charDigit;
|
||||
Int32 tempVal = value;
|
||||
PRInt32 tempVal = value;
|
||||
MBool isNegative = (value < 0);
|
||||
if ( isNegative ) tempVal = -value;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
/**
|
||||
* Default constructor for a List;
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.9 $ $Date: 2001/06/10 16:43:59 $
|
||||
* @version $Revision: 1.10 $ $Date: 2001/06/26 14:08:06 $
|
||||
**/
|
||||
|
||||
List::List() {
|
||||
|
@ -112,7 +112,7 @@ List::ListItem* List::getLastItem() {
|
|||
/**
|
||||
* Returns the number of items in this List
|
||||
**/
|
||||
Int32 List::getLength() {
|
||||
PRInt32 List::getLength() {
|
||||
return itemCount;
|
||||
} //-- getLength
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: List.h,v 1.7 2001/04/08 14:35:50 peterv%netscape.com Exp $
|
||||
* $Id: List.h,v 1.8 2001/06/26 14:08:12 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#ifndef TRANSFRMX_LIST_H
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
/**
|
||||
* Returns the number of items in this List
|
||||
**/
|
||||
Int32 getLength();
|
||||
PRInt32 getLength();
|
||||
|
||||
/**
|
||||
* Returns a ListIterator for this List
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
|
||||
ListItem* firstItem;
|
||||
ListItem* lastItem;
|
||||
Int32 itemCount;
|
||||
PRInt32 itemCount;
|
||||
|
||||
void insertAfter(void* objPtr, ListItem* sItem);
|
||||
void insertBefore(void* objPtr, ListItem* sItem);
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: Map.cpp,v 1.3 2001/06/26 11:58:46 sicking%bigfoot.com Exp $
|
||||
* $Id: Map.cpp,v 1.4 2001/06/26 14:08:23 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* A Hashtable for TxObjects
|
||||
* @version $Revision: 1.3 $ $Date: 2001/06/26 11:58:46 $
|
||||
* @version $Revision: 1.4 $ $Date: 2001/06/26 14:08:23 $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@ Map::Map(int size) {
|
|||
/**
|
||||
* Helper method for Constructors
|
||||
**/
|
||||
void Map::initialize(Int32 size) {
|
||||
void Map::initialize(PRInt32 size) {
|
||||
|
||||
//-- by default the Map will not delete it's
|
||||
//-- object references
|
||||
|
@ -68,7 +68,7 @@ void Map::initialize(Int32 size) {
|
|||
elements = new BucketItem*[size];
|
||||
|
||||
//-- initialize all elements to 0;
|
||||
for ( Int32 i = 0; i < size; i++ ) elements[i] = 0;
|
||||
for ( PRInt32 i = 0; i < size; i++ ) elements[i] = 0;
|
||||
|
||||
numberOfBuckets = size;
|
||||
numberOfElements = 0;
|
||||
|
@ -151,7 +151,7 @@ void Map::put(TxObject* key, TxObject* obj) {
|
|||
if ((!key) || (!obj)) return;
|
||||
|
||||
//-- compute hash for key
|
||||
Int32 hashCode = key->hashCode();
|
||||
PRInt32 hashCode = key->hashCode();
|
||||
|
||||
//-- calculate index
|
||||
int idx = hashCode % numberOfBuckets;
|
||||
|
@ -199,7 +199,7 @@ TxObject* Map::remove(TxObject* key) {
|
|||
if (!key) return 0;
|
||||
|
||||
// compute hash for key
|
||||
Int32 hashCode = key->hashCode();
|
||||
PRInt32 hashCode = key->hashCode();
|
||||
|
||||
int idx = hashCode % numberOfBuckets;
|
||||
|
||||
|
@ -255,7 +255,7 @@ Map::BucketItem* Map::createBucketItem(TxObject* key, TxObject* obj)
|
|||
Map::BucketItem* Map::getBucketItem(TxObject* key) {
|
||||
|
||||
// compute hash for key
|
||||
Int32 hashCode = key->hashCode();
|
||||
PRInt32 hashCode = key->hashCode();
|
||||
|
||||
int idx = hashCode % numberOfBuckets;
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: Map.h,v 1.2 2001/06/26 11:58:47 sicking%bigfoot.com Exp $
|
||||
* $Id: Map.h,v 1.3 2001/06/26 14:08:27 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* A Hashtable for TxObjects
|
||||
* @version $Revision: 1.2 $ $Date: 2001/06/26 11:58:47 $
|
||||
* @version $Revision: 1.3 $ $Date: 2001/06/26 14:08:27 $
|
||||
*/
|
||||
|
||||
#ifndef TRANSFRMX_MAP_H
|
||||
|
@ -142,8 +142,8 @@ private:
|
|||
// map table
|
||||
BucketItem** elements;
|
||||
|
||||
Int32 numberOfBuckets;
|
||||
Int32 numberOfElements;
|
||||
PRInt32 numberOfBuckets;
|
||||
PRInt32 numberOfElements;
|
||||
|
||||
/**
|
||||
* The ownership flag. Used to decide which objects are
|
||||
|
|
|
@ -50,7 +50,7 @@ String::String()
|
|||
//
|
||||
//Create an nsString with the specified size
|
||||
//
|
||||
String::String(Int32 initSize)
|
||||
String::String(PRInt32 initSize)
|
||||
{
|
||||
ptrNSString = new nsString();
|
||||
ptrNSString->SetCapacity(initSize);
|
||||
|
@ -95,7 +95,7 @@ String::String(const UNICODE_CHAR* source)
|
|||
// NOTE: The length passed to this constructor does not include the NULL
|
||||
// terminator (in C fashion).
|
||||
//
|
||||
String::String(const UNICODE_CHAR* source, Int32 srcLength)
|
||||
String::String(const UNICODE_CHAR* source, PRInt32 srcLength)
|
||||
{
|
||||
ptrNSString = new nsString((PRUnichar *)source, srcLength);
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ String::~String()
|
|||
//
|
||||
ostream& operator<<(ostream& output, const String& source)
|
||||
{
|
||||
Int32 outputLoop;
|
||||
PRInt32 outputLoop;
|
||||
|
||||
for (outputLoop=0;outputLoop<source.length();outputLoop++)
|
||||
output << (char)source.charAt(outputLoop);
|
||||
|
@ -166,7 +166,7 @@ String& String::operator=(const UNICODE_CHAR* source)
|
|||
//
|
||||
//Overloaded '=' operator to assign an integer to this string.
|
||||
//
|
||||
String& String::operator=(Int32 source)
|
||||
String& String::operator=(PRInt32 source)
|
||||
{
|
||||
//Since String::ConvertInt only uses String's public interface, use it to
|
||||
//convert "source", and store it in this object
|
||||
|
@ -229,7 +229,7 @@ void String::append(const UNICODE_CHAR* source)
|
|||
//Append a string of DOM Characters whose length is also defined
|
||||
//( nsString::Append(const PRUnichar*, PRInt32) )
|
||||
//
|
||||
void String::append(const UNICODE_CHAR* source, Int32 length)
|
||||
void String::append(const UNICODE_CHAR* source, PRInt32 length)
|
||||
{
|
||||
ptrNSString->Append((PRUnichar *)source, length);
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ void String::append(const UNICODE_CHAR* source, Int32 length)
|
|||
//Convert source from an integer to a string, and append it to the current
|
||||
//string. ( nsString::Append(PRInt32, PRInt32 aRadix=10) )
|
||||
//
|
||||
void String::append(Int32 source)
|
||||
void String::append(PRInt32 source)
|
||||
{
|
||||
ptrNSString->AppendInt(source);
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ void String::append(Int32 source)
|
|||
//Insert a single UNICODE_CHAR into the string starting at offset
|
||||
//( nsString::Insert(PRUnichar, PRUint32) )
|
||||
//
|
||||
void String::insert(Int32 offset, const UNICODE_CHAR source)
|
||||
void String::insert(PRInt32 offset, const UNICODE_CHAR source)
|
||||
{
|
||||
ptrNSString->Insert((PRUnichar)source, offset);
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ void String::insert(Int32 offset, const UNICODE_CHAR source)
|
|||
//nsString does not seem to support the insertion of a char (it seems to be
|
||||
//commented out) so just use nsString::Insert(PRUnichar, PRUint32).
|
||||
//
|
||||
void String::insert(Int32 offset, const char source)
|
||||
void String::insert(PRInt32 offset, const char source)
|
||||
{
|
||||
ptrNSString->Insert((PRUnichar)source, offset);
|
||||
}
|
||||
|
@ -266,9 +266,9 @@ void String::insert(Int32 offset, const char source)
|
|||
//Insert the source string starting at the current offset
|
||||
//Only use the public interface of source, since we must support all classes
|
||||
//derrived from String.
|
||||
//( nsString::Insert(const PRUnichar*, PRuint32, PRInt32) )
|
||||
//( nsString::Insert(const PRUnichar*, PRUint32, PRInt32) )
|
||||
//
|
||||
void String::insert(Int32 offset, const String& source)
|
||||
void String::insert(PRInt32 offset, const String& source)
|
||||
{
|
||||
//There are issues if we try to insert a string into itself using its unicode
|
||||
//buffer! So if the provided source object is equal to this, then we are
|
||||
|
@ -282,9 +282,9 @@ void String::insert(Int32 offset, const String& source)
|
|||
|
||||
//
|
||||
//Insert the source "C" type string into this string starting at offset.
|
||||
//( nsString::Insert(const char*, PRUint32, PrInt32) )
|
||||
//( nsString::Insert(const char*, PRUint32, PRInt32) )
|
||||
//
|
||||
void String::insert(Int32 offset, const char* source)
|
||||
void String::insert(PRInt32 offset, const char* source)
|
||||
{
|
||||
ptrNSString->InsertWithConversion(source, offset);
|
||||
}
|
||||
|
@ -292,9 +292,9 @@ void String::insert(Int32 offset, const char* source)
|
|||
//
|
||||
//Insert the source UNICODE_CHAR type string into this string starting at
|
||||
//offset. Note that the source is Null Terminated.
|
||||
//( nsString::Insert(const PRUnichar*, PRuint32, PRInt32) )
|
||||
//( nsString::Insert(const PRUnichar*, PRUint32, PRInt32) )
|
||||
//
|
||||
void String::insert(Int32 offset, const UNICODE_CHAR* source)
|
||||
void String::insert(PRInt32 offset, const UNICODE_CHAR* source)
|
||||
{
|
||||
ptrNSString->Insert((PRUnichar *)source, offset, UnicodeLength(source));
|
||||
}
|
||||
|
@ -304,8 +304,8 @@ void String::insert(Int32 offset, const UNICODE_CHAR* source)
|
|||
//offset. Note that the array is not null terminated, so the lenght must be
|
||||
//provided.
|
||||
//
|
||||
void String::insert(Int32 offset, const UNICODE_CHAR* source,
|
||||
Int32 srcLength)
|
||||
void String::insert(PRInt32 offset, const UNICODE_CHAR* source,
|
||||
PRInt32 srcLength)
|
||||
{
|
||||
ptrNSString->Insert((PRUnichar *)source, offset, srcLength);
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ void String::insert(Int32 offset, const UNICODE_CHAR* source,
|
|||
//
|
||||
//Convert source from an integer to a string, and then insert.
|
||||
//
|
||||
void String::insert(Int32 offset, Int32 source)
|
||||
void String::insert(PRInt32 offset, PRInt32 source)
|
||||
{
|
||||
String convertString;
|
||||
|
||||
|
@ -323,7 +323,7 @@ void String::insert(Int32 offset, Int32 source)
|
|||
//
|
||||
//Replace the character specified by offset with the UNICODE_CHAR source
|
||||
//
|
||||
void String::replace(Int32 offset, const UNICODE_CHAR source)
|
||||
void String::replace(PRInt32 offset, const UNICODE_CHAR source)
|
||||
{
|
||||
replace(offset, &source, 1);
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ void String::replace(Int32 offset, const UNICODE_CHAR source)
|
|||
//
|
||||
//Replace the character specified by offset with the C style character source
|
||||
//
|
||||
void String::replace(Int32 offset, const char source)
|
||||
void String::replace(PRInt32 offset, const char source)
|
||||
{
|
||||
replace(offset, (UNICODE_CHAR)source);
|
||||
}
|
||||
|
@ -339,9 +339,9 @@ void String::replace(Int32 offset, const char source)
|
|||
//
|
||||
//Replace the substring starting at offset with the String specified by source.
|
||||
//
|
||||
void String::replace(Int32 offset, const String& source)
|
||||
void String::replace(PRInt32 offset, const String& source)
|
||||
{
|
||||
Int32 numToCut = 0;
|
||||
PRInt32 numToCut = 0;
|
||||
|
||||
//There are issues if we try to replace a string using a portion of itself
|
||||
//using its unicode buffer! So to try and be efficient, if source is equal
|
||||
|
@ -362,9 +362,9 @@ void String::replace(Int32 offset, const String& source)
|
|||
//
|
||||
//Replace the substring starting at offset with the "C" style character string.
|
||||
//See replace for a Unicode String of a specified lenght below for details
|
||||
void String::replace(Int32 offset, const char* source)
|
||||
void String::replace(PRInt32 offset, const char* source)
|
||||
{
|
||||
Int32 srcLength = strlen(source);
|
||||
PRInt32 srcLength = strlen(source);
|
||||
ptrNSString->Cut(offset, srcLength);
|
||||
ptrNSString->InsertWithConversion(source, offset, srcLength);
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ void String::replace(Int32 offset, const char* source)
|
|||
//
|
||||
//Replace the substring starting at offset with the Unicode string.
|
||||
//
|
||||
void String::replace(Int32 offset, const UNICODE_CHAR* source)
|
||||
void String::replace(PRInt32 offset, const UNICODE_CHAR* source)
|
||||
{
|
||||
replace(offset, source, UnicodeLength(source));
|
||||
}
|
||||
|
@ -383,8 +383,8 @@ void String::replace(Int32 offset, const UNICODE_CHAR* source)
|
|||
//character by another. So we will break the operation into pieces.
|
||||
//( nsString::Cut(PRUint32, PRInt32) ) - Remove piece being replaced
|
||||
//( nsString::Insert(PRUnichar*, PRInt32) ) - Insert the new piece
|
||||
void String::replace(Int32 offset, const UNICODE_CHAR* source,
|
||||
Int32 srcLength)
|
||||
void String::replace(PRInt32 offset, const UNICODE_CHAR* source,
|
||||
PRInt32 srcLength)
|
||||
{
|
||||
ptrNSString->Cut(offset, srcLength);
|
||||
ptrNSString->Insert((PRUnichar *)source, offset, srcLength);
|
||||
|
@ -393,7 +393,7 @@ void String::replace(Int32 offset, const UNICODE_CHAR* source,
|
|||
//
|
||||
//Convert source from an integer to a String, and perform a replacement.
|
||||
//
|
||||
void String::replace(Int32 offset, Int32 source)
|
||||
void String::replace(PRInt32 offset, PRInt32 source)
|
||||
{
|
||||
String convertString;
|
||||
|
||||
|
@ -406,7 +406,7 @@ void String::replace(Int32 offset, Int32 source)
|
|||
* and padded with '\0' null characters. Otherwise the String
|
||||
* will be truncated
|
||||
**/
|
||||
void String::setLength(Int32 length) {
|
||||
void String::setLength(PRInt32 length) {
|
||||
setLength(length, '\0');
|
||||
} //-- setLength
|
||||
|
||||
|
@ -422,9 +422,9 @@ void String::setLength(Int32 length) {
|
|||
* pieces. One if a simple truncation is taking place, and another if
|
||||
* the stirng is being lengthened and padded.
|
||||
**/
|
||||
void String::setLength(Int32 length, UNICODE_CHAR padChar)
|
||||
void String::setLength(PRInt32 length, UNICODE_CHAR padChar)
|
||||
{
|
||||
Int32 strLength = ptrNSString->Length();
|
||||
PRInt32 strLength = ptrNSString->Length();
|
||||
|
||||
if (length < strLength)
|
||||
{
|
||||
|
@ -433,7 +433,7 @@ void String::setLength(Int32 length, UNICODE_CHAR padChar)
|
|||
else if (length > strLength)
|
||||
{
|
||||
ptrNSString->SetCapacity(length);
|
||||
for(Int32 i=strLength; i < length; i++)
|
||||
for(PRInt32 i=strLength; i < length; i++)
|
||||
ptrNSString->Append((PRUnichar)padChar);
|
||||
}
|
||||
} //-- setLength
|
||||
|
@ -442,7 +442,7 @@ void String::setLength(Int32 length, UNICODE_CHAR padChar)
|
|||
//Delete the "substring" starting at "offset" and proceeding for "count" number
|
||||
//of characters (or until the end of the string, whichever comes first).
|
||||
//
|
||||
void String::deleteChars(Int32 offset, Int32 count)
|
||||
void String::deleteChars(PRInt32 offset, PRInt32 count)
|
||||
{
|
||||
ptrNSString->Cut(offset, count);
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ void String::deleteChars(Int32 offset, Int32 count)
|
|||
//Retrieve the character stored at "index" (starting from 0)
|
||||
//If the index is out of bounds, -1 will be returned.
|
||||
//( PRUnichar nsString::CharAt(PRUint32) )
|
||||
UNICODE_CHAR String::charAt(Int32 index) const
|
||||
UNICODE_CHAR String::charAt(PRInt32 index) const
|
||||
{
|
||||
if ((index < length()) && (index >= 0))
|
||||
return ptrNSString->CharAt(index);
|
||||
|
@ -472,7 +472,7 @@ void String::clear()
|
|||
//Make sure the nsString has room for 'capacity' characters.
|
||||
//( nsString::SetCapacity(PRUint32) )
|
||||
//
|
||||
void String::ensureCapacity(Int32 capacity)
|
||||
void String::ensureCapacity(PRInt32 capacity)
|
||||
{
|
||||
ptrNSString->SetCapacity(capacity);
|
||||
}
|
||||
|
@ -480,9 +480,9 @@ void String::ensureCapacity(Int32 capacity)
|
|||
/**
|
||||
* Performs a CASE SENSITIVE search of the string for the first occurence
|
||||
* of 'data'. If found return the index, else return NOT_FOUND.
|
||||
* -- changed by kvisco to call indexOf(UNICODE_CHAR, Int32)
|
||||
* -- changed by kvisco to call indexOf(UNICODE_CHAR, PRInt32)
|
||||
**/
|
||||
Int32 String::indexOf(UNICODE_CHAR data) const
|
||||
PRInt32 String::indexOf(UNICODE_CHAR data) const
|
||||
{
|
||||
return indexOf(data, 0);
|
||||
} //-- indexOf
|
||||
|
@ -493,9 +493,9 @@ Int32 String::indexOf(UNICODE_CHAR data) const
|
|||
//NOT_FOUND. If the offset is less than zero, then start at zero.
|
||||
//( nsString::FindChar(PRUnichar, PRBool, PRInt32) )
|
||||
//
|
||||
Int32 String::indexOf(UNICODE_CHAR data, Int32 offset) const
|
||||
PRInt32 String::indexOf(UNICODE_CHAR data, PRInt32 offset) const
|
||||
{
|
||||
Int32 searchIndex = offset < 0 ? searchIndex = 0 : searchIndex = offset;
|
||||
PRInt32 searchIndex = offset < 0 ? searchIndex = 0 : searchIndex = offset;
|
||||
|
||||
return ptrNSString->FindChar(data, PR_FALSE, searchIndex);
|
||||
} //-- indexOf
|
||||
|
@ -503,7 +503,7 @@ Int32 String::indexOf(UNICODE_CHAR data, Int32 offset) const
|
|||
//
|
||||
//Returns the index of the first occurence of data.
|
||||
//
|
||||
Int32 String::indexOf(const String& data) const
|
||||
PRInt32 String::indexOf(const String& data) const
|
||||
{
|
||||
return indexOf(data, 0);
|
||||
}
|
||||
|
@ -516,9 +516,9 @@ Int32 String::indexOf(const String& data) const
|
|||
//data's strBuffer, and use that to perform the search.
|
||||
//( nsString::Find(const nsString&, PRBool, PRInt32) )
|
||||
//
|
||||
Int32 String::indexOf(const String& data, Int32 offset) const
|
||||
PRInt32 String::indexOf(const String& data, PRInt32 offset) const
|
||||
{
|
||||
Int32 searchIndex = offset < 0 ? searchIndex = 0 : searchIndex = offset;
|
||||
PRInt32 searchIndex = offset < 0 ? searchIndex = 0 : searchIndex = offset;
|
||||
|
||||
nsString nsStrData((PRUnichar *)data.toUnicode());
|
||||
|
||||
|
@ -564,7 +564,7 @@ MBool String::isEqualIgnoreCase(const String& data) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(UNICODE_CHAR data) const
|
||||
PRInt32 String::lastIndexOf(UNICODE_CHAR data) const
|
||||
{
|
||||
return ptrNSString->RFindChar(data);
|
||||
} //-- lastIndexOf
|
||||
|
@ -576,7 +576,7 @@ Int32 String::lastIndexOf(UNICODE_CHAR data) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(UNICODE_CHAR data, Int32 offset) const
|
||||
PRInt32 String::lastIndexOf(UNICODE_CHAR data, PRInt32 offset) const
|
||||
{
|
||||
return ptrNSString->RFindChar(data, PR_FALSE, offset);
|
||||
} //-- lastIndexOf
|
||||
|
@ -586,7 +586,7 @@ Int32 String::lastIndexOf(UNICODE_CHAR data, Int32 offset) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(const String& data) const
|
||||
PRInt32 String::lastIndexOf(const String& data) const
|
||||
{
|
||||
return lastIndexOf(data, data.length());
|
||||
} //-- lastIndexOf
|
||||
|
@ -600,15 +600,15 @@ Int32 String::lastIndexOf(const String& data) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(const String& data, Int32 offset) const
|
||||
PRInt32 String::lastIndexOf(const String& data, PRInt32 offset) const
|
||||
{
|
||||
nsString nsData((PRUnichar *)data.toUnicode(), data.length());
|
||||
|
||||
return ptrNSString->RFind(nsData, PR_FALSE, offset);
|
||||
}
|
||||
|
||||
//Return the length of this string ( PrInt32 nsString::Length() )
|
||||
Int32 String::length() const
|
||||
//Return the length of this string ( PRInt32 nsString::Length() )
|
||||
PRInt32 String::length() const
|
||||
{
|
||||
if (ptrNSString){
|
||||
return ptrNSString->Length();
|
||||
|
@ -619,7 +619,7 @@ Int32 String::length() const
|
|||
//
|
||||
//Returns a subString starting at start
|
||||
//
|
||||
String& String::subString(Int32 start, String& dest) const
|
||||
String& String::subString(PRInt32 start, String& dest) const
|
||||
{
|
||||
return subString(start, ptrNSString->Length(), dest);
|
||||
}
|
||||
|
@ -632,10 +632,10 @@ String& String::subString(Int32 start, String& dest) const
|
|||
* public interface, to ensure compatiability with all classes derrived from
|
||||
* String.
|
||||
**/
|
||||
String& String::subString(Int32 start, Int32 end, String& dest) const
|
||||
String& String::subString(PRInt32 start, PRInt32 end, String& dest) const
|
||||
{
|
||||
Int32 srcLoop;
|
||||
Int32 strLength = ptrNSString->Length();
|
||||
PRInt32 srcLoop;
|
||||
PRInt32 strLength = ptrNSString->Length();
|
||||
|
||||
start = start < 0? 0 : start;
|
||||
end = end > strLength? strLength : end;
|
||||
|
@ -687,8 +687,8 @@ char* String::toCharArray(char* dest) const
|
|||
**/
|
||||
UNICODE_CHAR* String::toUnicode(UNICODE_CHAR* dest) const
|
||||
{
|
||||
Int32 copyLoop;
|
||||
Int32 strLength = ptrNSString->Length();
|
||||
PRInt32 copyLoop;
|
||||
PRInt32 strLength = ptrNSString->Length();
|
||||
const UNICODE_CHAR* strBuffer = (PRUnichar *)ptrNSString->GetUnicode();
|
||||
|
||||
for (copyLoop=0;copyLoop<strLength;copyLoop++)
|
||||
|
@ -741,8 +741,8 @@ void String::trim()
|
|||
//
|
||||
void String::reverse()
|
||||
{
|
||||
Int32 reverseLoop;
|
||||
Int32 strLength = ptrNSString->Length();
|
||||
PRInt32 reverseLoop;
|
||||
PRInt32 strLength = ptrNSString->Length();
|
||||
UNICODE_CHAR tempChar;
|
||||
|
||||
for (reverseLoop=0;reverseLoop<(strLength/2); reverseLoop++)
|
||||
|
@ -758,9 +758,9 @@ void String::reverse()
|
|||
//Compare the two string representations for equality
|
||||
//
|
||||
MBool String::isEqual(const UNICODE_CHAR* data, const UNICODE_CHAR* search,
|
||||
Int32 length) const
|
||||
PRInt32 length) const
|
||||
{
|
||||
Int32 compLoop = 0;
|
||||
PRInt32 compLoop = 0;
|
||||
|
||||
while (compLoop < length)
|
||||
{
|
||||
|
@ -774,9 +774,9 @@ MBool String::isEqual(const UNICODE_CHAR* data, const UNICODE_CHAR* search,
|
|||
}
|
||||
|
||||
//
|
||||
//Convert an Int32 into a String by storing it in target
|
||||
//Convert an PRInt32 into a String by storing it in target
|
||||
//
|
||||
String& String::ConvertInt(Int32 value, String& target)
|
||||
String& String::ConvertInt(PRInt32 value, String& target)
|
||||
{
|
||||
UNICODE_CHAR charDigit;
|
||||
|
||||
|
@ -797,9 +797,9 @@ String& String::ConvertInt(Int32 value, String& target)
|
|||
//
|
||||
//Calculate the length of a null terminated UNICODE_CHAR string
|
||||
//
|
||||
Int32 String::UnicodeLength(const UNICODE_CHAR* data)
|
||||
PRInt32 String::UnicodeLength(const UNICODE_CHAR* data)
|
||||
{
|
||||
Int32 index = 0;
|
||||
PRInt32 index = 0;
|
||||
|
||||
//Count UNICODE_CHARs Until a Unicode "NULL" is found.
|
||||
while (data[index] != 0x0000)
|
||||
|
|
|
@ -25,13 +25,13 @@
|
|||
* -- fixed memory leak in NamedMap::hashKey method by deleting
|
||||
* up char[] chars;
|
||||
*
|
||||
* $Id: NamedMap.cpp,v 1.8 2001/06/20 06:00:31 margaret.chan%sun.com Exp $
|
||||
* $Id: NamedMap.cpp,v 1.9 2001/06/26 14:08:54 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* A Named Map for TxObjects
|
||||
* @author <a href="kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.8 $ $Date: 2001/06/20 06:00:31 $
|
||||
* @version $Revision: 1.9 $ $Date: 2001/06/26 14:08:54 $
|
||||
**/
|
||||
|
||||
#include "NamedMap.h"
|
||||
|
@ -63,7 +63,7 @@ NamedMap::NamedMap(int size) {
|
|||
/**
|
||||
* Helper method for Constructors
|
||||
**/
|
||||
void NamedMap::initialize(Int32 size) {
|
||||
void NamedMap::initialize(PRInt32 size) {
|
||||
|
||||
//-- by default the NamedMap will not delete it's
|
||||
//-- object references
|
||||
|
@ -73,7 +73,7 @@ void NamedMap::initialize(Int32 size) {
|
|||
elements = new BucketItem*[size];
|
||||
|
||||
//-- initialize all elements to 0;
|
||||
for ( Int32 i = 0; i < size; i++ ) elements[i] = 0;
|
||||
for ( PRInt32 i = 0; i < size; i++ ) elements[i] = 0;
|
||||
|
||||
numberOfBuckets = size;
|
||||
numberOfElements = 0;
|
||||
|
@ -350,13 +350,13 @@ NamedMap::BucketItem* NamedMap::getBucketItem(const String& key) {
|
|||
**/
|
||||
unsigned long NamedMap::hashKey(const String& key) {
|
||||
|
||||
Int32 len = key.length();
|
||||
PRInt32 len = key.length();
|
||||
UNICODE_CHAR* chars = new UNICODE_CHAR[len];
|
||||
key.toUnicode(chars);
|
||||
|
||||
unsigned long hashCode = 0;
|
||||
for (Int32 i = 0; i < len; i++) {
|
||||
hashCode += ((Int32)chars[i]) << 3;
|
||||
for (PRInt32 i = 0; i < len; i++) {
|
||||
hashCode += ((PRInt32)chars[i]) << 3;
|
||||
}
|
||||
delete [] chars;
|
||||
return hashCode;
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: NamedMap.h,v 1.6 2001/04/08 14:36:55 peterv%netscape.com Exp $
|
||||
* $Id: NamedMap.h,v 1.7 2001/06/26 14:08:58 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* A Named Map for TxObjects
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.6 $ $Date: 2001/04/08 14:36:55 $
|
||||
* @version $Revision: 1.7 $ $Date: 2001/06/26 14:08:58 $
|
||||
**/
|
||||
|
||||
#ifndef TRANSFRMX_NAMEDMAP_H
|
||||
|
@ -167,8 +167,8 @@ private:
|
|||
// map table
|
||||
BucketItem** elements;
|
||||
|
||||
Int32 numberOfBuckets;
|
||||
Int32 numberOfElements;
|
||||
PRInt32 numberOfBuckets;
|
||||
PRInt32 numberOfElements;
|
||||
MBool doObjectDeletion;
|
||||
|
||||
//-------------------/
|
||||
|
|
|
@ -85,7 +85,7 @@ MBool StringList::contains(String& search) {
|
|||
/**
|
||||
* Returns the number of Strings in this List
|
||||
**/
|
||||
Int32 StringList::getLength() {
|
||||
PRInt32 StringList::getLength() {
|
||||
return itemCount;
|
||||
} //-- getLength
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
* Bob Miller, kbob@oblix.com
|
||||
* -- plugged core leak.
|
||||
*
|
||||
* $Id: StringList.h,v 1.9 2001/04/08 14:34:37 peterv%netscape.com Exp $
|
||||
* $Id: StringList.h,v 1.10 2001/06/26 14:09:31 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* A class for keeping an ordered list of Strings
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.9 $ $Date: 2001/04/08 14:34:37 $
|
||||
* @version $Revision: 1.10 $ $Date: 2001/06/26 14:09:31 $
|
||||
**/
|
||||
|
||||
#ifndef TRANSFRMX_STRINGLIST_H
|
||||
|
@ -58,7 +58,7 @@ class StringList {
|
|||
/**
|
||||
* Returns the number of Strings in this List
|
||||
**/
|
||||
Int32 getLength();
|
||||
PRInt32 getLength();
|
||||
|
||||
/**
|
||||
* Returns a StringListIterator for this StringList
|
||||
|
@ -92,7 +92,7 @@ private:
|
|||
|
||||
StringListItem* firstItem;
|
||||
StringListItem* lastItem;
|
||||
Int32 itemCount;
|
||||
PRInt32 itemCount;
|
||||
|
||||
void insertAfter(String* strptr, StringListItem* sItem);
|
||||
void insertBefore(String* strptr, StringListItem* sItem);
|
||||
|
|
|
@ -44,15 +44,15 @@
|
|||
* Larry Fitzpartick, OpenText, lef@opentext.com
|
||||
* -- 19990806
|
||||
* -- added void return type declaration for ::nextToken()
|
||||
* -- added proper cast from Int32 to char in ::nextToken()
|
||||
* $Id: Tokenizer.cpp,v 1.2 1999/11/15 07:12:42 nisheeth%netscape.com Exp $
|
||||
* -- added proper cast from PRInt32 to char in ::nextToken()
|
||||
* $Id: Tokenizer.cpp,v 1.3 2001/06/26 14:09:39 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tokenizer
|
||||
* A simple String tokenizer
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.2 $ $Date: 1999/11/15 07:12:42 $
|
||||
* @version $Revision: 1.3 $ $Date: 2001/06/26 14:09:39 $
|
||||
**/
|
||||
|
||||
#include "Tokenizer.h"
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
* Larry Fitzpatrick, OpenText, lef@opentext.com
|
||||
* -- 19990806, added void return type declaration for ::nextToken()
|
||||
*
|
||||
* $Id: Tokenizer.h,v 1.4 2001/04/08 14:38:39 peterv%netscape.com Exp $
|
||||
* $Id: Tokenizer.h,v 1.5 2001/06/26 14:09:44 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tokenizer
|
||||
* A simple String tokenizer
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.4 $ $Date: 2001/04/08 14:38:39 $
|
||||
* @version $Revision: 1.5 $ $Date: 2001/06/26 14:09:44 $
|
||||
**/
|
||||
|
||||
|
||||
|
@ -79,8 +79,8 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
Int32 currentPos;
|
||||
Int32 size;
|
||||
PRInt32 currentPos;
|
||||
PRInt32 size;
|
||||
String str;
|
||||
String delimiters;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: TxObject.h,v 1.4 2001/04/08 14:38:44 peterv%netscape.com Exp $
|
||||
* $Id: TxObject.h,v 1.5 2001/06/26 14:09:57 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -45,8 +45,8 @@ class TxObject {
|
|||
/**
|
||||
* Returns the Hashcode for this TxObject
|
||||
**/
|
||||
virtual Int32 hashCode() {
|
||||
return (Int32)this;
|
||||
virtual PRInt32 hashCode() {
|
||||
return (PRInt32)this;
|
||||
} //-- hashCode
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ String::String()
|
|||
//
|
||||
//Create an empty String of a specific size
|
||||
//
|
||||
String::String(Int32 initSize)
|
||||
String::String(PRInt32 initSize)
|
||||
{
|
||||
strBuffer = new UNICODE_CHAR[initSize];
|
||||
bufferLength = initSize;
|
||||
|
@ -59,7 +59,7 @@ String::String(Int32 initSize)
|
|||
//
|
||||
String::String(const String& source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
//Allocate space for the source string
|
||||
strLength = source.length();
|
||||
|
@ -81,7 +81,7 @@ String::String(const String& source)
|
|||
//
|
||||
String::String(const char* source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
if (source)
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ String::String(const char* source)
|
|||
//Also make sure to pick up the null terminator at the end of the char
|
||||
//array.
|
||||
for (copyLoop=0; copyLoop<strLength; copyLoop++)
|
||||
strBuffer[copyLoop] = (Int32)source[copyLoop];
|
||||
strBuffer[copyLoop] = (PRInt32)source[copyLoop];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ String::String(const char* source)
|
|||
//
|
||||
String::String(const UNICODE_CHAR* source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
if (source)
|
||||
{
|
||||
|
@ -139,9 +139,9 @@ String::String(const UNICODE_CHAR* source)
|
|||
//
|
||||
//Create a String from a UNICODE_CHAR buffer and a supplied string length
|
||||
//
|
||||
String::String(const UNICODE_CHAR* source, Int32 length)
|
||||
String::String(const UNICODE_CHAR* source, PRInt32 length)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
if (source)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ String::~String()
|
|||
//
|
||||
ostream& operator<<(ostream& output, const String& source)
|
||||
{
|
||||
Int32 outputLoop;
|
||||
PRInt32 outputLoop;
|
||||
|
||||
for (outputLoop=0;outputLoop<source.length();outputLoop++)
|
||||
output << (char)source.charAt(outputLoop);
|
||||
|
@ -200,7 +200,7 @@ ostream& operator<<(ostream& output, const String& source)
|
|||
//
|
||||
String& String::operator=(const String& source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
//Make sure string is not being copied onto itself
|
||||
if (&source != this) {
|
||||
//Check to see if this string is already big enough for source
|
||||
|
@ -222,8 +222,8 @@ String& String::operator=(const String& source)
|
|||
//
|
||||
String& String::operator=(const char* source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
Int32 sourceLength;
|
||||
PRInt32 copyLoop;
|
||||
PRInt32 sourceLength;
|
||||
|
||||
if (source)
|
||||
{
|
||||
|
@ -247,8 +247,8 @@ String& String::operator=(const char* source)
|
|||
//
|
||||
String& String::operator=(const UNICODE_CHAR* source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
Int32 sourceLength;
|
||||
PRInt32 copyLoop;
|
||||
PRInt32 sourceLength;
|
||||
|
||||
if (source)
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ String& String::operator=(const UNICODE_CHAR* source)
|
|||
//
|
||||
//Overloaded '=' operator to assign an integer to this string.
|
||||
//
|
||||
String& String::operator=(Int32 source)
|
||||
String& String::operator=(PRInt32 source)
|
||||
{
|
||||
ConvertInt(source, *this);
|
||||
return *this; //-- added, LF
|
||||
|
@ -302,7 +302,7 @@ void String::append(char source)
|
|||
//
|
||||
void String::append(const String& source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
//Enlarge buffer to fit string if necessary
|
||||
ensureCapacity(source.length());
|
||||
|
@ -320,8 +320,8 @@ void String::append(const String& source)
|
|||
//
|
||||
void String::append(const char* source)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
Int32 initLength = strlen(source);
|
||||
PRInt32 copyLoop;
|
||||
PRInt32 initLength = strlen(source);
|
||||
|
||||
//Enlarge buffer to fit new string if necessary
|
||||
ensureCapacity(initLength);
|
||||
|
@ -346,9 +346,9 @@ void String::append(const UNICODE_CHAR* source)
|
|||
//
|
||||
//Append a string of DOM Characters whose length is also defined
|
||||
//
|
||||
void String::append(const UNICODE_CHAR* source, Int32 length)
|
||||
void String::append(const UNICODE_CHAR* source, PRInt32 length)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
//Enlarge buffer to fit new string if necessary
|
||||
ensureCapacity(length);
|
||||
|
@ -365,7 +365,7 @@ void String::append(const UNICODE_CHAR* source, Int32 length)
|
|||
//Convert source from an integer to a string, and append it to the current
|
||||
//string
|
||||
//
|
||||
void String::append(Int32 source)
|
||||
void String::append(PRInt32 source)
|
||||
{
|
||||
String convertString;
|
||||
|
||||
|
@ -375,10 +375,10 @@ void String::append(Int32 source)
|
|||
//
|
||||
//Insert a single UNICODE_CHAR into the string starting at offset
|
||||
//
|
||||
void String::insert(Int32 offset, const UNICODE_CHAR source)
|
||||
void String::insert(PRInt32 offset, const UNICODE_CHAR source)
|
||||
{
|
||||
Int32 moveLoop;
|
||||
Int32 moveIndex;
|
||||
PRInt32 moveLoop;
|
||||
PRInt32 moveIndex;
|
||||
|
||||
offset = offset < 0 ? 0 : offset;
|
||||
|
||||
|
@ -404,7 +404,7 @@ void String::insert(Int32 offset, const UNICODE_CHAR source)
|
|||
//
|
||||
//Insert a single C type character into the string starting at offset
|
||||
//
|
||||
void String::insert(Int32 offset, const char source)
|
||||
void String::insert(PRInt32 offset, const char source)
|
||||
{
|
||||
insert(offset, (UNICODE_CHAR)source);
|
||||
}
|
||||
|
@ -414,11 +414,11 @@ void String::insert(Int32 offset, const char source)
|
|||
//TK 12/09/1999 - Modified to use the "source" String's public interface only,
|
||||
// to ensure compatibility with subclasses of String
|
||||
//
|
||||
void String::insert(Int32 offset, const String& source)
|
||||
void String::insert(PRInt32 offset, const String& source)
|
||||
{
|
||||
Int32 moveLoop;
|
||||
Int32 moveIndex;
|
||||
Int32 copyLoop;
|
||||
PRInt32 moveLoop;
|
||||
PRInt32 moveIndex;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
offset = offset < 0 ? 0 : offset;
|
||||
|
||||
|
@ -447,12 +447,12 @@ void String::insert(Int32 offset, const String& source)
|
|||
//
|
||||
//Insert the source "C" type string into this string starting at offset
|
||||
//
|
||||
void String::insert(Int32 offset, const char* source)
|
||||
void String::insert(PRInt32 offset, const char* source)
|
||||
{
|
||||
Int32 moveLoop;
|
||||
Int32 moveIndex;
|
||||
Int32 copyLoop;
|
||||
Int32 sourceLength;
|
||||
PRInt32 moveLoop;
|
||||
PRInt32 moveIndex;
|
||||
PRInt32 copyLoop;
|
||||
PRInt32 sourceLength;
|
||||
|
||||
offset = offset < 0 ? 0 : offset;
|
||||
|
||||
|
@ -483,17 +483,17 @@ void String::insert(Int32 offset, const char* source)
|
|||
//Insert the source UNICODE_CHAR type string into this string starting at
|
||||
//offset. Note that the source is Null Terminated.
|
||||
//
|
||||
void String::insert(Int32 offset, const UNICODE_CHAR* source)
|
||||
void String::insert(PRInt32 offset, const UNICODE_CHAR* source)
|
||||
{
|
||||
insert(offset, source, UnicodeLength(source));
|
||||
}
|
||||
|
||||
void String::insert(Int32 offset, const UNICODE_CHAR* source,
|
||||
Int32 sourceLength)
|
||||
void String::insert(PRInt32 offset, const UNICODE_CHAR* source,
|
||||
PRInt32 sourceLength)
|
||||
{
|
||||
Int32 moveLoop;
|
||||
Int32 moveIndex;
|
||||
Int32 copyLoop;
|
||||
PRInt32 moveLoop;
|
||||
PRInt32 moveIndex;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
offset = offset < 0 ? 0 : offset;
|
||||
|
||||
|
@ -522,7 +522,7 @@ void String::insert(Int32 offset, const UNICODE_CHAR* source,
|
|||
//
|
||||
//Convert source from an integer to a string, and then insert.
|
||||
//
|
||||
void String::insert(Int32 offset, Int32 source)
|
||||
void String::insert(PRInt32 offset, PRInt32 source)
|
||||
{
|
||||
String convertString;
|
||||
|
||||
|
@ -532,7 +532,7 @@ void String::insert(Int32 offset, Int32 source)
|
|||
//
|
||||
//Replace the character specified by offset with the UNICODE_CHAR source
|
||||
//
|
||||
void String::replace(Int32 offset, const UNICODE_CHAR source)
|
||||
void String::replace(PRInt32 offset, const UNICODE_CHAR source)
|
||||
{
|
||||
offset = offset < 0 ? 0 : offset;
|
||||
|
||||
|
@ -547,7 +547,7 @@ void String::replace(Int32 offset, const UNICODE_CHAR source)
|
|||
//
|
||||
//Replace the character specified by offset with the C style character source
|
||||
//
|
||||
void String::replace(Int32 offset, const char source)
|
||||
void String::replace(PRInt32 offset, const char source)
|
||||
{
|
||||
replace(offset, (UNICODE_CHAR)source);
|
||||
}
|
||||
|
@ -559,10 +559,10 @@ void String::replace(Int32 offset, const char source)
|
|||
//TK 12/09/1999 - Modified to use the "source" String's public interface only,
|
||||
// to ensure compatibility with classes derived from String
|
||||
//
|
||||
void String::replace(Int32 offset, const String& source)
|
||||
void String::replace(PRInt32 offset, const String& source)
|
||||
{
|
||||
Int32 totalOffset = 0;
|
||||
Int32 replaceLoop;
|
||||
PRInt32 totalOffset = 0;
|
||||
PRInt32 replaceLoop;
|
||||
|
||||
if (offset < strLength)
|
||||
{
|
||||
|
@ -587,11 +587,11 @@ void String::replace(Int32 offset, const String& source)
|
|||
//enlarge the string buffer if source will require more characters than
|
||||
//currently available.
|
||||
//
|
||||
void String::replace(Int32 offset, const char* source)
|
||||
void String::replace(PRInt32 offset, const char* source)
|
||||
{
|
||||
Int32 totalOffset = 0;
|
||||
Int32 replaceLoop;
|
||||
Int32 sourceLength;
|
||||
PRInt32 totalOffset = 0;
|
||||
PRInt32 replaceLoop;
|
||||
PRInt32 sourceLength;
|
||||
|
||||
if (offset < strLength)
|
||||
{
|
||||
|
@ -619,7 +619,7 @@ void String::replace(Int32 offset, const char* source)
|
|||
//TK 12/21/1999 - Simply deffer functionality to the replace function
|
||||
// below (accepting a length for the Unicode buffer).
|
||||
//
|
||||
void String::replace(Int32 offset, const UNICODE_CHAR* source)
|
||||
void String::replace(PRInt32 offset, const UNICODE_CHAR* source)
|
||||
{
|
||||
replace(offset, source, UnicodeLength(source));
|
||||
}
|
||||
|
@ -629,10 +629,10 @@ void String::replace(Int32 offset, const UNICODE_CHAR* source)
|
|||
//enlarge the string buffer if source will require more characters than
|
||||
//currently available.
|
||||
//
|
||||
void String::replace(Int32 offset, const UNICODE_CHAR* source, Int32 srcLength)
|
||||
void String::replace(PRInt32 offset, const UNICODE_CHAR* source, PRInt32 srcLength)
|
||||
{
|
||||
Int32 totalOffset = 0;
|
||||
Int32 replaceLoop;
|
||||
PRInt32 totalOffset = 0;
|
||||
PRInt32 replaceLoop;
|
||||
|
||||
if (offset < strLength)
|
||||
{
|
||||
|
@ -656,7 +656,7 @@ void String::replace(Int32 offset, const UNICODE_CHAR* source, Int32 srcLength)
|
|||
//
|
||||
//Convert source from an integer to a String, and perform a replacement.
|
||||
//
|
||||
void String::replace(Int32 offset, Int32 source)
|
||||
void String::replace(PRInt32 offset, PRInt32 source)
|
||||
{
|
||||
String convertString;
|
||||
|
||||
|
@ -669,7 +669,7 @@ void String::replace(Int32 offset, Int32 source)
|
|||
* and padded with '\0' null characters. Otherwise the String
|
||||
* will be truncated
|
||||
**/
|
||||
void String::setLength(Int32 length) {
|
||||
void String::setLength(PRInt32 length) {
|
||||
setLength(length, '\0');
|
||||
} //-- setLength
|
||||
|
||||
|
@ -679,12 +679,12 @@ void String::setLength(Int32 length) {
|
|||
* and padded with given pad character. Otherwise the String
|
||||
* will be truncated
|
||||
**/
|
||||
void String::setLength(Int32 length, UNICODE_CHAR padChar) {
|
||||
void String::setLength(PRInt32 length, UNICODE_CHAR padChar) {
|
||||
if ( length < 0 ) strLength = 0;
|
||||
else if ( length > strLength ) {
|
||||
Int32 diff = length-strLength;
|
||||
PRInt32 diff = length-strLength;
|
||||
ensureCapacity(diff);
|
||||
for ( Int32 i = strLength; i < length; i++ )
|
||||
for ( PRInt32 i = strLength; i < length; i++ )
|
||||
strBuffer[i] = padChar;
|
||||
strLength = length;
|
||||
}
|
||||
|
@ -695,10 +695,10 @@ void String::setLength(Int32 length, UNICODE_CHAR padChar) {
|
|||
//Delete the "substring" starting at "offset" and proceeding for "count" number
|
||||
//of characters (or until the end of the string, whichever comes first).
|
||||
//
|
||||
void String::deleteChars(Int32 offset, Int32 count)
|
||||
void String::deleteChars(PRInt32 offset, PRInt32 count)
|
||||
{
|
||||
Int32 deleteLoop;
|
||||
Int32 offsetCount;
|
||||
PRInt32 deleteLoop;
|
||||
PRInt32 offsetCount;
|
||||
|
||||
offset = offset < 0 ? 0 : offset;
|
||||
offsetCount = offset + count;
|
||||
|
@ -719,7 +719,7 @@ void String::deleteChars(Int32 offset, Int32 count)
|
|||
* Returns the character at index.
|
||||
* If the index is out of bounds, -1 will be returned.
|
||||
**/
|
||||
UNICODE_CHAR String::charAt(Int32 index) const
|
||||
UNICODE_CHAR String::charAt(PRInt32 index) const
|
||||
{
|
||||
if ((index < strLength) && (index >= 0))
|
||||
return strBuffer[index];
|
||||
|
@ -739,12 +739,12 @@ void String::clear()
|
|||
//
|
||||
//Make sure the buffer has room for 'capacity' UNICODE_CHARS.
|
||||
//
|
||||
void String::ensureCapacity(Int32 capacity)
|
||||
void String::ensureCapacity(PRInt32 capacity)
|
||||
{
|
||||
UNICODE_CHAR* tempStrBuffer = NULL;
|
||||
|
||||
//Check for the desired capacity
|
||||
Int32 freeSpace = bufferLength - strLength; //(added by kvisco)
|
||||
PRInt32 freeSpace = bufferLength - strLength; //(added by kvisco)
|
||||
|
||||
if (freeSpace < capacity) {
|
||||
|
||||
|
@ -767,9 +767,9 @@ void String::ensureCapacity(Int32 capacity)
|
|||
/**
|
||||
* Performs a CASE SENSITIVE search of the string for the first occurence
|
||||
* of 'data'. If found return the index, else return NOT_FOUND.
|
||||
* -- changed by kvisco to call indexOf(UNICODE_CHAR, Int32)
|
||||
* -- changed by kvisco to call indexOf(UNICODE_CHAR, PRInt32)
|
||||
**/
|
||||
Int32 String::indexOf(UNICODE_CHAR data) const
|
||||
PRInt32 String::indexOf(UNICODE_CHAR data) const
|
||||
{
|
||||
return indexOf(data, 0);
|
||||
} //-- indexOf
|
||||
|
@ -779,9 +779,9 @@ Int32 String::indexOf(UNICODE_CHAR data) const
|
|||
//for the first occurence of 'data'. If found return the index, else return
|
||||
//NOT_FOUND. If the offset is less than zero, then start at zero.
|
||||
//
|
||||
Int32 String::indexOf(UNICODE_CHAR data, Int32 offset) const
|
||||
PRInt32 String::indexOf(UNICODE_CHAR data, PRInt32 offset) const
|
||||
{
|
||||
Int32 searchIndex = offset < 0 ? searchIndex = 0 : searchIndex = offset;
|
||||
PRInt32 searchIndex = offset < 0 ? searchIndex = 0 : searchIndex = offset;
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -796,9 +796,9 @@ Int32 String::indexOf(UNICODE_CHAR data, Int32 offset) const
|
|||
|
||||
//
|
||||
//Returns the index of the first occurence of data
|
||||
//TK 12/09/1999 - Modified to simply use indexOf(const String&, Int32).
|
||||
//TK 12/09/1999 - Modified to simply use indexOf(const String&, PRInt32).
|
||||
//
|
||||
Int32 String::indexOf(const String& data) const
|
||||
PRInt32 String::indexOf(const String& data) const
|
||||
{
|
||||
return indexOf(data, 0);
|
||||
}
|
||||
|
@ -809,9 +809,9 @@ Int32 String::indexOf(const String& data) const
|
|||
// retreive the Unicode Char buffer when calling isEqual.
|
||||
// This ensures compatibility with classes derrived from String.
|
||||
//
|
||||
Int32 String::indexOf(const String& data, Int32 offset) const
|
||||
PRInt32 String::indexOf(const String& data, PRInt32 offset) const
|
||||
{
|
||||
Int32 searchIndex = offset < 0 ? 0 : offset;
|
||||
PRInt32 searchIndex = offset < 0 ? 0 : offset;
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -848,7 +848,7 @@ MBool String::isEqual(const String& data) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(UNICODE_CHAR data) const
|
||||
PRInt32 String::lastIndexOf(UNICODE_CHAR data) const
|
||||
{
|
||||
return lastIndexOf(data, strLength-1);
|
||||
} //-- lastIndexOf
|
||||
|
@ -858,11 +858,11 @@ Int32 String::lastIndexOf(UNICODE_CHAR data) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(UNICODE_CHAR data, Int32 offset) const
|
||||
PRInt32 String::lastIndexOf(UNICODE_CHAR data, PRInt32 offset) const
|
||||
{
|
||||
if ((offset < 0) || (offset >= strLength)) return NOT_FOUND;
|
||||
|
||||
Int32 searchIndex = offset;
|
||||
PRInt32 searchIndex = offset;
|
||||
while (searchIndex >= 0) {
|
||||
if (strBuffer[searchIndex] == data) return searchIndex;
|
||||
--searchIndex;
|
||||
|
@ -876,7 +876,7 @@ Int32 String::lastIndexOf(UNICODE_CHAR data, Int32 offset) const
|
|||
* <BR />
|
||||
* Added implementation 19990729 (kvisco)
|
||||
**/
|
||||
Int32 String::lastIndexOf(const String& data) const
|
||||
PRInt32 String::lastIndexOf(const String& data) const
|
||||
{
|
||||
return lastIndexOf(data, strLength-1);
|
||||
} //-- lastIndexOf
|
||||
|
@ -887,9 +887,9 @@ Int32 String::lastIndexOf(const String& data) const
|
|||
* Added implementation 19990729 (kvisco)
|
||||
* TK 12/09/1999 - Completed implementation...
|
||||
**/
|
||||
Int32 String::lastIndexOf(const String& data, Int32 offset) const
|
||||
PRInt32 String::lastIndexOf(const String& data, PRInt32 offset) const
|
||||
{
|
||||
Int32 searchIndex;
|
||||
PRInt32 searchIndex;
|
||||
const UNICODE_CHAR* dataStrBuffer = NULL;
|
||||
|
||||
if ((offset < 0) || (offset >= strLength))
|
||||
|
@ -917,16 +917,16 @@ Int32 String::lastIndexOf(const String& data, Int32 offset) const
|
|||
//
|
||||
//Returns the length of the String
|
||||
//
|
||||
Int32 String::length() const
|
||||
PRInt32 String::length() const
|
||||
{
|
||||
return strLength;
|
||||
}
|
||||
|
||||
//
|
||||
//Returns a subString starting at start
|
||||
//TK 12/09/1999 - Modified to simply use subString(Int32, Int32, String&)
|
||||
//TK 12/09/1999 - Modified to simply use subString(PRInt32, PRInt32, String&)
|
||||
//
|
||||
String& String::subString(Int32 start, String& dest) const
|
||||
String& String::subString(PRInt32 start, String& dest) const
|
||||
{
|
||||
return subString(start, strLength, dest);
|
||||
}
|
||||
|
@ -937,10 +937,10 @@ String& String::subString(Int32 start, String& dest) const
|
|||
* TK 12/09/1999 - Modified to use the "dest" String's public interface to
|
||||
* ensure compatibility wtih derrived classes.
|
||||
**/
|
||||
String& String::subString(Int32 start, Int32 end, String& dest) const
|
||||
String& String::subString(PRInt32 start, PRInt32 end, String& dest) const
|
||||
{
|
||||
Int32 srcLoop;
|
||||
Int32 destLoop = 0;
|
||||
PRInt32 srcLoop;
|
||||
PRInt32 destLoop = 0;
|
||||
|
||||
start = start < 0? 0 : start;
|
||||
end = end > strLength? strLength : end;
|
||||
|
@ -975,7 +975,7 @@ char* String::toCharArray() const
|
|||
**/
|
||||
char* String::toCharArray(char* dest) const
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
for (copyLoop=0;copyLoop<strLength;copyLoop++)
|
||||
dest[copyLoop] = strBuffer[copyLoop];
|
||||
|
@ -993,7 +993,7 @@ char* String::toCharArray(char* dest) const
|
|||
**/
|
||||
UNICODE_CHAR* String::toUnicode(UNICODE_CHAR* dest) const
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
for (copyLoop=0;copyLoop<strLength;copyLoop++)
|
||||
dest[copyLoop] = strBuffer[copyLoop];
|
||||
|
@ -1017,7 +1017,7 @@ const UNICODE_CHAR* String::toUnicode() const
|
|||
//
|
||||
void String::toLowerCase()
|
||||
{
|
||||
Int32 conversionLoop;
|
||||
PRInt32 conversionLoop;
|
||||
|
||||
for (conversionLoop=0;conversionLoop<strLength;conversionLoop++)
|
||||
{
|
||||
|
@ -1032,7 +1032,7 @@ void String::toLowerCase()
|
|||
//
|
||||
void String::toUpperCase()
|
||||
{
|
||||
Int32 conversionLoop;
|
||||
PRInt32 conversionLoop;
|
||||
|
||||
for (conversionLoop=0;conversionLoop<strLength;conversionLoop++)
|
||||
{
|
||||
|
@ -1047,8 +1047,8 @@ void String::toUpperCase()
|
|||
//
|
||||
void String::trim()
|
||||
{
|
||||
Int32 trimLoop = strLength - 1;
|
||||
Int32 cutLoop;
|
||||
PRInt32 trimLoop = strLength - 1;
|
||||
PRInt32 cutLoop;
|
||||
MBool done = MB_FALSE;
|
||||
|
||||
//As long as we are not working on an emtpy string, trim from the right
|
||||
|
@ -1113,7 +1113,7 @@ void String::trim()
|
|||
//
|
||||
void String::reverse()
|
||||
{
|
||||
Int32 reverseLoop;
|
||||
PRInt32 reverseLoop;
|
||||
UNICODE_CHAR tempChar;
|
||||
|
||||
for (reverseLoop=0;reverseLoop<(strLength/2); reverseLoop++)
|
||||
|
@ -1129,7 +1129,7 @@ void String::reverse()
|
|||
//
|
||||
void String::copyString(UNICODE_CHAR* dest)
|
||||
{
|
||||
Int32 copyLoop;
|
||||
PRInt32 copyLoop;
|
||||
|
||||
for (copyLoop=0;copyLoop<strLength;copyLoop++)
|
||||
dest[copyLoop] = strBuffer[copyLoop];
|
||||
|
@ -1139,9 +1139,9 @@ void String::copyString(UNICODE_CHAR* dest)
|
|||
//Compare the two string representations for equality
|
||||
//
|
||||
MBool String::isEqual(const UNICODE_CHAR* data, const UNICODE_CHAR* search,
|
||||
Int32 length) const
|
||||
PRInt32 length) const
|
||||
{
|
||||
Int32 compLoop = 0;
|
||||
PRInt32 compLoop = 0;
|
||||
|
||||
while (compLoop < length)
|
||||
{
|
||||
|
@ -1155,9 +1155,9 @@ MBool String::isEqual(const UNICODE_CHAR* data, const UNICODE_CHAR* search,
|
|||
}
|
||||
|
||||
//
|
||||
//Convert an Int32 into a String by storing it in target
|
||||
//Convert an PRInt32 into a String by storing it in target
|
||||
//
|
||||
String& String::ConvertInt(Int32 value, String& target)
|
||||
String& String::ConvertInt(PRInt32 value, String& target)
|
||||
{
|
||||
UNICODE_CHAR charDigit;
|
||||
|
||||
|
@ -1178,9 +1178,9 @@ String& String::ConvertInt(Int32 value, String& target)
|
|||
//
|
||||
//Calculate the length of a null terminated UNICODE_CHAR string
|
||||
//
|
||||
Int32 String::UnicodeLength(const UNICODE_CHAR* data)
|
||||
PRInt32 String::UnicodeLength(const UNICODE_CHAR* data)
|
||||
{
|
||||
Int32 index = 0;
|
||||
PRInt32 index = 0;
|
||||
|
||||
//Count UNICODE_CHARs Until a Unicode "NULL" is found.
|
||||
while (data[index] != 0x0000)
|
||||
|
|
|
@ -52,11 +52,11 @@ class String : public TxObject
|
|||
|
||||
public:
|
||||
String(); //Default Constructor, create an empty string
|
||||
String(Int32 initSize); //Create an empty string of a specific size
|
||||
String(PRInt32 initSize); //Create an empty string of a specific size
|
||||
String(const String& source); //Create a copy of the source string
|
||||
String(const char* source); //Create a string from the characters
|
||||
String(const UNICODE_CHAR* source);
|
||||
String(const UNICODE_CHAR* source, Int32 length);
|
||||
String(const UNICODE_CHAR* source, PRInt32 length);
|
||||
#ifndef TX_EXE
|
||||
String(nsString* theNSString);
|
||||
#endif
|
||||
|
@ -68,7 +68,7 @@ class String : public TxObject
|
|||
virtual String& operator=(const String& source);
|
||||
virtual String& operator=(const char* source);
|
||||
virtual String& operator=(const UNICODE_CHAR* source);
|
||||
virtual String& operator=(Int32 source);
|
||||
virtual String& operator=(PRInt32 source);
|
||||
|
||||
//Grow buffer if necessary and append the source
|
||||
virtual void append(UNICODE_CHAR source);
|
||||
|
@ -76,48 +76,48 @@ class String : public TxObject
|
|||
virtual void append(const String& source);
|
||||
virtual void append(const char* source);
|
||||
virtual void append(const UNICODE_CHAR* source);
|
||||
virtual void append(const UNICODE_CHAR* source, Int32 length);
|
||||
virtual void append(Int32 source);
|
||||
virtual void append(const UNICODE_CHAR* source, PRInt32 length);
|
||||
virtual void append(PRInt32 source);
|
||||
|
||||
//Provide the ability to insert data into the middle of a string
|
||||
virtual void insert(Int32 offset, const UNICODE_CHAR source);
|
||||
virtual void insert(Int32 offset, const char source);
|
||||
virtual void insert(Int32 offset, const String& source);
|
||||
virtual void insert(Int32 offset, const char* source);
|
||||
virtual void insert(Int32 offset, const UNICODE_CHAR* source);
|
||||
virtual void insert(Int32 offset, const UNICODE_CHAR* source,
|
||||
Int32 sourceLength);
|
||||
virtual void insert(Int32 offset, Int32 source);
|
||||
virtual void insert(PRInt32 offset, const UNICODE_CHAR source);
|
||||
virtual void insert(PRInt32 offset, const char source);
|
||||
virtual void insert(PRInt32 offset, const String& source);
|
||||
virtual void insert(PRInt32 offset, const char* source);
|
||||
virtual void insert(PRInt32 offset, const UNICODE_CHAR* source);
|
||||
virtual void insert(PRInt32 offset, const UNICODE_CHAR* source,
|
||||
PRInt32 sourceLength);
|
||||
virtual void insert(PRInt32 offset, PRInt32 source);
|
||||
|
||||
//Provide the ability to replace one or more characters
|
||||
virtual void replace(Int32 offset, const UNICODE_CHAR source);
|
||||
virtual void replace(Int32 offset, const char source);
|
||||
virtual void replace(Int32 offset, const String& source);
|
||||
virtual void replace(Int32 offset, const char* source);
|
||||
virtual void replace(Int32 offset, const UNICODE_CHAR* source);
|
||||
virtual void replace(Int32 offset, const UNICODE_CHAR* source,
|
||||
Int32 srcLength);
|
||||
virtual void replace(Int32 offset, Int32 source);
|
||||
virtual void replace(PRInt32 offset, const UNICODE_CHAR source);
|
||||
virtual void replace(PRInt32 offset, const char source);
|
||||
virtual void replace(PRInt32 offset, const String& source);
|
||||
virtual void replace(PRInt32 offset, const char* source);
|
||||
virtual void replace(PRInt32 offset, const UNICODE_CHAR* source);
|
||||
virtual void replace(PRInt32 offset, const UNICODE_CHAR* source,
|
||||
PRInt32 srcLength);
|
||||
virtual void replace(PRInt32 offset, PRInt32 source);
|
||||
|
||||
//Provide the ability to delete a range of charactes
|
||||
virtual void deleteChars(Int32 offset, Int32 count);
|
||||
virtual void deleteChars(PRInt32 offset, PRInt32 count);
|
||||
|
||||
/**
|
||||
* Returns the character at index.
|
||||
* If the index is out of bounds, -1 will be returned.
|
||||
**/
|
||||
virtual UNICODE_CHAR charAt(Int32 index) const;
|
||||
virtual UNICODE_CHAR charAt(PRInt32 index) const;
|
||||
|
||||
virtual void clear(); //Clear string
|
||||
|
||||
virtual void ensureCapacity(Int32 capacity); //Make sure buffer is at least
|
||||
virtual void ensureCapacity(PRInt32 capacity); //Make sure buffer is at least
|
||||
//'size'
|
||||
|
||||
//Returns index of first occurrence of data
|
||||
virtual Int32 indexOf(UNICODE_CHAR data) const;
|
||||
virtual Int32 indexOf(UNICODE_CHAR data, Int32 offset) const;
|
||||
virtual Int32 indexOf(const String& data) const;
|
||||
virtual Int32 indexOf(const String& data, Int32 offset) const;
|
||||
virtual PRInt32 indexOf(UNICODE_CHAR data) const;
|
||||
virtual PRInt32 indexOf(UNICODE_CHAR data, PRInt32 offset) const;
|
||||
virtual PRInt32 indexOf(const String& data) const;
|
||||
virtual PRInt32 indexOf(const String& data, PRInt32 offset) const;
|
||||
|
||||
virtual MBool isEqual(const String& data) const; //Check equality between
|
||||
//strings
|
||||
|
@ -126,12 +126,12 @@ class String : public TxObject
|
|||
#endif
|
||||
|
||||
//Returns index of last occurrence of data
|
||||
virtual Int32 lastIndexOf(UNICODE_CHAR data) const;
|
||||
virtual Int32 lastIndexOf(UNICODE_CHAR data, Int32 offset) const;
|
||||
virtual Int32 lastIndexOf(const String& data) const;
|
||||
virtual Int32 lastIndexOf(const String& data, Int32 offset) const;
|
||||
virtual PRInt32 lastIndexOf(UNICODE_CHAR data) const;
|
||||
virtual PRInt32 lastIndexOf(UNICODE_CHAR data, PRInt32 offset) const;
|
||||
virtual PRInt32 lastIndexOf(const String& data) const;
|
||||
virtual PRInt32 lastIndexOf(const String& data, PRInt32 offset) const;
|
||||
|
||||
virtual Int32 length() const; //Returns the length
|
||||
virtual PRInt32 length() const; //Returns the length
|
||||
|
||||
/**
|
||||
* Sets the Length of this String, if length is less than 0, it will
|
||||
|
@ -139,7 +139,7 @@ class String : public TxObject
|
|||
* and padded with '\0' null characters. Otherwise the String
|
||||
* will be truncated
|
||||
**/
|
||||
virtual void setLength(Int32 length);
|
||||
virtual void setLength(PRInt32 length);
|
||||
|
||||
/**
|
||||
* Sets the Length of this String, if length is less than 0, it will
|
||||
|
@ -147,19 +147,19 @@ class String : public TxObject
|
|||
* and padded with given pad character. Otherwise the String
|
||||
* will be truncated
|
||||
**/
|
||||
virtual void setLength(Int32 length, UNICODE_CHAR padChar);
|
||||
virtual void setLength(PRInt32 length, UNICODE_CHAR padChar);
|
||||
|
||||
/**
|
||||
* Returns a substring starting at start
|
||||
* Note: the dest String is cleared before use
|
||||
**/
|
||||
virtual String& subString(Int32 start, String& dest) const;
|
||||
virtual String& subString(PRInt32 start, String& dest) const;
|
||||
|
||||
/**
|
||||
* Returns the subString starting at start and ending at end
|
||||
* Note: the dest String is cleared before use
|
||||
**/
|
||||
virtual String& subString(Int32 start, Int32 end, String& dest) const;
|
||||
virtual String& subString(PRInt32 start, PRInt32 end, String& dest) const;
|
||||
|
||||
//Convert the internal rep. to a char buffer
|
||||
virtual char* toCharArray() const;
|
||||
|
@ -181,17 +181,17 @@ class String : public TxObject
|
|||
protected:
|
||||
//Convert an Int into a String
|
||||
//TK 12/09/1999 - Make this function available to Derrived classes
|
||||
String& ConvertInt(Int32 value, String& target);
|
||||
String& ConvertInt(PRInt32 value, String& target);
|
||||
|
||||
//Calculates the length of a null terminated UNICODE_CHAR array
|
||||
Int32 UnicodeLength(const UNICODE_CHAR* data);
|
||||
PRInt32 UnicodeLength(const UNICODE_CHAR* data);
|
||||
|
||||
private:
|
||||
#ifndef TX_EXE
|
||||
nsString* ptrNSString;
|
||||
#else
|
||||
Int32 strLength;
|
||||
Int32 bufferLength;
|
||||
PRInt32 strLength;
|
||||
PRInt32 bufferLength;
|
||||
UNICODE_CHAR* strBuffer;
|
||||
#endif
|
||||
|
||||
|
@ -200,7 +200,7 @@ class String : public TxObject
|
|||
|
||||
//Compare the two string representations for equality
|
||||
MBool isEqual(const UNICODE_CHAR* data, const UNICODE_CHAR* search,
|
||||
Int32 length) const;
|
||||
PRInt32 length) const;
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& output, const String& source);
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
* -- original author.
|
||||
*
|
||||
* Tom Kneeland, tomk@mitre.org
|
||||
* -- added UInt32 to provide a common unsigned integer
|
||||
* -- added PRUint32 to provide a common unsigned integer
|
||||
*
|
||||
* $Id: baseutils.h,v 1.7 2001/06/15 11:12:14 sicking%bigfoot.com Exp $
|
||||
* $Id: baseutils.h,v 1.8 2001/06/26 14:07:22 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
// Basic Definitions used throughout many of these classes
|
||||
|
@ -33,29 +33,34 @@
|
|||
#ifndef TRANSFRMX_BASEUTILS_H
|
||||
#define TRANSFRMX_BASEUTILS_H
|
||||
|
||||
typedef int Int32;
|
||||
#ifndef __MACTYPES__
|
||||
typedef unsigned int UInt32;
|
||||
#endif
|
||||
|
||||
#ifdef TX_EXE
|
||||
// Standalone
|
||||
typedef int PRInt32;
|
||||
typedef unsigned int PRUint32;
|
||||
|
||||
#ifdef DEBUG
|
||||
#define NS_ASSERTION(_cond, _msg) \
|
||||
if(!(_cond)) { \
|
||||
cerr << "ASSERTION (" << #_cond << ") " << _msg << endl; \
|
||||
cerr << "on line " << __LINE__ << " in " << __FILE__ << endl; \
|
||||
}
|
||||
typedef PRInt32 MBool;
|
||||
|
||||
#define MB_TRUE (MBool)1
|
||||
#define MB_FALSE (MBool)0
|
||||
|
||||
#ifdef DEBUG
|
||||
#define NS_ASSERTION(_cond, _msg) \
|
||||
if(!(_cond)) { \
|
||||
cerr << "ASSERTION (" << #_cond << ") " << _msg << endl; \
|
||||
cerr << "on line " << __LINE__ << " in " << __FILE__ << endl; \
|
||||
}
|
||||
#else
|
||||
#define NS_ASSERTION(_cond, _msg) {}
|
||||
#endif
|
||||
#else
|
||||
#define NS_ASSERTION(_cond, _msg) {}
|
||||
// Mozilla module
|
||||
#include "prtypes.h"
|
||||
|
||||
typedef PRBool MBool;
|
||||
|
||||
#define MB_TRUE PR_TRUE
|
||||
#define MB_FALSE PR_FALSE
|
||||
#endif
|
||||
|
||||
#endif //TX_EXE
|
||||
|
||||
typedef Int32 MBool;
|
||||
|
||||
#define MB_TRUE (MBool)1
|
||||
#define MB_FALSE (MBool)0
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* Eric Du, duxy@leyou.com.cn
|
||||
* -- added fix for FreeBSD
|
||||
*
|
||||
* $Id: primitives.h,v 1.6 2001/04/08 14:37:07 peterv%netscape.com Exp $
|
||||
* $Id: primitives.h,v 1.7 2001/06/26 14:09:14 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
/**
|
||||
* Creates a new Integer initialized to the given int value.
|
||||
**/
|
||||
Integer(Int32 integer);
|
||||
Integer(PRInt32 integer);
|
||||
|
||||
/**
|
||||
* Creates a new Integer based on the value of the given String
|
||||
|
@ -167,7 +167,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
Int32 value;
|
||||
PRInt32 value;
|
||||
|
||||
/**
|
||||
* converts the given String to an int
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* -- read XML from stdin when -i is omitted
|
||||
* -- accept '-' to specify stdin/stdout on command line
|
||||
*
|
||||
* $Id: transformiix.cpp,v 1.9 2001/04/08 14:34:43 peterv%netscape.com Exp $
|
||||
* $Id: transformiix.cpp,v 1.10 2001/06/26 14:09:48 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -66,7 +66,7 @@ int main(int argc, char** argv) {
|
|||
cerr << copyright <<endl;
|
||||
|
||||
//-- print banner line
|
||||
Int32 fillSize = 1;
|
||||
PRInt32 fillSize = 1;
|
||||
fillSize += copyright.length();
|
||||
String fill;
|
||||
fill.setLength(fillSize, '-');
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
* URIUtils
|
||||
* A set of utilities for handling URIs
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.14 $ $Date: 2001/06/10 16:42:43 $
|
||||
* @version $Revision: 1.15 $ $Date: 2001/06/26 14:10:10 $
|
||||
**/
|
||||
|
||||
#ifdef TX_EXE
|
||||
|
@ -220,7 +220,7 @@ void URIUtils::resolveHref(const String& href, const String& base, String& dest)
|
|||
} //-- resolveHref
|
||||
|
||||
void URIUtils::getFragmentIdentifier(const String& href, String& frag) {
|
||||
Int32 pos;
|
||||
PRInt32 pos;
|
||||
pos = href.lastIndexOf('#');
|
||||
if(pos != NOT_FOUND)
|
||||
href.subString(pos+1, frag);
|
||||
|
@ -229,7 +229,7 @@ void URIUtils::getFragmentIdentifier(const String& href, String& frag) {
|
|||
} //-- getFragmentIdentifier
|
||||
|
||||
void URIUtils::getDocumentURI(const String& href, String& docUri) {
|
||||
Int32 pos;
|
||||
PRInt32 pos;
|
||||
pos = href.lastIndexOf('#');
|
||||
if(pos != NOT_FOUND)
|
||||
href.subString(0,pos,docUri);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/**
|
||||
* XMLDOMUtils
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.16 $ $Date: 2001/06/10 16:42:18 $
|
||||
* @version $Revision: 1.17 $ $Date: 2001/06/26 14:10:15 $
|
||||
**/
|
||||
|
||||
#include "XMLDOMUtils.h"
|
||||
|
@ -45,7 +45,7 @@ Node* XMLDOMUtils::copyNode(Node* node, Document* owner, NamespaceResolver* reso
|
|||
//-- document nodes
|
||||
if (nodeType != Node::DOCUMENT_NODE && !owner) return 0;
|
||||
Node* newNode = 0;
|
||||
UInt32 i = 0;
|
||||
PRUint32 i = 0;
|
||||
switch ( nodeType ) {
|
||||
|
||||
case Node::ATTRIBUTE_NODE :
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
* Lidong, lidong520@263.net
|
||||
* -- unicode bug fix
|
||||
*
|
||||
* $Id: XMLUtils.cpp,v 1.4 2001/01/10 11:48:44 axel%pike.org Exp $
|
||||
* $Id: XMLUtils.cpp,v 1.5 2001/06/26 14:10:19 peterv%netscape.com Exp $
|
||||
*/
|
||||
/**
|
||||
* An XML utility class
|
||||
|
@ -69,7 +69,7 @@ void XMLUtils::getLocalPart(const String& src, String& dest) {
|
|||
/**
|
||||
* Returns true if the given character represents an Alpha letter
|
||||
**/
|
||||
MBool XMLUtils::isAlphaChar(Int32 ch) {
|
||||
MBool XMLUtils::isAlphaChar(PRInt32 ch) {
|
||||
if ((ch >= 'a' ) && (ch <= 'z' )) return MB_TRUE;
|
||||
if ((ch >= 'A' ) && (ch <= 'Z' )) return MB_TRUE;
|
||||
return MB_FALSE;
|
||||
|
@ -78,7 +78,7 @@ MBool XMLUtils::isAlphaChar(Int32 ch) {
|
|||
/**
|
||||
* Returns true if the given character represents a numeric letter (digit)
|
||||
**/
|
||||
MBool XMLUtils::isDigit(Int32 ch) {
|
||||
MBool XMLUtils::isDigit(PRInt32 ch) {
|
||||
if ((ch >= '0') && (ch <= '9')) return MB_TRUE;
|
||||
return MB_FALSE;
|
||||
} //-- isDigit
|
||||
|
@ -86,7 +86,7 @@ MBool XMLUtils::isDigit(Int32 ch) {
|
|||
/**
|
||||
* Returns true if the given character is an allowable QName character
|
||||
**/
|
||||
MBool XMLUtils::isNCNameChar(Int32 ch) {
|
||||
MBool XMLUtils::isNCNameChar(PRInt32 ch) {
|
||||
if (isDigit(ch) || isAlphaChar(ch)) return MB_TRUE;
|
||||
return (MBool) ((ch == '.') ||(ch == '_') || (ch == '-'));
|
||||
} //-- isNCNameChar
|
||||
|
@ -94,7 +94,7 @@ MBool XMLUtils::isNCNameChar(Int32 ch) {
|
|||
/**
|
||||
* Returns true if the given character is an allowable NCName character
|
||||
**/
|
||||
MBool XMLUtils::isQNameChar(Int32 ch) {
|
||||
MBool XMLUtils::isQNameChar(PRInt32 ch) {
|
||||
return (MBool) (( ch == ':') || isNCNameChar(ch));
|
||||
} //-- isQNameChar
|
||||
|
||||
|
@ -119,7 +119,7 @@ MBool XMLUtils::isValidQName(String& name) {
|
|||
**/
|
||||
MBool XMLUtils::isWhitespace(const String& text) {
|
||||
for ( int i = 0; i < text.length(); i++ ) {
|
||||
Int32 ch = text.charAt(i);
|
||||
PRInt32 ch = text.charAt(i);
|
||||
switch ( ch ) {
|
||||
case ' ' :
|
||||
case '\n' :
|
||||
|
@ -137,14 +137,14 @@ MBool XMLUtils::isWhitespace(const String& text) {
|
|||
* Normalizes the value of an XML attribute
|
||||
**/
|
||||
void XMLUtils::normalizeAttributeValue(String& attValue) {
|
||||
Int32 size = attValue.length();
|
||||
PRInt32 size = attValue.length();
|
||||
//-- make copy of chars
|
||||
UNICODE_CHAR* chars = new UNICODE_CHAR[size];
|
||||
attValue.toUnicode(chars);
|
||||
//-- clear attValue
|
||||
attValue.clear();
|
||||
|
||||
Int32 cc = 0;
|
||||
PRInt32 cc = 0;
|
||||
MBool addSpace = MB_FALSE;
|
||||
while ( cc < size) {
|
||||
UNICODE_CHAR ch = chars[cc++];
|
||||
|
@ -179,14 +179,14 @@ void XMLUtils::normalizeAttributeValue(String& attValue) {
|
|||
* Normalizes the value of a XML processing instruction
|
||||
**/
|
||||
void XMLUtils::normalizePIValue(String& piValue) {
|
||||
Int32 size = piValue.length();
|
||||
PRInt32 size = piValue.length();
|
||||
//-- make copy of chars
|
||||
UNICODE_CHAR* chars = new UNICODE_CHAR[size];
|
||||
piValue.toUnicode(chars);
|
||||
//-- clear attValue
|
||||
piValue.clear();
|
||||
|
||||
Int32 cc = 0;
|
||||
PRInt32 cc = 0;
|
||||
UNICODE_CHAR prevCh = 0x0000;
|
||||
while ( cc < size) {
|
||||
UNICODE_CHAR ch = chars[cc++];
|
||||
|
@ -213,7 +213,7 @@ void XMLUtils::normalizePIValue(String& piValue) {
|
|||
**/
|
||||
MBool XMLUtils::shouldStripTextnode (const String& data){
|
||||
MBool toStrip = MB_TRUE;
|
||||
for (Int32 i=0;toStrip && i<data.length();i++){
|
||||
for (PRInt32 i=0;toStrip && i<data.length();i++){
|
||||
switch(data.charAt(i)) {
|
||||
case 0x0020: // space
|
||||
case 0x0009: // tab
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: XMLUtils.h,v 1.5 2001/04/08 14:37:51 peterv%netscape.com Exp $
|
||||
* $Id: XMLUtils.h,v 1.6 2001/06/26 14:10:23 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -77,22 +77,22 @@ private:
|
|||
/**
|
||||
* Returns true if the given character represents an Alpha letter
|
||||
**/
|
||||
static MBool isAlphaChar(Int32 ch);
|
||||
static MBool isAlphaChar(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given character represents a numeric letter (digit)
|
||||
**/
|
||||
static MBool isDigit(Int32 ch);
|
||||
static MBool isDigit(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given character is an allowable QName character
|
||||
**/
|
||||
static MBool isQNameChar(Int32 ch);
|
||||
static MBool isQNameChar(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given character is an allowable NCName character
|
||||
**/
|
||||
static MBool isNCNameChar(Int32 ch);
|
||||
static MBool isNCNameChar(PRInt32 ch);
|
||||
|
||||
}; //-- XMLUtils
|
||||
#endif
|
||||
|
|
|
@ -79,10 +79,10 @@ void CharacterData::setData(const String& aData)
|
|||
*
|
||||
* @return the length of the character data
|
||||
*/
|
||||
Int32 CharacterData::getLength() const
|
||||
PRInt32 CharacterData::getLength() const
|
||||
{
|
||||
NSI_FROM_TX(CharacterData)
|
||||
UInt32 length = 0;
|
||||
PRUint32 length = 0;
|
||||
|
||||
if (nsCharacterData)
|
||||
nsCharacterData->GetLength(&length);
|
||||
|
@ -99,7 +99,7 @@ Int32 CharacterData::getLength() const
|
|||
*
|
||||
* @return the length of the character data
|
||||
*/
|
||||
String& CharacterData::substringData(Int32 aOffset, Int32 aCount,
|
||||
String& CharacterData::substringData(PRInt32 aOffset, PRInt32 aCount,
|
||||
String& aDest)
|
||||
{
|
||||
NSI_FROM_TX(CharacterData)
|
||||
|
@ -129,7 +129,7 @@ void CharacterData::appendData(const String& aSource)
|
|||
* @param aOffset the offset at which you want to insert the string
|
||||
* @param aSource the string that you want to insert into the character data
|
||||
*/
|
||||
void CharacterData::insertData(Int32 aOffset, const String& aSource)
|
||||
void CharacterData::insertData(PRInt32 aOffset, const String& aSource)
|
||||
{
|
||||
NSI_FROM_TX(CharacterData)
|
||||
|
||||
|
@ -143,7 +143,7 @@ void CharacterData::insertData(Int32 aOffset, const String& aSource)
|
|||
* @param aOffset the offset at which you want to delete data
|
||||
* @param aCount the number of chars you want to delete
|
||||
*/
|
||||
void CharacterData::deleteData(Int32 aOffset, Int32 aCount)
|
||||
void CharacterData::deleteData(PRInt32 aOffset, PRInt32 aCount)
|
||||
{
|
||||
NSI_FROM_TX(CharacterData)
|
||||
|
||||
|
@ -158,7 +158,7 @@ void CharacterData::deleteData(Int32 aOffset, Int32 aCount)
|
|||
* @param aCount the number of chars you want to replace
|
||||
* @param aSource the data that you want to replace it with
|
||||
*/
|
||||
void CharacterData::replaceData(Int32 aOffset, Int32 aCount,
|
||||
void CharacterData::replaceData(PRInt32 aOffset, PRInt32 aCount,
|
||||
const String& aSource)
|
||||
{
|
||||
NSI_FROM_TX(CharacterData)
|
||||
|
|
|
@ -114,7 +114,7 @@ Node* NamedNodeMap::removeNamedItem(const String& aName)
|
|||
*
|
||||
* @return the node at the given index
|
||||
*/
|
||||
Node* NamedNodeMap::item(UInt32 aIndex)
|
||||
Node* NamedNodeMap::item(PRUint32 aIndex)
|
||||
{
|
||||
NSI_FROM_TX_NULL_CHECK(NamedNodeMap)
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
|
@ -130,10 +130,10 @@ Node* NamedNodeMap::item(UInt32 aIndex)
|
|||
*
|
||||
* @return the number of nodes stored in this NamedNodeMap
|
||||
*/
|
||||
UInt32 NamedNodeMap::getLength()
|
||||
PRUint32 NamedNodeMap::getLength()
|
||||
{
|
||||
NSI_FROM_TX(NamedNodeMap)
|
||||
UInt32 length = 0;
|
||||
PRUint32 length = 0;
|
||||
|
||||
if (nsNamedNodeMap)
|
||||
nsNamedNodeMap->GetLength(&length);
|
||||
|
|
|
@ -53,7 +53,7 @@ NodeList::~NodeList()
|
|||
*
|
||||
* @return the child at the given index or NULL if there is none
|
||||
*/
|
||||
Node* NodeList::item(UInt32 aIndex)
|
||||
Node* NodeList::item(PRUint32 aIndex)
|
||||
{
|
||||
NSI_FROM_TX_NULL_CHECK(NodeList)
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
|
@ -69,10 +69,10 @@ Node* NodeList::item(UInt32 aIndex)
|
|||
*
|
||||
* @return the number of nodes
|
||||
*/
|
||||
UInt32 NodeList::getLength()
|
||||
PRUint32 NodeList::getLength()
|
||||
{
|
||||
NSI_FROM_TX(NodeList)
|
||||
UInt32 length = 0;
|
||||
PRUint32 length = 0;
|
||||
|
||||
if (nsNodeList)
|
||||
nsNodeList->GetLength(&length);
|
||||
|
|
|
@ -52,7 +52,7 @@ Text::~Text()
|
|||
*
|
||||
* @return the resulting Text object
|
||||
*/
|
||||
Text* Text::splitText(Int32 aOffset)
|
||||
Text* Text::splitText(PRInt32 aOffset)
|
||||
{
|
||||
NSI_FROM_TX_NULL_CHECK(Text)
|
||||
nsCOMPtr<nsIDOMText> split;
|
||||
|
|
|
@ -254,8 +254,8 @@ class NodeList : public MozillaObjectWrapper
|
|||
NodeList(nsIDOMNodeList* aNodeList, Document* aOwner);
|
||||
~NodeList();
|
||||
|
||||
Node* item(UInt32 aIndex);
|
||||
UInt32 getLength();
|
||||
Node* item(PRUint32 aIndex);
|
||||
PRUint32 getLength();
|
||||
};
|
||||
|
||||
|
||||
|
@ -271,8 +271,8 @@ class NamedNodeMap : public MozillaObjectWrapper
|
|||
Node* getNamedItem(const String& aName);
|
||||
Node* setNamedItem(Node* aNode);
|
||||
Node* removeNamedItem(const String& aName);
|
||||
Node* item(UInt32 aIndex);
|
||||
UInt32 getLength();
|
||||
Node* item(PRUint32 aIndex);
|
||||
PRUint32 getLength();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -425,13 +425,13 @@ class CharacterData : public Node
|
|||
|
||||
const String& getData();
|
||||
void setData(const String& aSource);
|
||||
Int32 getLength() const;
|
||||
PRInt32 getLength() const;
|
||||
|
||||
String& substringData(Int32 aOffset, Int32 aCount, String& aDest);
|
||||
String& substringData(PRInt32 aOffset, PRInt32 aCount, String& aDest);
|
||||
void appendData(const String& aSource);
|
||||
void insertData(Int32 aOffset, const String& aSource);
|
||||
void deleteData(Int32 aOffset, Int32 aCount);
|
||||
void replaceData(Int32 aOffset, Int32 aCount, const String& aSource);
|
||||
void insertData(PRInt32 aOffset, const String& aSource);
|
||||
void deleteData(PRInt32 aOffset, PRInt32 aCount);
|
||||
void replaceData(PRInt32 aOffset, PRInt32 aCount, const String& aSource);
|
||||
|
||||
private:
|
||||
String nodeValue;
|
||||
|
@ -446,7 +446,7 @@ class Text : public CharacterData
|
|||
Text(nsIDOMText* aText, Document* aOwner);
|
||||
~Text();
|
||||
|
||||
Text* splitText(Int32 aOffset);
|
||||
Text* splitText(PRInt32 aOffset);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -58,7 +58,7 @@ void CharacterData::setData(const String& source)
|
|||
//
|
||||
//Returns the length of the data object.
|
||||
//
|
||||
Int32 CharacterData::getLength() const
|
||||
PRInt32 CharacterData::getLength() const
|
||||
{
|
||||
return nodeValue.length();
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ Int32 CharacterData::getLength() const
|
|||
//characters away.
|
||||
// NOTE: An empty string will be returned in the event of an error.
|
||||
//
|
||||
String& CharacterData::substringData(Int32 offset, Int32 count, String& dest)
|
||||
String& CharacterData::substringData(PRInt32 offset, PRInt32 count, String& dest)
|
||||
{
|
||||
if ((offset >= 0) && (offset < nodeValue.length()) && (count > 0))
|
||||
return nodeValue.subString(offset, offset+count, dest);
|
||||
|
@ -84,19 +84,19 @@ void CharacterData::appendData(const String& arg)
|
|||
nodeValue.append(arg);
|
||||
}
|
||||
|
||||
void CharacterData::insertData(Int32 offset, const String& arg)
|
||||
void CharacterData::insertData(PRInt32 offset, const String& arg)
|
||||
{
|
||||
if ((offset >= 0) && (offset < nodeValue.length()))
|
||||
nodeValue.insert(offset, arg);
|
||||
}
|
||||
|
||||
void CharacterData::deleteData(Int32 offset, Int32 count)
|
||||
void CharacterData::deleteData(PRInt32 offset, PRInt32 count)
|
||||
{
|
||||
if ((offset >= 0) && (offset < nodeValue.length()) && (count > 0))
|
||||
nodeValue.deleteChars(offset, count);
|
||||
}
|
||||
|
||||
void CharacterData::replaceData(Int32 offset, Int32 count, const String& arg)
|
||||
void CharacterData::replaceData(PRInt32 offset, PRInt32 count, const String& arg)
|
||||
{
|
||||
String tempString;
|
||||
|
||||
|
|
|
@ -59,8 +59,8 @@ NodeDefinition::NodeDefinition(NodeType type, const String& name,
|
|||
//
|
||||
NodeDefinition::~NodeDefinition()
|
||||
{
|
||||
Int32 numAttributes = attributes.getLength();
|
||||
Int32 killAttrLoop;
|
||||
PRInt32 numAttributes = attributes.getLength();
|
||||
PRInt32 killAttrLoop;
|
||||
|
||||
DeleteChildren();
|
||||
|
||||
|
@ -148,9 +148,9 @@ Document* NodeDefinition::getOwnerDocument() const
|
|||
return ownerDocument;
|
||||
}
|
||||
|
||||
Node* NodeDefinition::item(UInt32 index)
|
||||
Node* NodeDefinition::item(PRUint32 index)
|
||||
{
|
||||
UInt32 selectLoop;
|
||||
PRUint32 selectLoop;
|
||||
NodeDefinition* pSelectNode = firstChild;
|
||||
|
||||
if (index < length)
|
||||
|
@ -164,7 +164,7 @@ Node* NodeDefinition::item(UInt32 index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
UInt32 NodeDefinition::getLength()
|
||||
PRUint32 NodeDefinition::getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
|
|
@ -94,9 +94,9 @@ void NodeListDefinition::append(Node& newNode)
|
|||
//
|
||||
// Return the Node contained in the item specified
|
||||
//
|
||||
Node* NodeListDefinition::item(UInt32 index)
|
||||
Node* NodeListDefinition::item(PRUint32 index)
|
||||
{
|
||||
UInt32 selectLoop;
|
||||
PRUint32 selectLoop;
|
||||
ListItem* pListItem = firstItem;
|
||||
|
||||
if (index < length)
|
||||
|
@ -113,7 +113,7 @@ Node* NodeListDefinition::item(UInt32 index)
|
|||
//
|
||||
// Return the number of items in the list
|
||||
//
|
||||
UInt32 NodeListDefinition::getLength()
|
||||
PRUint32 NodeListDefinition::getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ Text::Text(NodeType type, const String& name, const String& value,
|
|||
//Split the text node at Offset into two siblings. Return a pointer to the new
|
||||
//sibling.
|
||||
//
|
||||
Text* Text::splitText(Int32 offset)
|
||||
Text* Text::splitText(PRInt32 offset)
|
||||
{
|
||||
Text* newTextSibling = NULL;
|
||||
String newData;
|
||||
|
|
|
@ -139,10 +139,10 @@ class Node : public TxObject
|
|||
class NodeList
|
||||
{
|
||||
public:
|
||||
virtual Node* item(UInt32 index) = 0;
|
||||
virtual UInt32 getLength() = 0;
|
||||
virtual Node* item(PRUint32 index) = 0;
|
||||
virtual PRUint32 getLength() = 0;
|
||||
protected:
|
||||
UInt32 length;
|
||||
PRUint32 length;
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -163,8 +163,8 @@ class NodeListDefinition : public NodeList
|
|||
void append(Node* newNode);
|
||||
|
||||
//Inherited from NodeList
|
||||
Node* item(UInt32 index);
|
||||
UInt32 getLength();
|
||||
Node* item(PRUint32 index);
|
||||
PRUint32 getLength();
|
||||
|
||||
protected:
|
||||
struct ListItem {
|
||||
|
@ -238,8 +238,8 @@ class NodeDefinition : public Node, public NodeList
|
|||
virtual String getBaseURI();
|
||||
|
||||
//Inherrited from NodeList
|
||||
Node* item(UInt32 index);
|
||||
UInt32 getLength();
|
||||
Node* item(PRUint32 index);
|
||||
PRUint32 getLength();
|
||||
|
||||
protected:
|
||||
//Name, value, and attributes for this node. Available to derrived
|
||||
|
@ -391,13 +391,13 @@ class CharacterData : public NodeDefinition
|
|||
public:
|
||||
const String& getData() const;
|
||||
void setData(const String& source);
|
||||
Int32 getLength() const;
|
||||
PRInt32 getLength() const;
|
||||
|
||||
String& substringData(Int32 offset, Int32 count, String& dest);
|
||||
String& substringData(PRInt32 offset, PRInt32 count, String& dest);
|
||||
void appendData(const String& arg);
|
||||
void insertData(Int32 offset, const String& arg);
|
||||
void deleteData(Int32 offset, Int32 count);
|
||||
void replaceData(Int32 offset, Int32 count, const String& arg);
|
||||
void insertData(PRInt32 offset, const String& arg);
|
||||
void deleteData(PRInt32 offset, PRInt32 count);
|
||||
void replaceData(PRInt32 offset, PRInt32 count, const String& arg);
|
||||
|
||||
protected:
|
||||
CharacterData(NodeType type, const String& name,
|
||||
|
@ -413,7 +413,7 @@ class Text : public CharacterData
|
|||
public:
|
||||
Text(const String& theData, Document* owner);
|
||||
|
||||
Text* splitText(Int32 offset);
|
||||
Text* splitText(PRInt32 offset);
|
||||
|
||||
//Override "child manipulation" function since Text Nodes can not have
|
||||
//any children.
|
||||
|
|
|
@ -204,7 +204,7 @@ void DOMHelper::continueIndexing(Node* node) {
|
|||
Element* element = (Element*)idxState->next;
|
||||
NamedNodeMap* atts = element->getAttributes();
|
||||
if (atts) {
|
||||
for (UInt32 i = 0; i < atts->getLength(); i++) {
|
||||
for (PRUint32 i = 0; i < atts->getLength(); i++) {
|
||||
Node* tmpNode = atts->item(i);
|
||||
addParentReference(tmpNode, element);
|
||||
if (node == tmpNode) found = MB_TRUE;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: AttributeExpr.cpp,v 1.4 2001/04/08 14:37:57 peterv%netscape.com Exp $
|
||||
* $Id: AttributeExpr.cpp,v 1.5 2001/06/26 14:07:18 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
#include "Expr.h"
|
||||
|
@ -70,7 +70,7 @@ ExprResult* AttributeExpr::evaluate(Node* context, ContextState* cs) {
|
|||
if ( !context ) return nodeSet;
|
||||
NamedNodeMap* atts = context->getAttributes();
|
||||
if ( atts ) {
|
||||
UInt32 i = 0;
|
||||
PRUint32 i = 0;
|
||||
if ( isNameWild && isNamespaceWild ) {
|
||||
for ( ; i < atts->getLength(); i++ )
|
||||
nodeSet->add(atts->item(i));
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
* -- Fixed bug in parse method so that we make sure we check for
|
||||
* axis identifier wild cards, such as ancestor::*
|
||||
*
|
||||
* $Id: ExprLexer.cpp,v 1.13 2001/05/12 11:59:44 peterv%netscape.com Exp $
|
||||
* $Id: ExprLexer.cpp,v 1.14 2001/06/26 14:07:49 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Lexical analyzer for XPath expressions
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.13 $ $Date: 2001/05/12 11:59:44 $
|
||||
* @version $Revision: 1.14 $ $Date: 2001/06/26 14:07:49 $
|
||||
**/
|
||||
|
||||
#include "ExprLexer.h"
|
||||
|
@ -250,7 +250,7 @@ void ExprLexer::addToken(Token* token) {
|
|||
/**
|
||||
* Returns true if the given character represents an Alpha letter
|
||||
**/
|
||||
MBool ExprLexer::isAlphaChar(Int32 ch) {
|
||||
MBool ExprLexer::isAlphaChar(PRInt32 ch) {
|
||||
if ((ch >= 'a' ) && (ch <= 'z' )) return MB_TRUE;
|
||||
if ((ch >= 'A' ) && (ch <= 'Z' )) return MB_TRUE;
|
||||
return MB_FALSE;
|
||||
|
@ -259,7 +259,7 @@ MBool ExprLexer::isAlphaChar(Int32 ch) {
|
|||
/**
|
||||
* Returns true if the given character represents a numeric letter (digit)
|
||||
**/
|
||||
MBool ExprLexer::isDigit(Int32 ch) {
|
||||
MBool ExprLexer::isDigit(PRInt32 ch) {
|
||||
if ((ch >= '0') && (ch <= '9')) return MB_TRUE;
|
||||
return MB_FALSE;
|
||||
} //-- isDigit
|
||||
|
@ -267,7 +267,7 @@ MBool ExprLexer::isDigit(Int32 ch) {
|
|||
/**
|
||||
* Returns true if the given character is an allowable NCName character
|
||||
**/
|
||||
MBool ExprLexer::isNCNameChar(Int32 ch) {
|
||||
MBool ExprLexer::isNCNameChar(PRInt32 ch) {
|
||||
if (isDigit(ch) || isAlphaChar(ch)) return MB_TRUE;
|
||||
return (MBool) ((ch == '.') || (ch == '_') || (ch == '-'));
|
||||
} //-- isNCNameChar
|
||||
|
@ -275,7 +275,7 @@ MBool ExprLexer::isNCNameChar(Int32 ch) {
|
|||
/**
|
||||
* Returns true if the given character is an allowable QName character
|
||||
**/
|
||||
MBool ExprLexer::isQNameChar(Int32 ch) {
|
||||
MBool ExprLexer::isQNameChar(PRInt32 ch) {
|
||||
return (MBool) (( ch == ':') || isNCNameChar(ch));
|
||||
} //-- isQNameChar
|
||||
|
||||
|
@ -503,7 +503,7 @@ void ExprLexer::parse(const String& pattern) {
|
|||
UNICODE_CHAR inLiteral = '\0';
|
||||
MBool inNumber = MB_FALSE;
|
||||
|
||||
Int32 currentPos = 0;
|
||||
PRInt32 currentPos = 0;
|
||||
|
||||
UNICODE_CHAR ch = '\0';
|
||||
UNICODE_CHAR prevCh = ch;
|
||||
|
@ -577,7 +577,7 @@ void ExprLexer::parse(const String& pattern) {
|
|||
break;
|
||||
case COLON:
|
||||
if ( prevCh == ch) {
|
||||
Int32 bufSize = tokenBuffer.length();
|
||||
PRInt32 bufSize = tokenBuffer.length();
|
||||
tokenBuffer.setLength(bufSize-1);
|
||||
addToken(new Token(tokenBuffer, Token::AXIS_IDENTIFIER));
|
||||
tokenBuffer.clear();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* -- changed constant short declarations in Token and ExprLexer to
|
||||
* enumerations, commented with //--LF
|
||||
*
|
||||
* $Id: ExprLexer.h,v 1.7 2001/05/12 11:59:51 peterv%netscape.com Exp $
|
||||
* $Id: ExprLexer.h,v 1.8 2001/06/26 14:07:54 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
|||
* This class was ported from XSL:P, an open source Java based
|
||||
* XSLT processor, written by yours truly.
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.7 $ $Date: 2001/05/12 11:59:51 $
|
||||
* @version $Revision: 1.8 $ $Date: 2001/06/26 14:07:54 $
|
||||
**/
|
||||
class Token {
|
||||
|
||||
|
@ -243,22 +243,22 @@ private:
|
|||
/**
|
||||
* Returns true if the given character represents an Alpha letter
|
||||
**/
|
||||
static MBool isAlphaChar(Int32 ch);
|
||||
static MBool isAlphaChar(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given character represents a numeric letter (digit)
|
||||
**/
|
||||
static MBool isDigit(Int32 ch);
|
||||
static MBool isDigit(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given character is an allowable QName character
|
||||
**/
|
||||
static MBool isQNameChar(Int32 ch);
|
||||
static MBool isQNameChar(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given character is an allowable NCName character
|
||||
**/
|
||||
static MBool isNCNameChar(Int32 ch);
|
||||
static MBool isNCNameChar(PRInt32 ch);
|
||||
|
||||
/**
|
||||
* Returns true if the given String is a valid XML QName
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* -- fixed bug in ::parsePredicates,
|
||||
* made sure we continue looking for more predicates.
|
||||
*
|
||||
* $Id: ExprParser.cpp,v 1.12 2001/06/20 06:00:32 margaret.chan%sun.com Exp $
|
||||
* $Id: ExprParser.cpp,v 1.13 2001/06/26 14:07:58 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@
|
|||
* This class is used to parse XSL Expressions
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @see ExprLexer
|
||||
* @version $Revision: 1.12 $ $Date: 2001/06/20 06:00:32 $
|
||||
* @version $Revision: 1.13 $ $Date: 2001/06/26 14:07:58 $
|
||||
**/
|
||||
|
||||
#include "ExprParser.h"
|
||||
|
@ -66,7 +66,7 @@ AttributeValueTemplate* ExprParser::createAttributeValueTemplate
|
|||
{
|
||||
|
||||
AttributeValueTemplate* avt = new AttributeValueTemplate();
|
||||
Int32 size = attValue.length();
|
||||
PRInt32 size = attValue.length();
|
||||
int cc = 0;
|
||||
String buffer;
|
||||
MBool inExpr = MB_FALSE;
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: LocationStep.cpp,v 1.7 2001/06/20 06:00:33 margaret.chan%sun.com Exp $
|
||||
* $Id: LocationStep.cpp,v 1.8 2001/06/26 14:08:19 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
Implementation of an XPath LocationStep
|
||||
@version $Revision: 1.7 $ $Date: 2001/06/20 06:00:33 $
|
||||
@version $Revision: 1.8 $ $Date: 2001/06/26 14:08:19 $
|
||||
*/
|
||||
|
||||
#include "Expr.h"
|
||||
|
@ -123,7 +123,7 @@ ExprResult* LocationStep::evaluate(Node* context, ContextState* cs) {
|
|||
{
|
||||
NamedNodeMap* atts = context->getAttributes();
|
||||
if ( atts ) {
|
||||
for ( UInt32 i = 0; i < atts->getLength(); i++ ) {
|
||||
for ( PRUint32 i = 0; i < atts->getLength(); i++ ) {
|
||||
Node* attr = atts->item(i);
|
||||
if ( nodeExpr->matches(attr, context, cs) ) nodes->add(attr);
|
||||
}
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
* Marina Mechtcheriakova, mmarina@mindspring.com
|
||||
* -- changed some behavoir to be more compliant with spec
|
||||
*
|
||||
* $Id: NodeSetFunctionCall.cpp,v 1.6 2001/04/12 07:13:08 axel%pike.org Exp $
|
||||
* $Id: NodeSetFunctionCall.cpp,v 1.7 2001/06/26 14:09:10 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* NodeSetFunctionCall
|
||||
* A representation of the XPath NodeSet funtions
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.6 $ $Date: 2001/04/12 07:13:08 $
|
||||
* @version $Revision: 1.7 $ $Date: 2001/06/26 14:09:10 $
|
||||
**/
|
||||
|
||||
#include "FunctionLib.h"
|
||||
|
@ -87,7 +87,7 @@ NodeSetFunctionCall::NodeSetFunctionCall(short type) : FunctionCall() {
|
|||
ExprResult* NodeSetFunctionCall::evaluate(Node* context, ContextState* cs) {
|
||||
NodeSet* nodeSet = (NodeSet*)cs->getNodeSetStack()->peek();
|
||||
ListIterator* iter = params.iterator();
|
||||
Int32 argc = params.getLength();
|
||||
PRInt32 argc = params.getLength();
|
||||
ExprResult* result = 0;
|
||||
Expr* param = 0;
|
||||
switch ( type ) {
|
||||
|
@ -129,7 +129,7 @@ ExprResult* NodeSetFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
exprResult->stringValue(lIDList);
|
||||
};
|
||||
lIDList.trim();
|
||||
Int32 start=0,end;
|
||||
PRInt32 start=0,end;
|
||||
MBool hasSpace = MB_FALSE, isSpace;
|
||||
UNICODE_CHAR cc;
|
||||
String thisID;
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: StringFunctionCall.cpp,v 1.9 2001/04/08 14:34:32 peterv%netscape.com Exp $
|
||||
* $Id: StringFunctionCall.cpp,v 1.10 2001/06/26 14:09:23 peterv%netscape.com Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* StringFunctionCall
|
||||
* A representation of the XPath String funtions
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @version $Revision: 1.9 $ $Date: 2001/04/08 14:34:32 $
|
||||
* @version $Revision: 1.10 $ $Date: 2001/06/26 14:09:23 $
|
||||
**/
|
||||
|
||||
#include "FunctionLib.h"
|
||||
|
@ -89,7 +89,7 @@ StringFunctionCall::StringFunctionCall(short type) : FunctionCall() {
|
|||
**/
|
||||
ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
||||
ListIterator* iter = params.iterator();
|
||||
Int32 argc = params.getLength();
|
||||
PRInt32 argc = params.getLength();
|
||||
String err;
|
||||
ExprResult* result = 0;
|
||||
switch ( type ) {
|
||||
|
@ -123,10 +123,10 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
// Leading & Trailing Whitespace
|
||||
resultStr.trim();
|
||||
MBool hasSpace = MB_FALSE;
|
||||
Int32 lastchar=-1, dest=0;
|
||||
PRInt32 lastchar=-1, dest=0;
|
||||
String normed(resultStr.length());
|
||||
UNICODE_CHAR current;
|
||||
for (Int32 src=0; src<resultStr.length(); src++) {
|
||||
for (PRInt32 src=0; src<resultStr.length(); src++) {
|
||||
current=resultStr.charAt(src);
|
||||
if (current==' ' || current=='\n' ||
|
||||
current=='\t' || current=='\r') {
|
||||
|
@ -181,8 +181,8 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
//-- check for -Infinity
|
||||
MBool startsNegInf = (dbl==Double::NEGATIVE_INFINITY);
|
||||
|
||||
Int32 startIdx = startsNegInf?0:(Int32)floor(dbl+.5);
|
||||
Int32 endIdx = src.length()+1;
|
||||
PRInt32 startIdx = startsNegInf?0:(PRInt32)floor(dbl+.5);
|
||||
PRInt32 endIdx = src.length()+1;
|
||||
if ( argc == 3) {
|
||||
dbl = evaluateToNumber((Expr*)iter->next(),context, cs);
|
||||
if (startsNegInf) {
|
||||
|
@ -194,7 +194,7 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
dbl == Double::NEGATIVE_INFINITY ||
|
||||
dbl < 0 )
|
||||
endIdx = 0;
|
||||
else endIdx = startIdx+(Int32)floor(dbl+.5);
|
||||
else endIdx = startIdx+(PRInt32)floor(dbl+.5);
|
||||
}
|
||||
String resultStr;
|
||||
//-- strings are indexed starting at 1 for XSL
|
||||
|
@ -217,9 +217,9 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
String arg1, arg2;
|
||||
evaluateToString((Expr*)iter->next(),context, cs, arg1);
|
||||
evaluateToString((Expr*)iter->next(),context, cs, arg2);
|
||||
Int32 idx = arg1.indexOf(arg2);
|
||||
PRInt32 idx = arg1.indexOf(arg2);
|
||||
if ((idx >= 0)&&(idx<arg1.length())) {
|
||||
Int32 len = arg2.length();
|
||||
PRInt32 len = arg2.length();
|
||||
arg2.clear();
|
||||
arg1.subString(idx+len,arg2);
|
||||
result = new StringResult(arg2);
|
||||
|
@ -233,7 +233,7 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
String arg1, arg2;
|
||||
evaluateToString((Expr*)iter->next(),context, cs, arg1);
|
||||
evaluateToString((Expr*)iter->next(),context, cs, arg2);
|
||||
Int32 idx = arg1.indexOf(arg2);
|
||||
PRInt32 idx = arg1.indexOf(arg2);
|
||||
if ((idx >= 0)&&(idx<arg1.length())) {
|
||||
arg2.clear();
|
||||
arg1.subString(0,idx,arg2);
|
||||
|
@ -249,13 +249,13 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
evaluateToString((Expr*)iter->next(),context, cs, src);
|
||||
evaluateToString((Expr*)iter->next(),context, cs, oldChars);
|
||||
evaluateToString((Expr*)iter->next(),context, cs, newChars);
|
||||
Int32 size = src.length();
|
||||
PRInt32 size = src.length();
|
||||
UNICODE_CHAR* chars = src.toUnicode(new UNICODE_CHAR[size]);
|
||||
src.clear();
|
||||
Int32 newIdx = 0;
|
||||
Int32 i;
|
||||
PRInt32 newIdx = 0;
|
||||
PRInt32 i;
|
||||
for (i = 0; i < size; i++) {
|
||||
Int32 idx = oldChars.indexOf(chars[i]);
|
||||
PRInt32 idx = oldChars.indexOf(chars[i]);
|
||||
if (idx >= 0) {
|
||||
if (idx<newChars.length())
|
||||
src.append(newChars.charAt(idx));
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
/**
|
||||
* Implementation of ProcessorState
|
||||
* Much of this code was ported from XSL:P
|
||||
* @version $Revision: 1.32 $ $Date: 2001/06/26 11:58:51 $
|
||||
* @version $Revision: 1.33 $ $Date: 2001/06/26 14:09:18 $
|
||||
**/
|
||||
|
||||
#include "ProcessorState.h"
|
||||
|
@ -978,7 +978,7 @@ void ProcessorState::initialize() {
|
|||
//-- process namespace nodes
|
||||
NamedNodeMap* atts = element->getAttributes();
|
||||
if ( atts ) {
|
||||
for (UInt32 i = 0; i < atts->getLength(); i++) {
|
||||
for (PRUint32 i = 0; i < atts->getLength(); i++) {
|
||||
Attr* attr = (Attr*)atts->item(i);
|
||||
String attName = attr->getName();
|
||||
String attValue = attr->getValue();
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
#include "nsIDOMClassInfo.h"
|
||||
#include "nsIConsoleService.h"
|
||||
//#include "nslog.h"
|
||||
#include <MacTypes.h>
|
||||
#include "ProfilerUtils.h"
|
||||
#else
|
||||
#include "printers.h"
|
||||
#include "TxLog.h"
|
||||
|
@ -73,7 +75,7 @@
|
|||
/**
|
||||
* XSLTProcessor is a class for Processing XSL stylesheets
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.59 $ $Date: 2001/06/26 11:58:52 $
|
||||
* @version $Revision: 1.60 $ $Date: 2001/06/26 14:10:28 $
|
||||
**/
|
||||
|
||||
/**
|
||||
|
@ -254,7 +256,7 @@ void XSLTProcessor::getHrefFromStylesheetPI(Document& xmlDocument, String& href)
|
|||
**/
|
||||
void XSLTProcessor::parseStylesheetPI(String& data, String& type, String& href) {
|
||||
|
||||
Int32 size = data.length();
|
||||
PRInt32 size = data.length();
|
||||
NamedMap bufferMap;
|
||||
bufferMap.put("type", &type);
|
||||
bufferMap.put("href", &href);
|
||||
|
@ -1420,7 +1422,7 @@ void XSLTProcessor::processAction
|
|||
String xsltNameSpace = ps->getXSLNamespace();
|
||||
NodeSet nonXSLAtts(atts->getLength());
|
||||
//-- process special XSL attributes first
|
||||
for ( UInt32 i = 0; i < atts->getLength(); i++ ) {
|
||||
for ( PRUint32 i = 0; i < atts->getLength(); i++ ) {
|
||||
Attr* attr = (Attr*) atts->item(i);
|
||||
//-- filter attributes in the XSLT namespace
|
||||
String attrNameSpace;
|
||||
|
|
|
@ -189,7 +189,7 @@ void txXSLKey::indexTree(Node* aNode, NamedMap* aMap)
|
|||
// check if the nodes attributes matches
|
||||
NamedNodeMap* attrs = aNode->getAttributes();
|
||||
if (attrs) {
|
||||
for (UInt32 i=0; i<attrs->getLength(); i++) {
|
||||
for (PRUint32 i=0; i<attrs->getLength(); i++) {
|
||||
testNode(attrs->item(i), aMap);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче