: Parser()
{
m_elementList = list;
+ m_aliasList = new (QSet<QString>);
}
MoleculeParser::MoleculeParser(const QString& _str)
: Parser(_str)
{
+ m_aliasList = new (QSet<QString>);
}
{
if ( _shortMoleculeString.isEmpty() )
return false;
+ // Clear the list of aliases and start filling it again.
+
+ m_aliasList -> clear();
QString _moleculeString;
// Clear the result variables and set m_error to false
_resultMap->clear();
return true;
}
-
+QSet<QString>*
+MoleculeParser::getAliasList(void)
+{
+ return m_aliasList;
+}
// ----------------------------------------------------------------
// helper methods for the public methods
// If short term is found, return fullForm
if (shortForm == _group)
+ {
+ *m_aliasList << (_group + " : " + fullForm);
return (fullForm);
+ }
}
}
else
fullForm.remove(QChar('\"'));
if (shortForm == _group)
+ {
+ *m_aliasList << (_group + " : " + fullForm);
return (fullForm);
+ }
}
}
else
* The Element of the object
*/
Element *m_element;
-
/**
* The number of occurrences
*/
bool weight(const QString& _moleculeString,
double *_resultMass,
ElementCountMap *_resultMap);
+
+ QSet<QString>* getAliasList(void);
private:
// Helper functions
bool parseSubmolecule(double *_resultMass,
Element *lookupElement( const QString& _name );
QMap<Element*, int> m_elementMap;
-
+
+ // Contains the list of aliases eg, { "Et - C2H5", "Me - CH3"}
+ QSet<QString> *m_aliasList;
//if this booloean is "true" the parser found an error
bool m_error;