Lines Matching defs:scheme
1327 /* begin file include/ada/scheme.h */
1329 * @file scheme.h
1330 * @brief Declarations for the URL scheme.
1341 * @namespace ada::scheme
1342 * @brief Includes the scheme declarations
1344 namespace ada::scheme {
1347 * Type of the scheme as an enum.
1348 * Using strings to represent a scheme type is not ideal because
1367 * A special scheme is an ASCII string that is listed in the first column of the
1368 * following table. The default port for a special scheme is listed in the
1373 * @param scheme
1374 * @return If scheme is a special scheme
1376 ada_really_inline constexpr bool is_special(std::string_view scheme);
1379 * A special scheme is an ASCII string that is listed in the first column of the
1380 * following table. The default port for a special scheme is listed in the
1385 * @param scheme
1388 constexpr uint16_t get_special_port(std::string_view scheme) noexcept;
1391 * Returns the port number of a special scheme.
1392 * @see https://url.spec.whatwg.org/#special-scheme
1394 constexpr uint16_t get_special_port(ada::scheme::type type) noexcept;
1396 * Returns the scheme of an input, or NOT_SPECIAL if it's not a special scheme
1399 constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept;
1401 } // namespace ada::scheme
1404 /* end file include/ada/scheme.h */
1459 ada::scheme::type type{ada::scheme::type::NOT_SPECIAL};
1462 * A URL is special if its scheme is a special scheme. A URL is not special if
1463 * its scheme is not a special scheme.
1493 * Get the default port if the url's scheme has one, returns 0 otherwise.
1578 ada::scheme::type type) noexcept;
1587 ada::scheme::type type) noexcept;
1601 ada::scheme::type type,
4314 /* begin file include/ada/scheme-inl.h */
4316 * @file scheme-inl.h
4317 * @brief Definitions for the URL scheme.
4323 namespace ada::scheme {
4326 * @namespace ada::scheme::details
4327 * @brief Includes the definitions for scheme specific entities
4338 ada_really_inline constexpr bool is_special(std::string_view scheme) {
4339 if (scheme.empty()) {
4342 int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
4344 return (target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1));
4346 constexpr uint16_t get_special_port(std::string_view scheme) noexcept {
4347 if (scheme.empty()) {
4350 int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
4352 if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) {
4358 constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
4361 constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept {
4362 if (scheme.empty()) {
4363 return ada::scheme::NOT_SPECIAL;
4365 int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
4367 if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) {
4368 return ada::scheme::type(hash_value);
4370 return ada::scheme::NOT_SPECIAL;
4374 } // namespace ada::scheme
4377 /* end file include/ada/scheme-inl.h */
4765 * The protocol getter steps are to return this's URL's scheme, followed by
4894 * string, or its scheme is "file".
4933 * Fast function to set the scheme from a view with a colon in the
5171 * The protocol getter steps are to return this's URL's scheme, followed by
5385 * A URL's scheme is an ASCII string that identifies the type of URL and can
5387 * initially the empty string. We only set non_special_scheme when the scheme
5390 * Special schemes are stored in ada::scheme::details::is_special_list so we
5397 * string, or its scheme is "file".
5409 * Take the scheme from another URL. The scheme string is copied from the
5444 * Set the scheme for this URL. The provided scheme should be a valid
5445 * scheme string, be lower-cased, not contain spaces or tabs. It should
5451 * Take the scheme from another URL. The scheme string is moved from the
5473 return type != ada::scheme::NOT_SPECIAL;
5477 return ada::scheme::get_special_port(type);
5482 return scheme::get_special_port(type);
5513 type == ada::scheme::type::FILE;
5649 inline void url::set_protocol_as_file() { type = ada::scheme::type::FILE; }
5652 type = ada::scheme::get_scheme_type(new_scheme);
5653 // We only move the 'scheme' if it is non-special.
6478 return type == ada::scheme::type::FILE ||
6563 // string, or its scheme is "file".
6642 type = ada::scheme::type::FILE;