libyui
 
Loading...
Searching...
No Matches
YPropertyValue Class Reference

#include <YProperty.h>

Public Member Functions

 YPropertyValue (const std::string &str)
 
 YPropertyValue (const char *str)
 
 YPropertyValue (bool b)
 
 YPropertyValue (YInteger num)
 
 YPropertyValue (int num)
 
 YPropertyValue (YPropertyType type)
 
 YPropertyValue ()
 
 ~YPropertyValue ()
 
bool operator== (const YPropertyValue &other) const
 
bool operator!= (const YPropertyValue &other) const
 
YPropertyType type () const
 
std::string typeAsStr () const
 
std::string stringVal () const
 
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.

Constructor & Destructor Documentation

◆ YPropertyValue() [1/6]

YPropertyValue::YPropertyValue ( const std::string & str)
inline

Constructor for string properties.

◆ YPropertyValue() [2/6]

YPropertyValue::YPropertyValue ( const char * str)
inline

Constructor for const char * (string) properties.

◆ YPropertyValue() [3/6]

YPropertyValue::YPropertyValue ( bool b)
inlineexplicit

Constructor for bool properties.

◆ YPropertyValue() [4/6]

YPropertyValue::YPropertyValue ( YInteger num)
inlineexplicit

Constructor for numerical (YCP integer) properties.

◆ YPropertyValue() [5/6]

YPropertyValue::YPropertyValue ( int num)
inlineexplicit

Constructor for numerical (YCP integer) properties.

◆ YPropertyValue() [6/6]

YPropertyValue::YPropertyValue ( )
inline

Default constructor

◆ ~YPropertyValue()

YPropertyValue::~YPropertyValue ( )

Destructor.

Member Function Documentation

◆ operator!=()

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

Inequality operator

Exceptions
YUIExceptionfor incompatible property types
See also
operator==

◆ 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

◆ stringVal()

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

Methods to get the value of this property. Check with type() which one to use.

◆ type()

YPropertyType YPropertyValue::type ( ) const
inline

Returns the type of this property value. Use this to determine which xyVal() method to use.

◆ typeAsStr()

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

Returns the type of this property value as string.


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