yast2-core
Public Member Functions | List of all members
YCPValueRep Class Referenceabstract

Abstract base class of all YCP values. Abstract base class of all YCP elements that can be used as primary data, that can be stored in the SCR and that can be parsed as a whole. An important property of a value is, that its ASCII representation uniquely specifies its type. The parser's output is a stream of YCPValues, not of YCPElements. More...

#include <YCPValue.h>

Inheritance diagram for YCPValueRep:
YCPElementRep YCPBooleanRep YCPBreakRep YCPByteblockRep YCPCodeRep YCPEntryRep YCPExternalRep YCPFloatRep YCPIntegerRep YCPListRep YCPMapRep YCPPathRep YCPReferenceRep YCPReturnRep YCPStringRep YCPSymbolRep YCPTermRep YCPVoidRep

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
 
- Public Member Functions inherited from YCPElementRep
YCPValue asValue () const
 
virtual string toString () const =0
 
virtual std::ostream & toStream (std::ostream &str) const =0
 
virtual const YCPElementRepshallowCopy () const
 

Additional Inherited Members

- Protected Member Functions inherited from YCPElementRep
 YCPElementRep ()
 
virtual ~YCPElementRep ()
 

Detailed Description

Abstract base class of all YCP values. Abstract base class of all YCP elements that can be used as primary data, that can be stored in the SCR and that can be parsed as a whole. An important property of a value is, that its ASCII representation uniquely specifies its type. The parser's output is a stream of YCPValues, not of YCPElements.

Member Function Documentation

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().

YCPOrder YCPValueRep::compare ( const YCPValue v,
bool  rl = false 
) const

Compares two YCP values for equality, greaterness or smallerness. You should not compare values of different types.

Parameters
vvalue to compare against
rlrespect locale
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 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

Compares two YCP values for equality. Two values are equal if they have the same type and the same contents.

References compare(), and YO_EQUAL.

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
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 YCPReferenceRep, YCPEntryRep, YCPReturnRep, YCPListRep, YCPPathRep, YCPTermRep, YCPMapRep, YCPBreakRep, YCPStringRep, YCPByteblockRep, YCPFloatRep, YCPSymbolRep, YCPBooleanRep, YCPIntegerRep, YCPCodeRep, YCPExternalRep, 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().


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

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