kalzium/libscience
#include <moleculeparser.h>
Public Member Functions | |
MoleculeParser (const QList< Element * > &list) | |
MoleculeParser (const QString &_str) | |
virtual | ~MoleculeParser () |
QSet< QString > | aliasList () |
bool | weight (const QString &_moleculeString, double *_resultMass, ElementCountMap *_resultMap) |
Public Member Functions inherited from Parser | |
Parser () | |
Parser (const QString &_str) | |
virtual | ~Parser () |
float | floatVal () const |
int | intVal () const |
int | nextChar () const |
int | nextToken () const |
void | start (const QString &_str) |
Protected Member Functions | |
virtual int | getNextToken () |
Protected Member Functions inherited from Parser | |
int | getNextChar () |
int | skipWhitespace () |
Additional Inherited Members | |
Protected Attributes inherited from Parser | |
double | m_floatVal |
int | m_intVal |
int | m_nextToken |
Static Protected Attributes inherited from Parser | |
static const int | FLOAT_TOKEN = 258 |
static const int | INT_TOKEN = 257 |
Detailed Description
Parse molecule formulas.
Usage:
If a short form of a compound is specified, it will be expanded. Example :- EtOH -> (C2H5OH)
Definition at line 182 of file moleculeparser.h.
Constructor & Destructor Documentation
- Parameters
-
list This list of chemical elements will be used internally for searching and matching with searched strings Constructor
Definition at line 100 of file moleculeparser.cpp.
MoleculeParser::MoleculeParser | ( | const QString & | _str | ) |
Constructor.
- Parameters
-
_str Parser::start the parsing with _str
Definition at line 108 of file moleculeparser.cpp.
|
virtual |
Destructor.
Definition at line 115 of file moleculeparser.cpp.
Member Function Documentation
Definition at line 166 of file moleculeparser.cpp.
|
protectedvirtual |
Extends the standard tokenizer in Parser::getNextToken().
Reimplemented from Parser.
Definition at line 263 of file moleculeparser.cpp.
bool MoleculeParser::weight | ( | const QString & | _moleculeString, |
double * | _resultMass, | ||
ElementCountMap * | _resultMap | ||
) |
Try to parse the molecule molecule
and get the weight of it.
The calculated weight is stored in _result
.
- Parameters
-
_moleculeString _resultMass _resultMap
- Returns
- whether the parsing was successful or not
Definition at line 130 of file moleculeparser.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.