Seamly2D
Code documentation
qmuformulabase.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  **
3  ** Copyright (C) 2015 Roman Telezhynskyi
4  **
5  ** Permission is hereby granted, free of charge, to any person obtaining a copy of this
6  ** software and associated documentation files (the "Software"), to deal in the Software
7  ** without restriction, including without limitation the rights to use, copy, modify,
8  ** merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9  ** permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  **
11  ** The above copyright notice and this permission notice shall be included in all copies or
12  ** substantial portions of the Software.
13  **
14  ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
15  ** NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16  ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17  ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  **
20  ******************************************************************************************************/
21 
22 #ifndef QMUFORMULABASE_H
23 #define QMUFORMULABASE_H
24 
25 #include <qcompilerdetection.h>
26 #include <QString>
27 #include <QtGlobal>
28 
29 #include "qmuparser.h"
30 
31 template <class Key, class T> class QMap;
32 
33 namespace qmu
34 {
35 
36 class QmuFormulaBase : public QmuParser
37 {
38 public:
40  virtual ~QmuFormulaBase() Q_DECL_OVERRIDE;
41 
42  virtual void InitCharSets() Q_DECL_OVERRIDE;
43 
44  static void RemoveAll(QMap<int, QString> &map, const QString &val);
45 
46 protected:
47  static qreal* AddVariable(const QString &a_szName, void *a_pUserData);
48  void SetSepForTr(bool osSeparator, bool fromUser);
49  void SetSepForEval();
50 private:
51  Q_DISABLE_COPY(QmuFormulaBase)
52 };
53 
54 } // namespace qmu
55 
56 #endif // QMUFORMULABASE_H
virtual void InitCharSets() Q_DECL_OVERRIDE
InitCharSets init character set for parser.
virtual ~QmuFormulaBase() Q_DECL_OVERRIDE
void SetSepForTr(bool osSeparator, bool fromUser)
SetSepForTr set separators for translation expression.
void SetSepForEval()
SetSepForEval set separators for eval. Each expression eval in internal (C) locale.
static void RemoveAll(QMap< int, QString > &map, const QString &val)
RemoveAll remove token from token list.
static qreal * AddVariable(const QString &a_szName, void *a_pUserData)
Mathematical expressions parser.
Definition: qmuparser.h:50
Namespace for mathematical applications.
Definition of the standard floating point parser.