191 references to Offset
System.Private.Uri (191)
System\Uri.cs (180)
160Offset offset = info.Offset;
344char ch = _string[_info.Offset.Path];
1018start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path;
1020string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) &&
1021_info.Offset.Query == _info.Offset.End)
1024? _string.Substring(start + 1, _info.Offset.Query - start - 1)
1025: _string.Substring(start, _info.Offset.Query - start);
1044start = _info.Offset.Path;
1064ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start);
1121return (int)_info.Offset.PortValue;
1643(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\
1653result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
1791int i1 = _info.Offset.Host;
1792int end1 = _info.Offset.Path;
1794int i2 = other._info.Offset.Host;
1795int end2 = other._info.Offset.Path;
1818if (i1 < _info.Offset.Path && _string[i1] != ':')
2230info.Offset.End = str.Length;
2243info.Offset.Scheme++;
2306info.Offset.PortValue = (ushort)_syntax.DefaultPort;
2308info.Offset.User = idx;
2321info.Offset.Host = idx;
2375info.Offset.PortValue = (ushort)port;
2389info.Offset.Path = idx;
2432string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info);
2484if ((_info.Offset.Host + i) >= _info.Offset.End ||
2485host[i] != _string[_info.Offset.Host + i])
2590if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i])
2609_info.Offset.PortValue = 0;
2619if (port != _info.Offset.PortValue)
2627_info.Offset.PortValue = (ushort)port;
2662else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2697else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2773ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User);
2882bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten);
2910if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment)
2912int offset = (_info.Offset.Query + 1);
2916FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true);
2920if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End)
2922int offset = _info.Offset.Fragment + 1;
2926FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false);
2984return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
2987_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
2988_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host));
2997return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host);
2999return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host),
3000":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3004if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3007return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3014_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3015_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host));
3017if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3020return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3024return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3028if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3031return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3037return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme);
3043int idx = _info.Offset.Path;
3050return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host,
3051idx - _info.Offset.Host);
3057_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/')
3058delimiterAwareIdx = _info.Offset.Path + 1;
3060delimiterAwareIdx = _info.Offset.Path;
3062if (delimiterAwareIdx >= _info.Offset.Query)
3066return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx);
3071delimiterAwareIdx = _info.Offset.Query + 1;
3073delimiterAwareIdx = _info.Offset.Query;
3075if (delimiterAwareIdx >= _info.Offset.Fragment)
3078return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx);
3083delimiterAwareIdx = _info.Offset.Fragment + 1;
3085delimiterAwareIdx = _info.Offset.Fragment;
3087if (delimiterAwareIdx >= _info.Offset.End)
3090return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx);
3093return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty :
3094_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User);
3100return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User),
3101":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3104return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path);
3110_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3111_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host));
3113if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3116return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3119return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path);
3128delimiterAwareIdx = _info.Offset.Host - 1;
3130delimiterAwareIdx = _info.Offset.Host;
3132if (_info.Offset.User >= delimiterAwareIdx)
3135return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User);
3174int idx = _info.Offset.Scheme;
3218idx = _info.Offset.User;
3219result = CheckCanonical(_string.AsSpan(idx, _info.Offset.Host - idx), '@', out _);
3244idx = _info.Offset.Path;
3245origIdx = _info.Offset.Path;
3261_info.Offset.Scheme = 0;
3262_info.Offset.User = _string.Length;
3263_info.Offset.Host = _string.Length;
3270_info.Offset.Path = _string.Length;
3271idx = _info.Offset.Path;
3298_info.Offset.Query = idx;
3299_info.Offset.Fragment = str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode
3300_info.Offset.End = str.Length;
3370&& (_info.Offset.Path == length || _string[_info.Offset.Path] is not ('/' or '\\')))
3478_info.Offset.Query = idx;
3525_info.Offset.Fragment = idx;
3551_info.Offset.End = idx;
4241if (_info.Offset.Path == _info.Offset.Query)
4255dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4274if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|')
4277chars[dosPathIdx + _info.Offset.Path - 1] = ':';
4282str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path),
4287dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4308dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));