File: functionmanager.cpp

package info (click to toggle)
sqlitestudio 3.4.21%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 54,880 kB
  • sloc: ansic: 406,208; cpp: 123,872; yacc: 2,692; tcl: 497; sh: 462; xml: 426; makefile: 19
file content (39 lines) | stat: -rw-r--r-- 885 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "services/functionmanager.h"

FunctionManager::FunctionBase::FunctionBase()
{
}

FunctionManager::FunctionBase::~FunctionBase()
{
}

QString FunctionManager::FunctionBase::toString() const
{
    static const QString format = "%1(%2)";
    QString args = undefinedArgs ? "..." : arguments.join(", ");
    return format.arg(name).arg(args);
}

QString FunctionManager::FunctionBase::typeString(Type type)
{
    switch (type)
    {
        case ScriptFunction::SCALAR:
            return "SCALAR";
        case ScriptFunction::AGGREGATE:
            return "AGGREGATE";
    }
    return QString();
}

FunctionManager::ScriptFunction::Type FunctionManager::FunctionBase::typeString(const QString& type)
{
    if (type == "SCALAR")
        return ScriptFunction::SCALAR;

    if (type == "AGGREGATE")
        return ScriptFunction::AGGREGATE;

    return ScriptFunction::SCALAR;
}