1
/*************************************************************************************
2
* Copyright (C) 2008 by Aleix Pol <aleixpol@kde.org> *
4
* This program is free software; you can redistribute it and/or *
5
* modify it under the terms of the GNU General Public License *
6
* as published by the Free Software Foundation; either version 2 *
7
* of the License, or (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the Free Software *
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
17
*************************************************************************************/
19
#ifndef STRINGEXPRESSIONWRITER_H
20
#define STRINGEXPRESSIONWRITER_H
22
#include "expressionwriter.h"
29
* This class represents the string expression writer.
31
* @author Aleix Pol <aleixpol@kde.org>
34
class StringExpressionWriter : public ExpressionWriter
37
StringExpressionWriter(const Object* o);
39
virtual QString accept(const Ci* var);
40
virtual QString accept(const Cn* var);
41
virtual QString accept(const Container* var);
42
virtual QString accept(const Operator* var);
43
virtual QString accept(const Vector* var);
44
virtual QString accept(const List* l);
45
virtual QString accept(const Apply* a);
46
virtual QString accept(const CustomObject* c);
48
QString result() const { return m_result; }
50
static int weight(const Operator* op, int size);
51
static const QMap<Operator::OperatorType, QString> s_operators;
54
static QStringList allValues(T it, const T& itEnd, ExpressionWriter* writer);