libyui  3.3.1
YPropertyValue Class Reference

Transport class for the value of simple properties. More...

#include <YProperty.h>

Public Member Functions

 YPropertyValue (const std::string &str)
 Constructor for string properties.
 
 YPropertyValue (const char *str)
 Constructor for const char * (string) properties.
 
 YPropertyValue (bool b)
 Constructor for bool properties.
 
 YPropertyValue (YInteger num)
 Constructor for numerical (YCP integer) properties.
 
 YPropertyValue (int num)
 Constructor for numerical (YCP integer) properties.
 
 YPropertyValue (YPropertyType type)
 
 YPropertyValue ()
 Default constructor.
 
 ~YPropertyValue ()
 Destructor.
 
bool operator== (const YPropertyValue &other) const
 Equality operator, can compare with another YPropertyValue. More...
 
bool operator!= (const YPropertyValue &other) const
 Inequality operator. More...
 
YPropertyType type () const
 Returns the type of this property value. More...
 
std::string typeAsStr () const
 Returns the type of this property value as string.
 
std::string stringVal () const
 Methods to get the value of this property. More...
 
bool boolVal () const
 
YInteger integerVal () const
 

Detailed Description

Transport class for the value of simple properties.

More complex properties (lists of items, tree descriptions, ...) have to be handled specifically someplace else, but most properties are of simple types and can be treated in similar ways.

Definition at line 104 of file YProperty.h.

Member Function Documentation

◆ operator!=()

bool YPropertyValue::operator!= ( const YPropertyValue other) const

Inequality operator.

Exceptions
YUIExceptionfor incompatible property types
See also
operator==

Definition at line 75 of file YProperty.cc.

◆ operator==()

bool YPropertyValue::operator== ( const YPropertyValue other) const

Equality operator, can compare with another YPropertyValue.

Exceptions
YUIExceptionfor incompatible property types
Returns
true if the value is the same

Definition at line 53 of file YProperty.cc.

Here is the call graph for this function:

◆ stringVal()

std::string YPropertyValue::stringVal ( ) const
inline

Methods to get the value of this property.

Check with type() which one to use.

Definition at line 180 of file YProperty.h.

◆ type()

YPropertyType YPropertyValue::type ( ) const
inline

Returns the type of this property value.

Use this to determine which xyVal() method to use.

Definition at line 169 of file YProperty.h.


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