00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_IP_ADDRESS_H_
00028 #define CEYLAN_IP_ADDRESS_H_
00029
00030
00031 #include "CeylanNetwork.h"
00032 #include "CeylanTextDisplayable.h"
00033
00034
00035 #include <string>
00036
00037
00038
00039 namespace Ceylan
00040 {
00041
00042
00043 namespace Network
00044 {
00045
00046
00047
00049 class CEYLAN_DLL IPAddressException: public NetworkException
00050 {
00051
00052 public:
00053
00054
00055 explicit IPAddressException( const std::string message ):
00056 NetworkException( message )
00057 {
00058
00059 }
00060
00061 } ;
00062
00063
00064
00065
00072 class CEYLAN_DLL IPAddress: public TextDisplayable
00073 {
00074
00075
00076 public:
00077
00078
00079
00081 IPAddress() ;
00082
00083
00085 virtual ~IPAddress() throw() ;
00086
00087
00088
00094 virtual NetworkAddressType getType() const = 0 ;
00095
00096
00097
00112 virtual const std::string toString(
00113 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00114
00115
00116
00123 static bool IsValid( const std::string IPString ) ;
00124
00125
00126
00127
00128 protected:
00129
00130
00136 virtual void validate() const = 0 ;
00137
00138
00139
00140
00141 private:
00142
00143
00144
00153 IPAddress( const IPAddress & source ) ;
00154
00155
00156
00165 IPAddress & operator = ( const IPAddress & source ) ;
00166
00167
00168 } ;
00169
00170
00171 }
00172
00173
00174 }
00175
00176
00177
00178 #endif // CEYLAN_IP_ADDRESS_H_
00179