]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/anyp/UriScheme.h
1 #ifndef SQUID_ANYP_URISCHEME_H
2 #define SQUID_ANYP_URISCHEME_H
4 #include "anyp/ProtocolType.h"
11 /** This class represents a URI Scheme such as http:// https://, wais://, urn: etc.
12 * It does not represent the PROTOCOL that such schemes refer to.
17 UriScheme() : theScheme_(AnyP::PROTO_NONE
) {}
18 UriScheme(AnyP::ProtocolType
const aScheme
) : theScheme_(aScheme
) {}
21 operator AnyP::ProtocolType() const { return theScheme_
; }
23 bool operator != (AnyP::ProtocolType
const & aProtocol
) const { return theScheme_
!= aProtocol
; }
25 /** Get a char string representation of the scheme.
26 * Does not include the ':' or '://" terminators.
28 * An upper bound length of BUFSIZ bytes converted. Remainder will be truncated.
29 * The result of this call will remain usable only until any subsequest call
30 * and must be copied if persistence is needed.
32 char const *c_str() const;
35 /// This is a typecode pointer into the enum/registry of protocols handled.
36 AnyP::ProtocolType theScheme_
;
42 operator << (std::ostream
&os
, AnyP::UriScheme
const &scheme
)
48 #endif /* SQUID_ANYP_URISCHEME_H */