kget
address.cpp
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Joris Guisson * 00003 * joris.guisson@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 00021 #include "address.h" 00022 00023 using namespace KNetwork; 00024 00025 namespace net 00026 { 00027 00028 Address::Address() 00029 { 00030 } 00031 00032 Address::Address(const QString & host,Uint16 port) : KInetSocketAddress(KIpAddress(host),port) 00033 { 00034 } 00035 00036 Address::Address(const Address & addr) : KInetSocketAddress(addr) 00037 { 00038 } 00039 00040 Address::Address(const KNetwork::KInetSocketAddress & addr) : KInetSocketAddress(addr) 00041 {} 00042 00043 Address:: ~Address() 00044 {} 00045 00046 /* 00047 Address & Address::operator = (const Address & a) 00048 { 00049 m_ip = a.ip(); 00050 m_port = a.port(); 00051 return *this; 00052 } 00053 00054 00055 bool Address::operator == (const Address & a) 00056 { 00057 return m_ip == a.ip() && m_port == a.port(); 00058 } 00059 00060 QString Address::toString() const 00061 { 00062 return QString("%1.%2.%3.%4") 00063 .arg((m_ip & 0xFF000000) >> 24) 00064 .arg((m_ip & 0x00FF0000) >> 16) 00065 .arg((m_ip & 0x0000FF00) >> 8) 00066 .arg(m_ip & 0x000000FF); 00067 } 00068 */ 00069 }
KDE 4.2 API Reference