Go to the documentation of this file.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
00028
00029
00030
00031
00032 #ifndef URIH
00033 #define URIH
00034
00035 #include <zeusbase/System/ZObject.h>
00036
00037 BEGIN_NAMESPACE_Zeus
00038
00039
00043
00044 zeusbase_class TURI : public TZObject
00045 {
00046 public:
00047 TURI(const IString& rPath);
00048 TURI(TString strPath);
00049 TURI(const TURI& rURI);
00050 virtual ~TURI();
00051
00052 void assign(const TURI& rURI);
00053 bool equals(const TURI& rURI) const;
00054
00055 TString getAuthority() const;
00056 TString getHostName() const;
00057 TString getPath() const;
00058 Uint getPort() const;
00059 TString getProtocol() const;
00060 bool isValid() const;
00061 bool isEmpty() const;
00062 TString toString() const;
00063
00064 bool operator==(const TURI& rURI) const;
00065 bool operator!=(const TURI& rURI) const;
00066 TURI& operator=(const TURI& rURI);
00067
00068 protected:
00069 void setAuthority(const IString& rValue);
00070 void setHostName(const IString& rValue);
00071 void setPath(const IString& rValue);
00072 void setPort(Uint uiPort);
00073 void setProtocol(const IString& rValue);
00074
00075 private:
00077 TString m_strAuthority;
00079 TString m_strHostName;
00081 TString m_strURI;
00083 TString m_strProtocol;
00085 TString m_strPath;
00087 Uint m_uiPort;
00089 bool m_bValid;
00090
00091
00092 void analysePath();
00093 static bool scann_AbsURI(TURI& rURI, TByteArray& rArray);
00094
00095 static bool scann_scheme(TURI& rURI, TByteArray& rArray, Int& rPos);
00096 static bool scann_hier_part(TURI& rURI, TByteArray& rArray, Int& rPos);
00097 static bool scann_opaque_part(TURI& rURI, TByteArray& rArray, Int& rPos);
00098
00099 static bool scann_net_path(TURI& rURI, TByteArray& rArray, Int& rPos);
00100 static bool scann_abs_path(TURI& rURI, TByteArray& rArray, Int& rPos);
00101 static bool scann_query(TURI& rURI, TByteArray& rArray, Int& rPos);
00102 static bool scann_authority(TURI& rURI, TByteArray& rArray, Int& rPos);
00103 static bool scann_server(TURI& rURI, TByteArray& rArray, Int& rPos);
00104 static bool scann_userinfo(TURI& rURI, TByteArray& rArray, Int& rPos);
00105 static bool scann_hostport(TURI& rURI, TByteArray& rArray, Int& rPos);
00106 static bool scann_hostname(TURI& rURI, TByteArray& rArray, Int& rPos);
00107 static bool scann_label(TURI& rURI, TByteArray& rArray, Int& rPos, bool bIsTopLevel);
00108 static bool scann_IPv4address(TURI& rURI, TByteArray& rArray, Int& rPos);
00109 static bool scann_reg_name(TURI& rURI, TByteArray& rArray, Int& rPos);
00110 static bool scann_path_segments(TURI& rURI, TByteArray& rArray, Int& rPos);
00111 static bool scann_segment(TURI& rURI, TByteArray& rArray, Int& rPos);
00112 static bool scann_param(TURI& rURI, TByteArray& rArray, Int& rPos);
00113
00114 static bool scann_uric(TURI& rURI, TByteArray& rArray, Int& rPos);
00115 static bool scann_uric_no_slash(TURI& rURI, TByteArray& rArray, Int& rPos);
00116 static bool scann_pchar(TURI& rURI, TByteArray& rArray, Int& rPos);
00117
00118 static bool scann_RelURI(TURI& rURI, TByteArray& rArray);
00119
00120
00121 };
00122
00123
00124
00125
00128
00129 inline TURI::TURI(const TURI& rURI)
00130 {
00131 assign(rURI);
00132 }
00133
00134
00137
00138 inline TURI::~TURI()
00139 {}
00140
00141
00144
00145 inline TString TURI::getAuthority() const
00146 {
00147 return m_strAuthority;
00148 }
00149
00150
00153
00154 inline TString TURI::getHostName() const
00155 {
00156 return m_strHostName;
00157 }
00158
00159
00162
00163 inline TString TURI::getProtocol() const
00164 {
00165 return m_strProtocol;
00166 }
00167
00168
00171
00172 inline TString TURI::getPath() const
00173 {
00174 return m_strPath;
00175 }
00176
00177
00180
00181 inline Uint TURI::getPort() const
00182 {
00183 return m_uiPort;
00184 }
00185
00186
00190
00191 inline bool TURI::isValid() const
00192 {
00193 return m_bValid;
00194 }
00195
00196
00199
00200 inline bool TURI::isEmpty() const
00201 {
00202 return m_strURI.isEmpty();
00203 }
00204
00205
00206
00209
00210 inline TString TURI::toString() const
00211 {
00212 return m_strURI;
00213 }
00214
00215
00216
00217
00220
00221 inline void TURI::setAuthority(const IString& rValue)
00222 {
00223 m_strAuthority = rValue;
00224 }
00225
00226
00229
00230 inline void TURI::setHostName(const IString& rValue)
00231 {
00232 m_strHostName = rValue;
00233 }
00234
00235
00238
00239 inline void TURI::setPath(const IString& rValue)
00240 {
00241 m_strPath = rValue;
00242 }
00243
00244
00247
00248 inline void TURI::setPort(Uint uiPort)
00249 {
00250 m_uiPort = uiPort;
00251 }
00252
00253
00256
00257 inline void TURI::setProtocol(const IString& rValue)
00258 {
00259 m_strProtocol = rValue;
00260 }
00261
00262
00265
00266 inline bool TURI::operator==(const TURI& rURI) const
00267 {
00268 return equals(rURI);
00269 }
00270
00271
00274
00275 inline bool TURI::operator!=(const TURI& rURI) const
00276 {
00277 return equals(rURI);
00278 }
00279
00280
00283
00284 inline TURI& TURI::operator=(const TURI& rURI)
00285 {
00286 assign(rURI);
00287 return *this;
00288 }
00289
00290
00291 END_NAMESPACE_Zeus
00292
00293 #endif