#include <YCPValue.h>
Public Member Functions | |
virtual YCPValueType | valuetype () const =0 |
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 |
virtual std::ostream & | toXml (std::ostream &str, int indent) const =0 |
YCPBoolean YCPValueRep::asBoolean | ( | ) | const |
Casts this value into a pointer of type const YCPBooleanRep *.
References isBoolean(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPByteblock YCPValueRep::asByteblock | ( | ) | const |
Casts this value into a pointer of type const YCPByteblock .
References isByteblock(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPCode YCPValueRep::asCode | ( | ) | const |
Casts this value into a pointer of type const YCPCode.
References isCode(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPEntry YCPValueRep::asEntry | ( | ) | const |
Casts this value into a pointer of type const YCPEntry.
References isEntry(), YCPElementRep::toString(), and ycp2error.
YCPExternal YCPValueRep::asExternal | ( | ) | const |
Casts this value into a pointer of type const YCPExternal.
References isExternal(), YCPElementRep::toString(), and ycp2error.
YCPFloat YCPValueRep::asFloat | ( | ) | const |
Casts this value into a pointer of type const YCPFloat .
References isFloat(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPInteger YCPValueRep::asInteger | ( | ) | const |
Casts this value into a pointer of type const YCPIntegerRep *.
References isInteger(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPList YCPValueRep::asList | ( | ) | const |
Casts this value into a pointer of type const YCPList .
References isList(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPMap YCPValueRep::asMap | ( | ) | const |
Casts this value into a pointer of type const YCPMap .
References isMap(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPPath YCPValueRep::asPath | ( | ) | const |
Casts this value into a pointer of type const YCPPath .
References isPath(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPReference YCPValueRep::asReference | ( | ) | const |
Casts this value into a pointer of type const YCPReference.
References isReference(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPString YCPValueRep::asString | ( | ) | const |
Casts this value into a pointer of type const YCPString .
References isString(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPSymbol YCPValueRep::asSymbol | ( | ) | const |
Casts this value into a pointer of type const YCPSymbol .
References isSymbol(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPTerm YCPValueRep::asTerm | ( | ) | const |
Casts this value into a pointer of type const YCPTerm .
References isTerm(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
YCPVoid YCPValueRep::asVoid | ( | ) | const |
Casts this value into a pointer of type const YCPVoidRep *.
References isVoid(), YCPElementRep::toString(), and ycp2error.
Referenced by compare().
Compares two YCP values for equality, greaterness or smallerness. You should not compare values of different types.
v | value to compare against | |
rl | respect locale |
References asBoolean(), asByteblock(), asCode(), asFloat(), asInteger(), asList(), asMap(), asPath(), asReference(), asString(), asSymbol(), asTerm(), asVoid(), YCPElement::isNull(), YCPElementRep::toString(), valuetype(), y2warning, ycp2error, YO_EQUAL, YO_GREATER, YO_LESS, YT_BOOLEAN, YT_BYTEBLOCK, YT_CODE, YT_FLOAT, YT_INTEGER, YT_LIST, YT_MAP, YT_PATH, YT_REFERENCE, YT_STRING, YT_SYMBOL, YT_TERM, and YT_VOID.
Referenced by equal().
bool YCPValueRep::equal | ( | const YCPValue & | v | ) | const |
bool YCPValueRep::isBoolean | ( | ) | const |
Checks, if the type of this value is YT_BOOLEAN.
References valuetype(), and YT_BOOLEAN.
Referenced by asBoolean().
bool YCPValueRep::isBreak | ( | ) | const |
Checks, if the type of this value is YT_BREAK.
References valuetype(), and YT_BREAK.
bool YCPValueRep::isByteblock | ( | ) | const |
Checks, if the type of this value is YT_BYTEBLOCK.
References valuetype(), and YT_BYTEBLOCK.
Referenced by asByteblock().
bool YCPValueRep::isCode | ( | ) | const |
Checks, if the type of this value is YT_CODE.
References valuetype(), and YT_CODE.
Referenced by asCode().
bool YCPValueRep::isEntry | ( | ) | const |
Checks, if the type of this value is YT_ENTRY.
References valuetype(), and YT_ENTRY.
Referenced by asEntry().
bool YCPValueRep::isExternal | ( | ) | const |
Checks, if the type of this value is YT_EXTERNAL.
References valuetype(), and YT_EXTERNAL.
Referenced by asExternal().
bool YCPValueRep::isFloat | ( | ) | const |
Checks, if the type of this value is YT_FLOAT.
References valuetype(), and YT_FLOAT.
Referenced by asFloat().
bool YCPValueRep::isInteger | ( | ) | const |
Checks, if the type of this value is YT_INTEGER.
References valuetype(), and YT_INTEGER.
Referenced by asInteger().
bool YCPValueRep::isList | ( | ) | const |
Checks, if the type of this value is YT_LIST
References valuetype(), and YT_LIST.
Referenced by asList().
bool YCPValueRep::isMap | ( | ) | const |
Checks, if the type of this value is YT_MAP.
References valuetype(), and YT_MAP.
Referenced by asMap().
bool YCPValueRep::isPath | ( | ) | const |
Checks, if the type of this value is YT_PATH.
References valuetype(), and YT_PATH.
Referenced by asPath().
bool YCPValueRep::isReference | ( | ) | const |
Checks, if the type of this value is YT_REFERENCE.
References valuetype(), and YT_REFERENCE.
Referenced by asReference().
bool YCPValueRep::isReturn | ( | ) | const |
Checks, if the type of this value is YT_RETURN.
References valuetype(), and YT_RETURN.
bool YCPValueRep::isString | ( | ) | const |
Checks, if the type of this value is YT_STRING.
References valuetype(), and YT_STRING.
Referenced by asString().
bool YCPValueRep::isSymbol | ( | ) | const |
Checks, if the type of this value is YT_SYMBOL.
References valuetype(), and YT_SYMBOL.
Referenced by asSymbol().
bool YCPValueRep::isTerm | ( | ) | const |
Checks, if the type of this value is YT_TERM. Note that a YCPTermRep also is a YCPListRep and has always also the type VT_LIST.
References valuetype(), and YT_TERM.
Referenced by asTerm().
bool YCPValueRep::isVoid | ( | ) | const |
Checks, if the type of this value is YT_VOID or YT_RETURN (explicitly returned void).
References valuetype(), YT_RETURN, and YT_VOID.
Referenced by asVoid().
virtual std::ostream& YCPValueRep::toXml | ( | std::ostream & | str, | |
int | indent | |||
) | const [pure virtual] |
Implements YCPElementRep.
Implemented in YCPBooleanRep, YCPByteblockRep, YCPCodeRep, YCPBreakRep, YCPReturnRep, YCPEntryRep, YCPReferenceRep, YCPExternalRep, YCPFloatRep, YCPIntegerRep, YCPListRep, YCPMapRep, YCPPathRep, YCPStringRep, YCPSymbolRep, YCPTermRep, and YCPVoidRep.
virtual YCPValueType YCPValueRep::valuetype | ( | ) | const [pure virtual] |
Returns the type of the value. If you just want to check, whether it is legal to cast an object of the YCPValueRep to a certain more specific object, you should use one of the is... methods.
Implemented in YCPBooleanRep, YCPByteblockRep, YCPCodeRep, YCPBreakRep, YCPReturnRep, YCPEntryRep, YCPReferenceRep, YCPExternalRep, YCPFloatRep, YCPIntegerRep, YCPListRep, YCPMapRep, YCPPathRep, YCPStringRep, YCPSymbolRep, YCPTermRep, and YCPVoidRep.
Referenced by compare(), isBoolean(), isBreak(), isByteblock(), isCode(), isEntry(), isExternal(), isFloat(), isInteger(), isList(), isMap(), isPath(), isReference(), isReturn(), isString(), isSymbol(), isTerm(), isVoid(), and valuetype_str().
const char * YCPValueRep::valuetype_str | ( | ) | const |
A string description of the type, for debugging only. (Not suitable for parsing)
References names, and valuetype().