]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/anyp/UriScheme.h
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_ANYP_URISCHEME_H
10 #define SQUID_ANYP_URISCHEME_H
12 #include "anyp/ProtocolType.h"
19 /** This class represents a URI Scheme such as http:// https://, wais://, urn: etc.
20 * It does not represent the PROTOCOL that such schemes refer to.
25 UriScheme() : theScheme_(AnyP::PROTO_NONE
) {}
26 UriScheme(AnyP::ProtocolType
const aScheme
) : theScheme_(aScheme
) {}
29 operator AnyP::ProtocolType() const { return theScheme_
; }
31 bool operator != (AnyP::ProtocolType
const & aProtocol
) const { return theScheme_
!= aProtocol
; }
33 /** Get a char string representation of the scheme.
34 * Does not include the ':' or '://" terminators.
36 * An upper bound length of BUFSIZ bytes converted. Remainder will be truncated.
37 * The result of this call will remain usable only until any subsequest call
38 * and must be copied if persistence is needed.
40 char const *c_str() const;
42 unsigned short defaultPort() const;
45 /// This is a typecode pointer into the enum/registry of protocols handled.
46 AnyP::ProtocolType theScheme_
;
52 operator << (std::ostream
&os
, AnyP::UriScheme
const &scheme
)
58 #endif /* SQUID_ANYP_URISCHEME_H */