00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _ACEXML_URL_ADDR_H
00013 #define _ACEXML_URL_ADDR_H
00014
00015 #include "ace/pre.h"
00016 #include "ACEXML/common/ACEXML_Export.h"
00017
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif
00021
00022 #include "ace/Default_Constants.h"
00023 #include "ace/INET_Addr.h"
00024 #include "ACEXML/common/XML_Types.h"
00025 #include "ACEXML/common/ACEXML_Export.h"
00026
00027
00028
00029
00030
00031
00032 class ACEXML_Export ACEXML_URL_Addr : public ACE_INET_Addr
00033 {
00034 public:
00035
00036 ACEXML_URL_Addr (void);
00037
00038
00039 ACEXML_URL_Addr (const ACEXML_Char *host_name,
00040 const ACEXML_Char *path_name,
00041 unsigned short port = ACE_DEFAULT_HTTP_PORT);
00042
00043
00044 ACEXML_URL_Addr (const ACEXML_URL_Addr &addr);
00045
00046
00047 int set (const ACEXML_URL_Addr &addr);
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 virtual int string_to_addr (const ACEXML_Char* address,
00058 int address_family = AF_UNSPEC);
00059
00060
00061 #if defined (ACE_USES_WCHAR)
00062 virtual int string_to_addr (const char* addresss,
00063 int address_family = AF_UNSPEC);
00064 #endif
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 virtual int addr_to_string (ACEXML_Char *s,
00076 size_t size,
00077 int ipaddr_format = 1) const;
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 virtual const ACEXML_Char *addr_to_string (int ipaddr_format = 1);
00090
00091
00092 void operator= (const ACEXML_URL_Addr &addr);
00093
00094
00095 ~ACEXML_URL_Addr (void);
00096
00097
00098
00099
00100
00101 bool operator == (const ACEXML_URL_Addr &SAP) const;
00102
00103
00104 bool operator != (const ACEXML_URL_Addr &SAP) const;
00105
00106
00107 virtual u_long hash (void) const;
00108
00109
00110 const ACEXML_Char *get_path_name (void) const;
00111
00112
00113 int destroy (void);
00114
00115 private:
00116
00117
00118 size_t calculate_length (int ipaddr_format) const;
00119
00120
00121 ACEXML_Char *path_name_;
00122
00123
00124
00125 ACEXML_Char *addr_string_;
00126
00127
00128 size_t addr_string_len_;
00129 };
00130
00131 #if defined (__ACEXML_INLINE__)
00132 # include "ACEXML/common/URL_Addr.inl"
00133 #endif
00134
00135 #include "ace/post.h"
00136
00137 #endif