FastLED 3.9.15
Loading...
Searching...
No Matches

◆ port()

fl::u16 fl::url::port ( ) const
inline

Numeric port.

Returns the explicit port if present, otherwise the well-known default for the scheme (80 for http, 443 for https, etc.).

Definition at line 55 of file url.h.

55 {
56 fl::string_view p = port_str();
57 if (p.empty()) {
58 return defaultPort();
59 }
60 fl::u16 result = 0;
61 for (fl::size i = 0; i < p.size(); ++i) {
62 result = static_cast<fl::u16>(result * 10 +
63 static_cast<fl::u16>(p[i] - '0'));
64 }
65 return result;
66 }
constexpr bool empty() const FL_NOEXCEPT
constexpr fl::size size() const FL_NOEXCEPT
Definition string_view.h:99
fl::string_view port_str() const FL_NOEXCEPT
Definition url.h:47
fl::u16 defaultPort() const FL_NOEXCEPT
Definition url.h:110
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References defaultPort(), fl::string_view::empty(), FL_NOEXCEPT, port_str(), and fl::string_view::size().

+ Here is the call graph for this function: