From: Carsten Niehaus Date: Sat, 31 Dec 2005 10:42:33 +0000 (+0000) Subject: * make one public member private X-Git-Tag: v3.80.2~201 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=16e9e396725646aa8d95e896c6eecb0fa77e2e71;p=libqmvoc.git * make one public member private * add many apidox-comments, but the content is missing. Inge: Perhaps you could add some here? I find it difficult to add them, to be honest CCMAIL:kalzium@kde.org svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=492832 --- diff --git a/libscience/Makefile.am b/libscience/Makefile.am index 03c5cc8..f40f135 100644 --- a/libscience/Makefile.am +++ b/libscience/Makefile.am @@ -13,7 +13,9 @@ libscience_la_SOURCES = \ elementparser.cpp \ isotopeparser.cpp \ tempunit.cpp \ - chemicaldataobject.cpp + chemicaldataobject.cpp \ + moleculeparser.cpp \ + parser.cpp libscience_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 4:0:0 libscience_la_LIBADD = $(LIB_KDEUI) diff --git a/libscience/moleculeparser.cpp b/libscience/moleculeparser.cpp index 7f7845c..d8ccebe 100644 --- a/libscience/moleculeparser.cpp +++ b/libscience/moleculeparser.cpp @@ -16,7 +16,10 @@ #include -#include "kalziumdataobject.h" +/* PORTING + * #include "kalziumdataobject.h" + */ + #include "moleculeparser.h" @@ -188,10 +191,6 @@ MoleculeParser::parseTerm(double *_resultMass, *_resultMass = 0.0; _resultMap->clear(); -#if 0 - kdDebug() << "parseTerm(): Next token = " - << nextToken() << endl; -#endif if (nextToken() == ELEMENT_TOKEN) { //kdDebug() << "Parsed an element: " << m_elementVal->symbol() << endl; *_resultMass = m_elementVal->dataAsVariant( ChemicalDataObject::mass ).toDouble(); @@ -282,6 +281,9 @@ MoleculeParser::getNextToken() Element * MoleculeParser::lookupElement( const QString& _name ) { + /** PORTING this cannot work because of course there is no KDO known in + * this library. We need to find a workaround here... + QList elementList = KalziumDataObject::instance()->ElementList; //kdDebug() << "looking up " << _name << endl; @@ -300,5 +302,7 @@ MoleculeParser::lookupElement( const QString& _name ) m_error = true; kdDebug() << k_funcinfo << "no such element, parsing error!: " << _name << endl; + + */ return NULL; } diff --git a/libscience/moleculeparser.h b/libscience/moleculeparser.h index 2948dca..b9ff8e4 100644 --- a/libscience/moleculeparser.h +++ b/libscience/moleculeparser.h @@ -57,15 +57,45 @@ class ElementCountMap { ElementCountMap(); ~ElementCountMap(); + /** + * + */ void clear() { m_map.clear(); } + /** + * @param _element + */ ElementCount *search(Element *_element); + + /** + * @param _map + */ void add(ElementCountMap &_map); + + /** + * @param _element + * @param _count + */ void add(Element *_element, int _count); + + /** + * @param _factor + */ void multiply(int _factor); + /** + * typedef + */ typedef QList::Iterator Iterator; + + /** + * + */ Iterator begin() { return m_map.begin(); } + + /** + * + */ Iterator end() { return m_map.end(); } private: @@ -96,15 +126,30 @@ class ElementCountMap { class MoleculeParser : public Parser { public: - static const int ELEMENT_TOKEN = 300; - + /** + * Constructor + */ MoleculeParser(); + + /** + * Constructor + * + * @param _str @ref Parser::start the parsing with @p _str + */ MoleculeParser( const QString& _str); + + /** + * Destructor + */ virtual ~MoleculeParser(); /** * Try to parse the molecule @p molecule and get the weight of it. * The calculated weight is stored in @p _result. + * + * @param _moleculeString + * @param _resultMass + * @param _resultMap * * @return whether the parsing was successful or not */ @@ -118,6 +163,8 @@ public: bool parseTerm(double *_resultMass, ElementCountMap *_resultMap); + static const int ELEMENT_TOKEN = 300; + Element *lookupElement( const QString& _name ); QMap m_elementMap; diff --git a/libscience/parser.h b/libscience/parser.h index 37355f8..ee2437b 100644 --- a/libscience/parser.h +++ b/libscience/parser.h @@ -31,9 +31,22 @@ public: static const int FLOAT_TOKEN = 258; // Extend this list in your subclass to make a more advanced parser. + /** + * Constructor + */ Parser(); + + /** + * Constructor + * + * @param _str @ref start the parsing with @p _str + */ Parser(const QString& _str); - virtual ~Parser(); + + /** + * Destructor + */ + virtual ~Parser(); /** * Start a new parse.