/* $Id: datasourceinfo.ccg,v 1.2 2004/04/04 20:40:00 murrayc Exp $ */ // -*- C++ -*- // /* datasourceinfo.cc * * Copyright 2003 libgdamm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ namespace Gnome { namespace Gda { DataSourceInfo::DataSourceInfo() { gobject_ = g_new0 (GdaDataSourceInfo, 1); set_cnc_string(""); //libgda prints a warning if this is NULL. } DataSourceInfo::operator bool() const { return gobj() != 0; } void DataSourceInfo::set_name(const Glib::ustring& value) { if(gobj()->name) { g_free(gobj()->name); gobj()->name = 0; } gobj()->name = g_strdup( (value).c_str() ); } void DataSourceInfo::set_provider(const Glib::ustring& value) { if(gobj()->provider) { g_free(gobj()->provider); gobj()->provider = 0; } gobj()->provider = g_strdup( (value).c_str() ); } void DataSourceInfo::set_cnc_string(const Glib::ustring& value) { if(gobj()->cnc_string) { g_free(gobj()->cnc_string); gobj()->cnc_string = 0; } gobj()->cnc_string = g_strdup( (value).c_str() ); } void DataSourceInfo::set_description(const Glib::ustring& value) { if(gobj()->description) { g_free(gobj()->description); gobj()->description = 0; } gobj()->description = g_strdup( (value).c_str() ); } void DataSourceInfo::set_username(const Glib::ustring& value) { if(gobj()->username) { g_free(gobj()->username); gobj()->username = 0; } gobj()->username = g_strdup( (value).c_str() ); } void DataSourceInfo::set_password(const Glib::ustring& value) { if(gobj()->password) { g_free(gobj()->password); gobj()->password = 0; } gobj()->password = g_strdup( (value).c_str() ); } } //namespace Gda } // namespace Gnome