// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/sqlexpr.h>
#include <libgdamm/private/sqlexpr_p.h>

// -*- C++ -*- //

/* quarklist.ccg
 *
 * Copyright 2001      Free Software Foundation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <libgda/sql-parser/gda-statement-struct-parts.h>


namespace Gnome
{

namespace Gda
{

SqlExpr::SqlExpr(GdaSqlAnyPart *parent)
: gobject_(gda_sql_expr_new(parent))
{
}

bool SqlExpr::empty() const
{
  return !gobject_;
}

} // namespace Gda

} // namesoace Gnome

namespace
{
} // anonymous namespace


namespace Glib
{

Gnome::Gda::SqlExpr wrap(GdaSqlExpr* object, bool take_copy)
{
  return Gnome::Gda::SqlExpr(object, take_copy);
}

} // namespace Glib


namespace Gnome
{

namespace Gda
{


// static
GType SqlExpr::get_type()
{
  return gda_sql_expr_get_type();
}

SqlExpr::SqlExpr()
:
  gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
{}

SqlExpr::SqlExpr(const SqlExpr& other)
:
  gobject_ ((other.gobject_) ? gda_sql_expr_copy(other.gobject_) : 0)
{}

SqlExpr::SqlExpr(GdaSqlExpr* gobject, bool make_a_copy)
:
  // For BoxedType wrappers, make_a_copy is true by default.  The static
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
  // ensures identical behaviour if the default argument is used.
  gobject_ ((make_a_copy && gobject) ? gda_sql_expr_copy(gobject) : gobject)
{}

SqlExpr& SqlExpr::operator=(const SqlExpr& other)
{
  SqlExpr temp (other);
  swap(temp);
  return *this;
}

SqlExpr::~SqlExpr()
{
  if(gobject_)
    gda_sql_expr_free(gobject_);
}

void SqlExpr::swap(SqlExpr& other)
{
  GdaSqlExpr *const temp = gobject_;
  gobject_ = other.gobject_;
  other.gobject_ = temp;
}

GdaSqlExpr* SqlExpr::gobj_copy() const
{
  return gda_sql_expr_copy(gobject_);
}


Glib::ustring SqlExpr::serialize() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gda_sql_expr_serialize(const_cast<GdaSqlExpr*>(gobj())));
}


} // namespace Gda

} // namespace Gnome


