activemq-cpp-3.8.2
URIType.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_URITYPE_H_
19 #define _DECAF_INTERNAL_NET_URITYPE_H_
20 
21 #include <string>
22 #include <decaf/util/Config.h>
23 
24 namespace decaf {
25 namespace internal {
26 namespace net {
27 
32  private:
33 
34  std::string source;
35  std::string scheme;
36  std::string schemeSpecificPart;
37  std::string authority;
38  std::string userinfo;
39  std::string host;
40  int port;
41  std::string path;
42  std::string query;
43  std::string fragment;
44  bool opaque;
45  bool absolute;
46  bool serverAuthority;
47  bool valid;
48 
49  public:
50 
51  URIType( const std::string& source ) : source( source ),
52  scheme(),
53  schemeSpecificPart(),
54  authority(),
55  userinfo(),
56  host(),
57  port( -1 ),
58  path(),
59  query(),
60  fragment(),
61  opaque( false ),
62  absolute( false ),
63  serverAuthority( false ),
64  valid( false ) {
65  }
66 
67  URIType() : source(),
68  scheme(),
69  schemeSpecificPart(),
70  authority(),
71  userinfo(),
72  host(),
73  port( -1 ),
74  path(),
75  query(),
76  fragment(),
77  opaque( false ),
78  absolute( false ),
79  serverAuthority( false ),
80  valid( false ) {
81  }
82 
83  virtual ~URIType() {}
84 
90  std::string getSource() const {
91  return this->source;
92  }
93 
99  void setSource( const std::string& source ) {
100  this->source = source;
101  }
102 
107  std::string getScheme() const {
108  return scheme;
109  }
110 
115  void setScheme( const std::string& scheme ) {
116  this->scheme = scheme;
117  }
118 
123  std::string getSchemeSpecificPart() const {
124  return schemeSpecificPart;
125  }
126 
131  void setSchemeSpecificPart( const std::string& schemeSpecificPart ) {
132  this->schemeSpecificPart = schemeSpecificPart;
133  }
134 
139  std::string getAuthority() const {
140  return authority;
141  }
142 
147  void setAuthority( const std::string& authority ) {
148  this->authority = authority;
149  }
150 
156  std::string getUserInfo() const {
157  return userinfo;
158  }
159 
165  void setUserInfo( const std::string& userinfo ) {
166  this->userinfo = userinfo;
167  }
168 
173  std::string getHost() const {
174  return host;
175  }
176 
181  void setHost( const std::string& host ) {
182  this->host = host;
183  }
184 
189  int getPort() const {
190  return port;
191  }
192 
197  void setPort( int port ) {
198  this->port = port;
199  }
200 
205  std::string getPath() const {
206  return path;
207  }
208 
213  void setPath( const std::string& path ) {
214  this->path = path;
215  }
216 
221  std::string getQuery() const {
222  return query;
223  }
224 
229  void setQuery( const std::string& query ) {
230  this->query = query;
231  }
232 
237  std::string getFragment() const {
238  return fragment;
239  }
240 
245  void setFragment( const std::string& fragment ) {
246  this->fragment = fragment;
247  }
248 
253  bool isOpaque() const {
254  return opaque;
255  }
256 
261  void setOpaque( bool opaque ) {
262  this->opaque = opaque;
263  }
264 
269  bool isAbsolute() const {
270  return absolute;
271  }
272 
277  void setAbsolute( bool absolute ) {
278  this->absolute = absolute;
279  }
280 
285  bool isServerAuthority() const {
286  return serverAuthority;
287  }
288 
293  void setServerAuthority( bool serverAuthority ) {
294  this->serverAuthority = serverAuthority;
295  }
296 
302  bool isValid() const {
303  return valid;
304  }
305 
311  void setValid( bool valid ) {
312  this->valid = valid;
313  }
314 
315  };
316 
317 }}}
318 
319 #endif /* _DECAF_INTERNAL_NET_URITYPE_H_ */
void setOpaque(bool opaque)
Sets if the URI is Opaque.
Definition: URIType.h:261
bool isOpaque() const
Gets if the URI is Opaque.
Definition: URIType.h:253
std::string getUserInfo() const
Gets the user info part of the URI, e.g.
Definition: URIType.h:156
void setPath(const std::string &path)
Sets the Path part of the URI.
Definition: URIType.h:213
std::string getScheme() const
Gets the Scheme of the URI, e.g.
Definition: URIType.h:107
void setHost(const std::string &host)
Sets the Host name part of the URI.
Definition: URIType.h:181
bool isServerAuthority() const
Gets if the URI is a Server Authority.
Definition: URIType.h:285
void setValid(bool valid)
Sets if the URI is valid, meaning that the source has been set and parsed and all relevant data field...
Definition: URIType.h:311
void setQuery(const std::string &query)
Sets the Query part of the URI.
Definition: URIType.h:229
URIType(const std::string &source)
Definition: URIType.h:51
void setSchemeSpecificPart(const std::string &schemeSpecificPart)
Sets the Scheme Specific Part of the URI.
Definition: URIType.h:131
void setAuthority(const std::string &authority)
Sets the Authority of the URI.
Definition: URIType.h:147
std::string getHost() const
Gets the Host name part of the URI.
Definition: URIType.h:173
bool isValid() const
Gets if the URI is valid, meaning that the source has been set and parsed and all relevant data field...
Definition: URIType.h:302
void setPort(int port)
Sets the port part of the URI.
Definition: URIType.h:197
bool isAbsolute() const
Gets if the URI is Absolute.
Definition: URIType.h:269
virtual ~URIType()
Definition: URIType.h:83
void setUserInfo(const std::string &userinfo)
Sets the user info part of the URI, e.g.
Definition: URIType.h:165
std::string getQuery() const
Gets the Query part of the URI.
Definition: URIType.h:221
URIType()
Definition: URIType.h:67
std::string getSchemeSpecificPart() const
Gets the Scheme Specific Part of the URI.
Definition: URIType.h:123
Basic type object that holds data that composes a given URI.
Definition: URIType.h:31
void setSource(const std::string &source)
Sets the source URI string that was parsed to obtain this URIType instance and the resulting data...
Definition: URIType.h:99
std::string getSource() const
Gets the source URI string that was parsed to obtain this URIType instance and the resulting data...
Definition: URIType.h:90
void setFragment(const std::string &fragment)
Sets the Fragment part of the URI.
Definition: URIType.h:245
#define DECAF_API
Definition: Config.h:29
std::string getFragment() const
Gets the Fragment part of the URI.
Definition: URIType.h:237
void setScheme(const std::string &scheme)
Sets the Scheme of the URI, e.g.
Definition: URIType.h:115
std::string getAuthority() const
Gets the Authority of the URI.
Definition: URIType.h:139
std::string getPath() const
Gets the Path part of the URI.
Definition: URIType.h:205
void setServerAuthority(bool serverAuthority)
Sets if the URI is a Server Authority.
Definition: URIType.h:293
int getPort() const
Gets the port part of the URI.
Definition: URIType.h:189
void setAbsolute(bool absolute)
Sets if the URI is Absolute.
Definition: URIType.h:277
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25