mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-29 06:12:35 -06:00
support PG11
Поддержка PostgreSQL 11 только для Windows
This commit is contained in:
commit
4af765213c
1765 changed files with 407959 additions and 0 deletions
128
pgscript/objects/pgsVariable.cpp
Normal file
128
pgscript/objects/pgsVariable.cpp
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pgScript - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2002 - 2016, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "pgAdmin3.h"
|
||||
#include "pgscript/objects/pgsVariable.h"
|
||||
|
||||
pgsVariable::pgsVariable(const pgsTypes &type) :
|
||||
pgsExpression(), m_type(type)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
pgsVariable::~pgsVariable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MAPM pgsVariable::num(const pgsOperand &var)
|
||||
{
|
||||
return pgsMapm::pgs_str_mapm(var->value());
|
||||
}
|
||||
|
||||
MAPM pgsVariable::num(const wxString &var)
|
||||
{
|
||||
return pgsMapm::pgs_str_mapm(var);
|
||||
}
|
||||
|
||||
bool pgsVariable::is_number() const
|
||||
{
|
||||
return is_integer() || is_real();
|
||||
}
|
||||
|
||||
bool pgsVariable::is_integer() const
|
||||
{
|
||||
return m_type == pgsTInt;
|
||||
}
|
||||
|
||||
bool pgsVariable::is_real() const
|
||||
{
|
||||
return m_type == pgsTReal;
|
||||
}
|
||||
|
||||
bool pgsVariable::is_string() const
|
||||
{
|
||||
return m_type == pgsTString;
|
||||
}
|
||||
|
||||
bool pgsVariable::is_record() const
|
||||
{
|
||||
return m_type == pgsTRecord;
|
||||
}
|
||||
|
||||
const pgsVariable::pgsTypes &pgsVariable::type() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
pgsOperand operator+(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_plus(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator-(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_minus(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator*(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_times(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator/(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_over(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator%(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_modulo(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator==(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_equal(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator!=(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_different(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator<(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_lower(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator>(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_greater(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator<=(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_lower_equal(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator>=(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_greater_equal(rhs);
|
||||
}
|
||||
|
||||
pgsOperand operator!(const pgsVariable &lhs)
|
||||
{
|
||||
return lhs.pgs_not();
|
||||
}
|
||||
|
||||
pgsOperand operator&=(const pgsVariable &lhs, const pgsVariable &rhs)
|
||||
{
|
||||
return lhs.pgs_almost_equal(rhs);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue