]> Git trees. - libqmvoc.git/commitdiff
* make one public member private
authorCarsten Niehaus <cniehaus@gmx.de>
Sat, 31 Dec 2005 10:42:33 +0000 (10:42 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Sat, 31 Dec 2005 10:42:33 +0000 (10:42 +0000)
* 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

libscience/Makefile.am
libscience/moleculeparser.cpp
libscience/moleculeparser.h
libscience/parser.h

index 03c5cc85b5cebfe5c8dcdc16545a5e590613e357..f40f1358b6a953313d5f880c7adb0f65f3ec3a53 100644 (file)
@@ -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) 
index 7f7845ca0467fef475b8423f21a103f12484c39f..d8ccebe34c60ae1c6d75c45178e9ac594e9f99ce 100644 (file)
 
 #include <kdebug.h>
 
-#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<Element*> 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;
 }
index 2948dcae783dab92e78177761c897e17b84c7e00..b9ff8e44868c428ed098eaf79168d709b203e69f 100644 (file)
@@ -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<ElementCount*>::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<Element*, int> m_elementMap;
index 37355f808c4c029a78430616f6d4a5382314b32d..ee2437b4e5de10fa69de04a70a12c34840405db5 100644 (file)
@@ -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.