Unicorn XML Toolkit
Version 1.00.00

Namespace Xpath
Class CNumber

class CNumber {
public:
    CNumber();
    CNumber(double dblValue);
    CNumber(int nValue);
    ~CNumber();
public:
    int GetInteger();
    double GetDouble();
    CNumber operator=(CNumber numValue);
    friend bool operator<(CNumber numValue1, CNumber numValue2);
    friend bool operator>(CNumber numValue1, CNumber numValue2);
    friend bool operator<=(CNumber numValue1, CNumber numValue2);
    friend bool operator>=(CNumber numValue1, CNumber numValue2);
    friend bool operator==(CNumber numValue1, CNumber numValue2);
    friend bool operator!=(CNumber numValue1, CNumber numValue2);
    friend CNumber operator+(CNumber numValue1, CNumber numValue2);
    friend CNumber operator-(CNumber numValue1, CNumber numValue2);
    friend CNumber operator*(CNumber numValue1, CNumber numValue2);
    friend CNumber operator/(CNumber numValue1, CNumber numValue2);
    friend CNumber operator%(CNumber numValue1, CNumber numValue2);
    CNumber operator-();
    bool IsNaN();
    bool IsPositiveZero();
    bool IsNegativeZero();
    bool IsPositiveInfinity();
    bool IsNegativeInfinity();
    static CNumber NaN();
    static CNumber NegativeZero();
    CNumber Floor();
    CNumber Ceiling();
    CNumber Round();
    CString Format();
    static bool Parse(const CString &strValue, CNumber &numResult);
    };

The XPath number.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
Constructor/Destructor Summary
CNumber ();
����������Constructs the number.
CNumber (double dblValue);
����������Constructs the number with the specified real initial value.
CNumber (int nValue);
����������Constructs the number with the specified integer initial value.
~CNumber ();
����������Destroys the number.

Function Summary
int GetInteger ();
����������Returns the integer part of this number.
double GetDouble ();
����������Returns the real value represented by this number.
bool IsNaN ();
����������Tests whether this number represents NaN.
bool IsPositiveZero ();
����������Tests whether this number represents a positive zero.
bool IsNegativeZero ();
����������Tests whether this number represents a negative zero.
bool IsPositiveInfinity ();
����������Tests whether this number represents a positive infinity.
bool IsNegativeInfinity ();
����������Tests whether this number represents a negative infinity.
CNumber NaN ();
����������Returns the representation of NaN.
CNumber NegativeZero ();
����������Returns the representation of a negative zero.
CNumber Floor ();
����������Returns the floor value of this number.
CNumber Ceiling ();
����������Returns the ceiling value of this number.
CNumber Round ();
����������Returns the rounded value of this number.
CString Format ();
����������Returns the string representation of this number.
bool Parse (const CString &strValue, CNumber &numResult);
����������Parses the string to obtain a number.

Constructor/Destructor Detail

CNumber

CNumber();

Constructs the number.

CNumber

CNumber(double dblValue);

Constructs the number with the specified real initial value.

Parameters:
dblValue - the initial value

CNumber

CNumber(int nValue);

Constructs the number with the specified integer initial value.

Parameters:
nValue - the initial value

~CNumber

~CNumber();

Destroys the number.

Function Detail

GetInteger

int GetInteger();

Returns the integer part of this number.

Returns:
the integer part of this number

GetDouble

double GetDouble();

Returns the real value represented by this number.

Returns:
the real value represented by this number

IsNaN

bool IsNaN();

Tests whether this number represents NaN.

Returns:
true if this number represents NaN; false otherwise

IsPositiveZero

bool IsPositiveZero();

Tests whether this number represents a positive zero.

Returns:
true if this number represents a positive zero; false otherwise

IsNegativeZero

bool IsNegativeZero();

Tests whether this number represents a negative zero.

Returns:
true if this number represents a negative zero; false otherwise

IsPositiveInfinity

bool IsPositiveInfinity();

Tests whether this number represents a positive infinity.

Returns:
true if this number represents a positive infinity, false otherwise

IsNegativeInfinity

bool IsNegativeInfinity();

Tests whether this number represents a negative infinity.

Returns:
true if this number represents negative infinity; false otherwise

NaN

static CNumber NaN();

Returns the representation of NaN.

Returns:
the representation of NaN

NegativeZero

static CNumber NegativeZero();

Returns the representation of a negative zero.

Returns:
the representation of a negative zero

Floor

CNumber Floor();

Returns the floor value of this number.

The floor function is defined in XPath.

Returns:
the floor value of this number

Ceiling

CNumber Ceiling();

Returns the ceiling value of this number.

The ceiling function is defined in XPath.

Returns:
the ceiling value of this number

Round

CNumber Round();

Returns the rounded value of this number.

The round function is defined in XPath.

Returns:
the rounded value of this number

Format

CString Format();

Returns the string representation of this number.

Returns:
the string representation of this number

Parse

static bool Parse(const CString &strValue, CNumber &numResult);

Parses the string to obtain a number.

The string consists of an optional whitespace followed by an optional minus sign followed by a character sequence conforming to XPath Number syntax followed by an optional whitespace.

Parameters:
strValue - the string to parse
numResult - on return, the number obtained as the result of parsing, if parsing was successful; unspecified if parsing failed
Returns:
true if parsing was successful; false if parsing failed

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.