зеркало из https://github.com/mozilla/gecko-dev.git
Use DOMString instead of String.
This commit is contained in:
Родитель
3570d38b99
Коммит
e4744354be
|
@ -21,13 +21,13 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: txBooleanResult.cpp,v 1.1 2005/11/02 07:33:46 kvisco%ziplink.net Exp $
|
||||
* $Id: txBooleanResult.cpp,v 1.2 2005/11/02 07:33:47 Peter.VanderBeken%pandora.be Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Boolean Expression result
|
||||
* @author <A href="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @version $Revision: 1.1 $ $Date: 2005/11/02 07:33:46 $
|
||||
* @version $Revision: 1.2 $ $Date: 2005/11/02 07:33:47 $
|
||||
**/
|
||||
|
||||
#include "ExprResult.h"
|
||||
|
@ -83,7 +83,7 @@ short BooleanResult::getResultType() {
|
|||
return ExprResult::BOOLEAN;
|
||||
} //-- getResultType
|
||||
|
||||
void BooleanResult::stringValue(String& str) {
|
||||
void BooleanResult::stringValue(DOMString& str) {
|
||||
if ( value ) str.append("true");
|
||||
else str.append("false");
|
||||
} //-- toString
|
||||
|
|
|
@ -23,12 +23,11 @@
|
|||
* Larry Fitzpatrick, OpenText, lef@opentext.com
|
||||
* -- changed constant short result types to enum
|
||||
*
|
||||
* $Id: txExprResult.h,v 1.1 2005/11/02 07:33:43 kvisco%ziplink.net Exp $
|
||||
* $Id: txExprResult.h,v 1.2 2005/11/02 07:33:44 Peter.VanderBeken%pandora.be Exp $
|
||||
*/
|
||||
|
||||
#include "MITREObject.h"
|
||||
#include "String.h"
|
||||
#include "baseutils.h"
|
||||
#include "dom.h"
|
||||
#include "primitives.h"
|
||||
|
||||
#ifndef MITREXSL_EXPRRESULT_H
|
||||
|
@ -43,7 +42,7 @@
|
|||
* <BR/>
|
||||
* Note: for NodeSet, see NodeSet.h <BR />
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @version $Revision: 1.1 $ $Date: 2005/11/02 07:33:43 $
|
||||
* @version $Revision: 1.2 $ $Date: 2005/11/02 07:33:44 $
|
||||
*/
|
||||
|
||||
class ExprResult : public MITREObject {
|
||||
|
@ -70,7 +69,7 @@ public:
|
|||
* Creates a String representation of this ExprResult
|
||||
* @param str the destination string to append the String representation to.
|
||||
**/
|
||||
virtual void stringValue(String& str) = 0;
|
||||
virtual void stringValue(DOMString& str) = 0;
|
||||
|
||||
/**
|
||||
* Converts this ExprResult to a Boolean (MBool) value
|
||||
|
@ -101,7 +100,7 @@ public:
|
|||
void setValue(const BooleanResult& boolResult);
|
||||
|
||||
virtual short getResultType();
|
||||
virtual void stringValue(String& str);
|
||||
virtual void stringValue(DOMString& str);
|
||||
virtual MBool booleanValue();
|
||||
virtual double numberValue();
|
||||
|
||||
|
@ -126,7 +125,7 @@ public:
|
|||
MBool isNaN() const;
|
||||
|
||||
virtual short getResultType();
|
||||
virtual void stringValue(String& str);
|
||||
virtual void stringValue(DOMString& str);
|
||||
virtual MBool booleanValue();
|
||||
virtual double numberValue();
|
||||
|
||||
|
@ -149,7 +148,7 @@ public:
|
|||
void setValue(const String& str);
|
||||
|
||||
virtual short getResultType();
|
||||
virtual void stringValue(String& str);
|
||||
virtual void stringValue(DOMString& str);
|
||||
virtual MBool booleanValue();
|
||||
virtual double numberValue();
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ ExprResult* NumberFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
}
|
||||
else {
|
||||
String resultStr;
|
||||
String temp;
|
||||
DOMString temp;
|
||||
XMLDOMUtils::getNodeValue(context, &temp);
|
||||
if ( cs->isStripSpaceAllowed(context) ) {
|
||||
XMLUtils::stripSpace(temp, resultStr);
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: txNumberResult.cpp,v 1.1 2005/11/02 07:33:56 kvisco%ziplink.net Exp $
|
||||
* $Id: txNumberResult.cpp,v 1.2 2005/11/02 07:33:57 Peter.VanderBeken%pandora.be Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* NumberResult
|
||||
* Represents the a number as the result of evaluating an Expr
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @version $Revision: 1.1 $ $Date: 2005/11/02 07:33:56 $
|
||||
* @version $Revision: 1.2 $ $Date: 2005/11/02 07:33:57 $
|
||||
**/
|
||||
|
||||
#include "ExprResult.h"
|
||||
|
@ -90,7 +90,7 @@ short NumberResult::getResultType() {
|
|||
return ExprResult::NUMBER;
|
||||
} //-- getResultType
|
||||
|
||||
void NumberResult::stringValue(String& str) {
|
||||
void NumberResult::stringValue(DOMString& str) {
|
||||
int intVal = (int)value;
|
||||
if (intVal == value) { //-- no fraction
|
||||
Integer::toString(intVal, str);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: txRelationalExpr.cpp,v 1.1 2005/11/02 07:33:44 kvisco%ziplink.net Exp $
|
||||
* $Id: txRelationalExpr.cpp,v 1.2 2005/11/02 07:33:45 Peter.VanderBeken%pandora.be Exp $
|
||||
*/
|
||||
|
||||
#include "Expr.h"
|
||||
|
@ -62,7 +62,7 @@ MBool RelationalExpr::compareResults(ExprResult* left, ExprResult* right) {
|
|||
if (ltype == ExprResult::NODESET) {
|
||||
NodeSet* nodeSet = (NodeSet*)left;
|
||||
for ( int i = 0; i < nodeSet->size(); i++) {
|
||||
String str;
|
||||
DOMString str;
|
||||
Node* node = nodeSet->get(i);
|
||||
XMLDOMUtils::getNodeValue(node, &str);
|
||||
StringResult strResult(str);
|
||||
|
@ -74,7 +74,7 @@ MBool RelationalExpr::compareResults(ExprResult* left, ExprResult* right) {
|
|||
else if ( rtype == ExprResult::NODESET) {
|
||||
NodeSet* nodeSet = (NodeSet*)right;
|
||||
for ( int i = 0; i < nodeSet->size(); i++) {
|
||||
String str;
|
||||
DOMString str;
|
||||
Node* node = nodeSet->get(i);
|
||||
XMLDOMUtils::getNodeValue(node, &str);
|
||||
StringResult strResult(str);
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: txStringFunctionCall.cpp,v 1.1 2005/11/02 07:33:36 kvisco%ziplink.net Exp $
|
||||
* $Id: txStringFunctionCall.cpp,v 1.2 2005/11/02 07:33:37 Peter.VanderBeken%pandora.be Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* StringFunctionCall
|
||||
* A representation of the XPath String funtions
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @version $Revision: 1.1 $ $Date: 2005/11/02 07:33:36 $
|
||||
* @version $Revision: 1.2 $ $Date: 2005/11/02 07:33:37 $
|
||||
**/
|
||||
|
||||
#include "FunctionLib.h"
|
||||
|
@ -121,7 +121,7 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
break;
|
||||
case STRING_LENGTH:
|
||||
if ( requireParams(0, 1, cs) ) {
|
||||
String resultStr;
|
||||
DOMString resultStr;
|
||||
if ( argc == 1) {
|
||||
evaluateToString((Expr*)iter->next(),context, cs, resultStr);
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) {
|
|||
evaluateToString((Expr*)iter->next(),context, cs, resultStr);
|
||||
}
|
||||
else {
|
||||
String temp;
|
||||
DOMString temp;
|
||||
XMLDOMUtils::getNodeValue(context, &temp);
|
||||
if ( cs->isStripSpaceAllowed(context) ) {
|
||||
XMLUtils::stripSpace(temp, resultStr);
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: txStringResult.cpp,v 1.1 2005/11/02 07:33:52 kvisco%ziplink.net Exp $
|
||||
* $Id: txStringResult.cpp,v 1.2 2005/11/02 07:33:53 Peter.VanderBeken%pandora.be Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* StringResult
|
||||
* Represents a String as a Result of evaluating an Expr
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.1 $ $Date: 2005/11/02 07:33:52 $
|
||||
* @version $Revision: 1.2 $ $Date: 2005/11/02 07:33:53 $
|
||||
**/
|
||||
#include "ExprResult.h"
|
||||
|
||||
|
@ -81,7 +81,7 @@ short StringResult::getResultType() {
|
|||
return ExprResult::STRING;
|
||||
} //-- getResultType
|
||||
|
||||
void StringResult::stringValue(String& str) {
|
||||
void StringResult::stringValue(DOMString& str) {
|
||||
str.append(this->value);
|
||||
} //-- stringValue
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче