yast2-core
Public Member Functions | Protected Member Functions | Private Attributes | Friends
YCPFloatRep Class Reference

YCPValueRep representing a floating point number. The precision of the floating point number a YCPFloatRep is representing is not specified, because it would be very difficult to guarantee a certain precision platform independently and because this is not neccessary. More...

#include <YCPFloat.h>

Inheritance diagram for YCPFloatRep:
YCPValueRep YCPElementRep

List of all members.

Public Member Functions

double value () const
YCPOrder compare (const YCPFloat &v) const
string toString () const
std::ostream & toStream (std::ostream &str) const
std::ostream & toXml (std::ostream &str, int indent) const
YCPValueType valuetype () const
- Public Member Functions inherited from YCPValueRep
const char * valuetype_str () const
bool isVoid () const
bool isBoolean () const
bool isInteger () const
bool isFloat () const
bool isString () const
bool isByteblock () const
bool isPath () const
bool isSymbol () const
bool isList () const
bool isTerm () const
bool isMap () const
bool isCode () const
bool isBreak () const
bool isReturn () const
bool isEntry () const
bool isReference () const
bool isExternal () const
YCPVoid asVoid () const
YCPBoolean asBoolean () const
YCPInteger asInteger () const
YCPFloat asFloat () const
YCPString asString () const
YCPByteblock asByteblock () const
YCPPath asPath () const
YCPSymbol asSymbol () const
YCPList asList () const
YCPTerm asTerm () const
YCPMap asMap () const
YCPCode asCode () const
YCPEntry asEntry () const
YCPReference asReference () const
YCPExternal asExternal () const
bool equal (const YCPValue &) const
YCPOrder compare (const YCPValue &v, bool rl=false) const
- Public Member Functions inherited from YCPElementRep
YCPValue asValue () const
virtual const YCPElementRepshallowCopy () const

Protected Member Functions

 YCPFloatRep (double v)
 YCPFloatRep (const char *r)

Private Attributes

double v

Friends

class YCPFloat

Detailed Description

YCPValueRep representing a floating point number. The precision of the floating point number a YCPFloatRep is representing is not specified, because it would be very difficult to guarantee a certain precision platform independently and because this is not neccessary.

YCP Syntax: Like in C. The decimal point is obligatory.

1.0, -0.6, 0.9e-16, ...

Constructor & Destructor Documentation

YCPFloatRep::YCPFloatRep ( double  v)
protected

Creates a new YCPFloatRep object with the value given in v.

YCPFloatRep::YCPFloatRep ( const char *  r)
protected

Creates a new YCPFloatRep object from its ASCII representation

Parameters:
rstring like '18.8e-17'

References v.


Member Function Documentation

YCPOrder YCPFloatRep::compare ( const YCPFloat v) const

Compares two YCPFloats for equality, greaterness or smallerness.

Parameters:
vvalue to compare against
Returns:
YO_LESS, if this is smaller than v, YO_EQUAL, if this is equal to v, YO_GREATER, if this is greater to v

References v, YO_EQUAL, YO_GREATER, and YO_LESS.

std::ostream & YCPFloatRep::toStream ( std::ostream &  str) const
virtual

Output value as bytecode to stream

Implements YCPElementRep.

References toString(), and Bytecode::writeString().

string YCPFloatRep::toString ( void  ) const
virtual

Returns an ASCII representation of this value. Note that this must alway contain either a decimal point, or an exponent symbol in order to keep up the axiom, that the syntactical representation of a YCP value uniquely describes its type. Examples: 0.0, 1e10, -17.0e8

Implements YCPElementRep.

References v.

Referenced by toStream(), and toXml().

std::ostream & YCPFloatRep::toXml ( std::ostream &  str,
int  indent 
) const
virtual

Implements YCPValueRep.

References toString().

double YCPFloatRep::value ( ) const

Returns the value of this object in form of a C value of type double.

References v.

YCPValueType YCPFloatRep::valuetype ( ) const
virtual

Returns YT_FLOAT. See YCPValueRep::type.

Implements YCPValueRep.

References YT_FLOAT.


Friends And Related Function Documentation

friend class YCPFloat
friend

Member Data Documentation

double YCPFloatRep::v
private

Referenced by compare(), toString(), value(), and YCPFloatRep().


The documentation for this class was generated from the following files:

Generated on a sunny day for yast2-core by doxygen 1.8.1