diff options
author | Marius Kintel <marius@kintel.net> | 2010-11-07 21:29:34 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-11-07 21:29:34 (GMT) |
commit | e0a068a0e8678da426e1edd398feab5f4ea4d0f0 (patch) | |
tree | 5eaa05991d1652fd10692eb7410143d973db6643 /src/func.cc | |
parent | d310e364d14444a1a27ae2337cfb4bd0ab061113 (diff) |
Refactored some QString usage in the backend to std::string
Diffstat (limited to 'src/func.cc')
-rw-r--r-- | src/func.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/func.cc b/src/func.cc index eb0afcd..d73b152 100644 --- a/src/func.cc +++ b/src/func.cc @@ -29,6 +29,7 @@ #include "dxfdim.h" #include "builtin.h" #include <math.h> +#include <sstream> AbstractFunction::~AbstractFunction() { @@ -68,9 +69,9 @@ QString Function::dump(QString indent, QString name) const text += QString(", "); text += argnames[i]; if (argexpr[i]) - text += QString(" = ") + argexpr[i]->dump(); + text += QString(" = ") + QString::fromStdString(argexpr[i]->toString()); } - text += QString(") = %1;\n").arg(expr->dump()); + text += QString(") = %1;\n").arg(QString::fromStdString(expr->toString())); return text; } @@ -257,15 +258,12 @@ Value builtin_ln(const Context *, const QVector<QString>&, const QVector<Value> Value builtin_str(const Context *, const QVector<QString>&, const QVector<Value> &args) { - QString str; - for (int i = 0; i < args.size(); i++) - { - if (args[i].type == Value::STRING) - str += args[i].text; - else - str += args[i].dump(); + std::stringstream stream; + + for (int i = 0; i < args.size(); i++) { + stream << args[i]; } - return Value(str); + return Value(stream.str()); } Value builtin_lookup(const Context *, const QVector<QString>&, const QVector<Value> &args) |