61 for (fl::size i = 0; i < p.
size(); ++i) {
63 static_cast<fl::u16
>(p[i] -
'0'));
105 s.
off =
static_cast<fl::u16
>(off);
106 s.
len =
static_cast<fl::u16
>(len);
112 if (s ==
"https" || s ==
"wss")
114 if (s ==
"http" || s ==
"ws")
130 fl::size sep = src.
find(
"://");
136 sep = src.
find(
"://");
142 fl::size authStart =
pos;
143 fl::size authEnd = src.
size();
144 for (fl::size i =
pos; i < src.
size(); ++i) {
146 if (c ==
'/' || c ==
'?' || c ==
'#') {
160 fl::size pathStart =
pos;
161 fl::size pathEnd = src.
size();
162 for (fl::size i =
pos; i < src.
size(); ++i) {
163 if (src[i] ==
'?' || src[i] ==
'#') {
175 fl::size qStart =
pos;
176 fl::size qEnd = src.
size();
177 fl::size hashPos = src.
find(
'#',
pos);
198 fl::size at = auth.find(
'@');
205 if (
pos < auth.size() && auth[
pos] ==
'[') {
207 fl::size closeBracket = auth.find(
']',
pos);
215 pos = closeBracket + 1;
216 if (
pos < auth.size() && auth[
pos] ==
':') {
222 fl::size colon = auth.find(
':',
pos);
225 fl::size portStart = colon + 1;
226 mPort =
makeSpan(baseOff + portStart, auth.size() - portStart);
276 while (
pos < content.size()) {
277 fl::size eol = content.find(
'\n',
pos);
283 if (!line.
empty() && line[line.
size() - 1] ==
'\r') {
289 while (s < line.
size() &&
290 (line[s] ==
' ' || line[s] ==
'\t')) {
294 fl::size e = line.
size();
296 (line[e - 1] ==
' ' || line[e - 1] ==
'\t')) {
299 line = line.
substr(s, e - s);
304 if (line[0] ==
'#') {
327 bool gotPrimary =
false;
329 while (
pos < content.size()) {
330 fl::size eol = content.find(
'\n',
pos);
335 if (!line.
empty() && line[line.
size() - 1] ==
'\r') {
340 while (s < line.
size() &&
341 (line[s] ==
' ' || line[s] ==
'\t')) {
344 fl::size e = line.
size();
346 (line[e - 1] ==
' ' || line[e - 1] ==
'\t')) {
349 line = line.
substr(s, e - s);
351 if (line.
empty() || line[0] ==
'#') {
362 fl::size eq = line.
find(
'=');
369 if (key ==
"sha256") {
371 }
else if (key ==
"fallback") {
constexpr bool empty() const FL_NOEXCEPT
static constexpr fl::size npos
constexpr fl::size size() const FL_NOEXCEPT
fl::size find(char ch, fl::size pos=0) const FL_NOEXCEPT
string_view substr(fl::size pos=0, fl::size count=npos) const FL_NOEXCEPT
fl::string_view host() const FL_NOEXCEPT
fl::u16 port() const FL_NOEXCEPT
Numeric port.
fl::string_view port_str() const FL_NOEXCEPT
fl::string_view str() const FL_NOEXCEPT
url(const char *url) FL_NOEXCEPT
fl::string_view scheme() const FL_NOEXCEPT
fl::string_view userinfo() const FL_NOEXCEPT
const fl::string & string() const FL_NOEXCEPT
bool isValid() const FL_NOEXCEPT
bool wasRepaired() const FL_NOEXCEPT
True if the URL was missing a scheme and "https://" was assumed.
url(const fl::string &u) FL_NOEXCEPT
fl::string_view query() const FL_NOEXCEPT
fl::string_view path() const FL_NOEXCEPT
url(fl::string_view url) FL_NOEXCEPT
fl::string_view authority() const FL_NOEXCEPT
bool operator!=(const url &o) const FL_NOEXCEPT
fl::string_view fragment() const FL_NOEXCEPT
static Span makeSpan(fl::size off, fl::size len) FL_NOEXCEPT
fl::u16 defaultPort() const FL_NOEXCEPT
void parseAuthority(fl::string_view auth, fl::size baseOff) FL_NOEXCEPT
bool operator==(const url &o) const FL_NOEXCEPT
void zeroOffsets() FL_NOEXCEPT
fl::string_view view(const Span &s) const FL_NOEXCEPT
const char * c_str() const FL_NOEXCEPT
LnkMetadata parse_lnk_with_metadata(fl::string_view content) FL_NOEXCEPT
Parse a .lnk file into URL + metadata (forward-compat).
constexpr int type_rank< T >::value
expected< T, E > result
Alias for expected (Rust-style naming)
url parse_lnk(fl::string_view content) FL_NOEXCEPT
Parse the contents of a .lnk file into a fl::url.
Base definition for an LED controller.