One part of StyleValue list, variant / tagged union type with some convertions.
More...
#include <Valuable/StyleValue.hpp>
One part of StyleValue list, variant / tagged union type with some convertions.
| Valuable::StyleValue::Component::Component |
( |
float |
f, |
|
|
Attribute::ValueUnit |
unit = Attribute::VU_UNKNOWN |
|
) |
| |
Create a floating point type with optional unit.
- Parameters
-
| Valuable::StyleValue::Component::Component |
( |
int |
i | ) |
|
Create a integer component.
- Parameters
-
| Valuable::StyleValue::Component::Component |
( |
const Radiant::Color & |
color | ) |
|
Create a color component.
- Parameters
-
| Valuable::StyleValue::Component::Component |
( |
const QString & |
string | ) |
|
Create a string component.
- Parameters
-
| Valuable::StyleValue::Component::Component |
( |
const QByteArray & |
keyword | ) |
|
Create a keyword component.
- Parameters
-
| Valuable::StyleValue::Component::Component |
( |
const Component & |
component | ) |
|
Make a copy of the component.
- Parameters
-
| component | component to copy |
| Valuable::StyleValue::Component::Component |
( |
Component && |
component | ) |
|
Move a component.
- Parameters
-
| component | component to move |
- Returns
- the component value as color, if the type is not color, prints an error and returns a default Radiant::Color()
| float Valuable::StyleValue::Component::asFloat |
( |
| ) |
const |
- Returns
- the component value as float, works with int and float types, otherwise prints an error and returns zero
| int Valuable::StyleValue::Component::asInt |
( |
| ) |
const |
- Returns
- the component value as integer, works with int and float types, otherwise prints an error and returns zero
| QByteArray Valuable::StyleValue::Component::asKeyword |
( |
| ) |
const |
- Returns
- the component value as keyword, works with string and keyword types, otherwise prints an error and returns a null bytearray
| QString Valuable::StyleValue::Component::asString |
( |
| ) |
const |
- Returns
- the component value as string, works with string and keyword types, otherwise prints an error and returns a null string
- Parameters
-
| t | try to convert this component to this type |
- Returns
- true if this component could be converted to type t
| bool Valuable::StyleValue::Component::isNumber |
( |
| ) |
const |
- Returns
- true if component is either int or float
Make a copy of the component.
- Parameters
-
| component | component to copy |
- Returns
- reference to this
Move a component.
- Parameters
-
| component | component to move |
- Returns
- reference to this
| bool Valuable::StyleValue::Component::operator== |
( |
const Component & |
v | ) |
const |
Compares two components, does no type conversions, types need to be exactly the same.
- Parameters
-
| v | other component to compare to |
- Returns
- true if components are identical
| bool Valuable::StyleValue::Component::operator== |
( |
const QByteArray & |
str | ) |
const |
Compares this component string / keyword to the given bytearray.
- Parameters
-
- Returns
- true if component string or keyword equals to str
| Separator Valuable::StyleValue::Component::separator |
( |
| ) |
const |
|
inline |
- Returns
- separator token preceding this component in a StyleValue
| void Valuable::StyleValue::Component::setSeparator |
( |
Separator |
separator | ) |
|
|
inline |
| ValueType Valuable::StyleValue::Component::type |
( |
| ) |
const |
|
inline |
- Returns
- the type of the component
| const char* Valuable::StyleValue::Component::typeName |
( |
| ) |
const |
- Returns
- string representation of the type
- Returns
- component type, VU_UNKNOWN if the type is not a number