~kklimonda/ubuntu/natty/glibmm2.4/update

« back to all changes in this revision

Viewing changes to gio/src/networkaddress.ccg

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-09-09 11:22:01 UTC
  • mfrom: (1.2.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20090909112201-1d7zaa574r0ayghb
Tags: 2.21.5-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
 
 
3
 
/* Copyright (C) 2007 The giomm Development Team
4
 
 *
5
 
 * This library is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU Lesser General Public
7
 
 * License as published by the Free Software Foundation; either
8
 
 * version 2.1 of the License, or (at your option) any later version.
9
 
 *
10
 
 * This library is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
 * Lesser General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU Lesser General Public
16
 
 * License along with this library; if not, write to the Free
17
 
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
 */
19
 
 
20
 
#include <gio/gio.h>
21
 
#include <giomm/asyncresult.h>
22
 
#include "slot_async.h"
23
 
 
24
 
namespace Gio
25
 
{
26
 
 
27
 
Glib::RefPtr<NetworkAddress>
28
 
NetworkAddress::parse(const std::string& host_and_port, guint16 default_port)
29
 
{
30
 
    GError *error = NULL;
31
 
    GNetworkAddress *address = G_NETWORK_ADDRESS
32
 
        (g_network_address_parse (host_and_port.c_str (), default_port,
33
 
                                                        &error));
34
 
    if (error)
35
 
        Glib::Error::throw_exception (error);
36
 
 
37
 
    return Glib::wrap (address);
38
 
}
39
 
 
40
 
} // namespace Gio