activemq-cpp-3.8.2
URIHelper.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_INTERNAL_NET_URIHELPER_H_
19 #define _DECAF_INTERNAL_NET_URIHELPER_H_
20 
21 #include <string>
22 #include <decaf/util/Config.h>
25 
26 namespace decaf {
27 namespace internal {
28 namespace net {
29 
34  private:
35 
36  const std::string unreserved;
37  const std::string punct;
38  const std::string reserved;
39  const std::string someLegal;
40  const std::string allLegal;
41 
42  public:
43 
55  URIHelper( const std::string& unreserved,
56  const std::string& punct,
57  const std::string& reserved,
58  const std::string& someLegal,
59  const std::string& allLegal );
60 
64  URIHelper();
65 
66  virtual ~URIHelper() {}
67 
75  URIType parseURI( const std::string& uri, bool forceServer );
76 
84  void validateScheme( const std::string& uri, const std::string& scheme, int index );
85 
93  void validateSsp( const std::string& uri, const std::string& ssp,
94  std::size_t index );
95 
103  void validateAuthority( const std::string& uri, const std::string& authority,
104  std::size_t index );
105 
113  void validatePath( const std::string& uri, const std::string& path,
114  std::size_t index );
115 
123  void validateQuery( const std::string& uri, const std::string& query,
124  std::size_t index );
125 
133  void validateFragment( const std::string& uri, const std::string& fragment,
134  std::size_t index );
135 
153  URIType parseAuthority( bool forceServer, const std::string& authority );
154 
163  void validateUserinfo( const std::string& uri, const std::string& userinfo, std::size_t index );
164 
173  bool isValidHost( bool forceServer, const std::string& host );
174 
181  bool isValidDomainName( const std::string& host );
182 
190  bool isValidIPv4Address( const std::string& host );
191 
197  bool isValidIP6Address( const std::string& ipAddress );
198 
205  bool isValidIP4Word( const std::string& word );
206 
213  bool isValidHexChar( char c );
214 
215  };
216 
217 }}}
218 
219 #endif /* _DECAF_INTERNAL_NET_URIHELPER_H_ */
virtual ~URIHelper()
Definition: URIHelper.h:66
Basic type object that holds data that composes a given URI.
Definition: URIType.h:31
#define DECAF_API
Definition: Config.h:29
Helper class used by the URI classes in encoding and decoding of URI&#39;s.
Definition: URIHelper.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25