return bounit;
}
+
+ChemicalDataObject::BlueObeliskUnit ChemicalDataObject::unit( const QString& unit )
+{
+ if ( unit == "bo:kelvin" )
+ return ChemicalDataObject::kelvin;
+ else if ( unit == "bo:ev" )
+ return ChemicalDataObject::ev;
+ else if ( unit == "bo:nm" )
+ return ChemicalDataObject::nm;
+ else if ( unit == "bo:pm" )
+ return ChemicalDataObject::pm;
+ else if ( unit == "bo:noUnit" )
+ return ChemicalDataObject::noUnit;
+ else
+ return ChemicalDataObject::noUnit;
+}
void setUnit( BlueObeliskUnit unit ){
m_unit = unit;
}
+
+ /**
+ * @return the BlueObeliskUnit of a ChemicalDataObject corresponding to @p text
+ * @param text the attribute-text of the XML parsed
+ */
+ static BlueObeliskUnit unit( const QString& unitname );
private:
QVariant m_value;
{
if ( attrs.localName( i ) == "unit" )
{
- currentUnit_ = unit( attrs.value( i ) );
+ currentUnit_ = ChemicalDataObject::unit( attrs.value( i ) );
continue;
}
{
return elements_;
}
-
-ChemicalDataObject::BlueObeliskUnit ElementSaxParser::unit( const QString& unit )
-{
- if ( unit == "bo:kelvin" )
- return ChemicalDataObject::kelvin;
- else if ( unit == "bo:ev" )
- return ChemicalDataObject::ev;
- else if ( unit == "bo:nm" )
- return ChemicalDataObject::nm;
- else if ( unit == "bo:pm" )
- return ChemicalDataObject::pm;
- else if ( unit == "bo:noUnit" )
- return ChemicalDataObject::noUnit;
- else
- return ChemicalDataObject::noUnit;
-}
private:
ChemicalDataObject *currentDataObject_;
ChemicalDataObject::BlueObeliskUnit currentUnit_;
-
- /**
- * @return the BlueObeliskUnit of a ChemicalDataObject corresponding to @p text
- * @param text the attribute-text of the XML parsed
- */
- ChemicalDataObject::BlueObeliskUnit unit( const QString& text );
Element *currentElement_;
QList<Element*> elements_;