190 references to Offset
System.Private.Uri (190)
System\Uri.cs (179)
164Offset offset = info.Offset;
348char ch = _string[_info.Offset.Path];
1002start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path;
1004string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) &&
1005_info.Offset.Query == _info.Offset.End)
1008? _string.Substring(start + 1, _info.Offset.Query - start - 1)
1009: _string.Substring(start, _info.Offset.Query - start);
1028start = _info.Offset.Path;
1048ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start);
1105return (int)_info.Offset.PortValue;
1627(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\
1637result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
1775int i1 = _info.Offset.Host;
1776int end1 = _info.Offset.Path;
1778int i2 = other._info.Offset.Host;
1779int end2 = other._info.Offset.Path;
1802if (i1 < _info.Offset.Path && _string[i1] != ':')
2214info.Offset.End = str.Length;
2227info.Offset.Scheme++;
2290info.Offset.PortValue = (ushort)_syntax.DefaultPort;
2292info.Offset.User = idx;
2305info.Offset.Host = idx;
2359info.Offset.PortValue = (ushort)port;
2373info.Offset.Path = idx;
2416string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info);
2468if ((_info.Offset.Host + i) >= _info.Offset.End ||
2469host[i] != _string[_info.Offset.Host + i])
2574if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i])
2593_info.Offset.PortValue = 0;
2603if (port != _info.Offset.PortValue)
2611_info.Offset.PortValue = (ushort)port;
2646else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2681else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2757ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User);
2866bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten);
2894if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment)
2896int offset = (_info.Offset.Query + 1);
2900FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true);
2904if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End)
2906int offset = _info.Offset.Fragment + 1;
2910FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false);
2968return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
2971_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
2972_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host));
2981return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host);
2983return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host),
2984":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
2988if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
2991return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
2998_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
2999_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host));
3001if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3004return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3008return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3012if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3015return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3021return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme);
3027int idx = _info.Offset.Path;
3034return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host,
3035idx - _info.Offset.Host);
3041_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/')
3042delimiterAwareIdx = _info.Offset.Path + 1;
3044delimiterAwareIdx = _info.Offset.Path;
3046if (delimiterAwareIdx >= _info.Offset.Query)
3050return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx);
3055delimiterAwareIdx = _info.Offset.Query + 1;
3057delimiterAwareIdx = _info.Offset.Query;
3059if (delimiterAwareIdx >= _info.Offset.Fragment)
3062return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx);
3067delimiterAwareIdx = _info.Offset.Fragment + 1;
3069delimiterAwareIdx = _info.Offset.Fragment;
3071if (delimiterAwareIdx >= _info.Offset.End)
3074return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx);
3077return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty :
3078_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User);
3084return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User),
3085":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3088return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path);
3094_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3095_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host));
3097if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3100return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3103return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path);
3112delimiterAwareIdx = _info.Offset.Host - 1;
3114delimiterAwareIdx = _info.Offset.Host;
3116if (_info.Offset.User >= delimiterAwareIdx)
3119return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User);
3169ReadOnlySpan<char> str = inputStr.AsSpan(_info.Offset.Scheme);
3201int userStart = _info.Offset.User;
3202Check result = CheckCanonical(inputStr.AsSpan(userStart, _info.Offset.Host - userStart), '@', out _);
3245_info.Offset.Query = queryStart;
3246_info.Offset.Fragment = inputStr.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode
3247_info.Offset.End = inputStr.Length;
3252int idx = _info.Offset.Path;
3276&& (_info.Offset.Path == length || inputStr[_info.Offset.Path] is not ('/' or '\\')))
3353_info.Offset.Query = idx;
3380_info.Offset.Fragment = idx;
3407_info.Offset.End = idx;
3425ReadOnlySpan<char> original = _originalUnicodeString.AsSpan(_info.Offset.Path);
3444_info.Offset.Scheme = 0;
3445_info.Offset.User = vsb.Length;
3446_info.Offset.Host = vsb.Length;
3455_info.Offset.Path = vsb.Length;
4175if (_info.Offset.Path == _info.Offset.Query)
4189dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4208if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|')
4211chars[dosPathIdx + _info.Offset.Path - 1] = ':';
4216str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path),
4221dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4242dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));