00001 /* 00002 * synergy -- mouse and keyboard sharing utility 00003 * Copyright (C) 2012 Bolton Software Ltd. 00004 * Copyright (C) 2002 Chris Schoeneman 00005 * 00006 * This package is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * found in the file COPYING that should have accompanied this file. 00009 * 00010 * This package 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, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef CNETWORKADDRESS_H 00020 #define CNETWORKADDRESS_H 00021 00022 #include "CString.h" 00023 #include "BasicTypes.h" 00024 #include "IArchNetwork.h" 00025 00027 00030 class CNetworkAddress { 00031 public: 00035 CNetworkAddress(); 00036 00041 CNetworkAddress(int port); 00042 00053 CNetworkAddress(const CString& hostname, int port); 00054 00055 CNetworkAddress(const CNetworkAddress&); 00056 00057 ~CNetworkAddress(); 00058 00059 CNetworkAddress& operator=(const CNetworkAddress&); 00060 00062 00063 00065 00071 void resolve(); 00072 00074 00075 00076 00078 00081 bool operator==(const CNetworkAddress& address) const; 00082 00084 00087 bool operator!=(const CNetworkAddress& address) const; 00088 00090 00093 bool isValid() const; 00094 00096 00100 const CArchNetAddress& getAddress() const; 00101 00103 00107 int getPort() const; 00108 00110 00113 CString getHostname() const; 00114 00116 00117 private: 00118 void checkPort(); 00119 00120 private: 00121 CArchNetAddress m_address; 00122 CString m_hostname; 00123 int m_port; 00124 }; 00125 00126 #endif
1.7.1