17 #ifndef INCLUDED_BMQT_URI
18 #define INCLUDED_BMQT_URI
132 #include <ball_log.h>
133 #include <bsl_cstddef.h>
134 #include <bsl_iosfwd.h>
135 #include <bsl_string.h>
136 #include <bslh_hash.h>
137 #include <bslma_usesbslmaallocator.h>
138 #include <bslmf_nestedtraitdeclaration.h>
166 BALL_LOG_SET_CLASS_CATEGORY(
"BMQT.URI");
172 template <
class HASH_ALGORITHM>
173 friend void hashAppend(HASH_ALGORITHM& hashAlgo,
const Uri& uri);
182 bslstl::StringRef d_scheme;
185 bslstl::StringRef d_authority;
188 bslstl::StringRef d_domain;
191 bslstl::StringRef d_tier;
194 bslstl::StringRef d_path;
197 bslstl::StringRef d_query_id;
201 bool d_wasParserInitialized;
211 void copyImpl(
const Uri& src);
215 BSLMF_NESTED_TRAIT_DECLARATION(
Uri, bslma::UsesBslmaAllocator)
221 explicit
Uri(bslma::Allocator* allocator = 0);
227 bslma::Allocator* allocator = 0);
233 Uri(const bsl::
string& uri,
234 bslma::Allocator* allocator = 0);
235 Uri(const bslstl::StringRef& uri,
236 bslma::Allocator* allocator = 0);
238 bslma::Allocator* allocator = 0);
246 Uri& operator=(const
Uri& rhs);
251 const bsl::
string&
asString() const;
259 const bslstl::StringRef&
scheme() const;
260 const bslstl::StringRef&
authority() const;
264 const bslstl::StringRef&
path() const;
267 const bslstl::StringRef&
domain() const;
268 const bslstl::StringRef&
tier() const;
269 const bslstl::StringRef&
queue() const;
273 const bslstl::StringRef&
id() const;
289 print(bsl::ostream& stream,
int level = 0,
int spacesPerLevel = 4) const;
297 bool operator==(const
Uri& lhs, const
Uri& rhs);
302 bool operator!=(const
Uri& lhs, const
Uri& rhs);
306 bool operator<(const
Uri& lhs, const
Uri& rhs);
310 bsl::ostream& operator<<(bsl::ostream& stream, const
Uri& rhs);
350 bsl::string* errorDescription,
351 const bslstl::StringRef& uriString);
355 BALL_LOG_SET_CLASS_CATEGORY(
"BMQT.URI");
378 BSLMF_NESTED_TRAIT_DECLARATION(
UriBuilder, bslma::UsesBslmaAllocator)
390 UriBuilder& setDomain(const bslstl::StringRef& value);
391 UriBuilder& setTier(const bslstl::StringRef& value);
392 UriBuilder& setQualifiedDomain(const bslstl::StringRef& value);
393 UriBuilder& setQueue(const bslstl::StringRef& value);
399 UriBuilder& setId(const bslstl::StringRef& value);
409 int uri(
Uri* result, bsl::
string* errorDescription = 0) const;
436 return !d_uri.empty();
441 return d_query_id.isEmpty();
479 inline const bslstl::StringRef&
Uri::id()
const
486 size_t queryBeginPos = d_uri.find_first_of(
'?');
487 if (bsl::string::npos == queryBeginPos) {
491 return bslstl::StringRef(d_uri.c_str(), queryBeginPos);
495 template <
class HASH_ALGORITHM>
508 d_uri.d_domain = value;
514 d_uri.d_tier = value;
520 d_uri.d_path = value;
526 d_uri.d_query_id = value;
552 return rhs.
print(stream, 0, -1);
Definition: bmqt_uri.h:364
UriBuilder & setTier(const bslstl::StringRef &value)
Definition: bmqt_uri.h:512
UriBuilder & setId(const bslstl::StringRef &value)
Definition: bmqt_uri.h:524
UriBuilder & setDomain(const bslstl::StringRef &value)
Definition: bmqt_uri.h:506
UriBuilder & setQueue(const bslstl::StringRef &value)
Definition: bmqt_uri.h:518
Value semantic type representing a URI.
Definition: bmqt_uri.h:157
const bslstl::StringRef & domain() const
Definition: bmqt_uri.h:459
const bslstl::StringRef & queue() const
Definition: bmqt_uri.h:474
const bslstl::StringRef & path() const
Definition: bmqt_uri.h:454
const bslstl::StringRef & qualifiedDomain() const
Definition: bmqt_uri.h:464
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
const bslstl::StringRef & authority() const
Definition: bmqt_uri.h:449
bool isValid() const
Return true if this object represents a valid URI.
Definition: bmqt_uri.h:432
const bslstl::StringRef & tier() const
Definition: bmqt_uri.h:469
Uri & operator=(const Uri &rhs)
Set the value of this object to the specified rhs.
Definition: bmqt_uri.h:420
static const int k_QUEUENAME_MAX_LENGTH
The maximum authorized length for the queue name part of the URI.
Definition: bmqt_uri.h:162
friend class UriBuilder
Definition: bmqt_uri.h:171
bool isCanonical() const
Return true if this object represents a canonical URI.
Definition: bmqt_uri.h:439
const bsl::string & asString() const
Return the string representation of this URI.
Definition: bmqt_uri.h:427
const bslstl::StringRef & id() const
Definition: bmqt_uri.h:479
const bslstl::StringRef & scheme() const
Definition: bmqt_uri.h:444
bslstl::StringRef canonical() const
Definition: bmqt_uri.h:484
friend void hashAppend(HASH_ALGORITHM &hashAlgo, const Uri &uri)
Definition: bmqt_uri.h:496
void hashAppend(HASH_ALGORITHM &hashAlgo, const Uri &uri)
Definition: bmqt_uri.h:496
bsl::ostream & operator<<(bsl::ostream &stream, CompressionAlgorithmType::Enum value)
Definition: bmqt_compressionalgorithmtype.h:141
bool operator!=(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:582
bool operator==(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:576
bool operator<(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:588
Definition: bmqa_abstractsession.h:42
Utility namespace of methods for parsing URI strings into Uri objects.
Definition: bmqt_uri.h:317
static void initialize(bslma::Allocator *allocator=0)
static int parse(Uri *result, bsl::string *errorDescription, const bslstl::StringRef &uriString)