190 references to Offset
System.Private.Uri (190)
System\Uri.cs (179)
162Offset offset = info.Offset;
346char ch = _string[_info.Offset.Path];
1021start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path;
1023string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) &&
1024_info.Offset.Query == _info.Offset.End)
1027? _string.Substring(start + 1, _info.Offset.Query - start - 1)
1028: _string.Substring(start, _info.Offset.Query - start);
1047start = _info.Offset.Path;
1067ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start);
1124return (int)_info.Offset.PortValue;
1646(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\
1656result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
1794int i1 = _info.Offset.Host;
1795int end1 = _info.Offset.Path;
1797int i2 = other._info.Offset.Host;
1798int end2 = other._info.Offset.Path;
1821if (i1 < _info.Offset.Path && _string[i1] != ':')
2233info.Offset.End = str.Length;
2246info.Offset.Scheme++;
2309info.Offset.PortValue = (ushort)_syntax.DefaultPort;
2311info.Offset.User = idx;
2324info.Offset.Host = idx;
2378info.Offset.PortValue = (ushort)port;
2392info.Offset.Path = idx;
2435string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info);
2487if ((_info.Offset.Host + i) >= _info.Offset.End ||
2488host[i] != _string[_info.Offset.Host + i])
2593if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i])
2612_info.Offset.PortValue = 0;
2622if (port != _info.Offset.PortValue)
2630_info.Offset.PortValue = (ushort)port;
2665else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2700else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2776ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User);
2885bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten);
2913if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment)
2915int offset = (_info.Offset.Query + 1);
2919FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true);
2923if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End)
2925int offset = _info.Offset.Fragment + 1;
2929FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false);
2987return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
2990_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
2991_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host));
3000return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host);
3002return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host),
3003":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3007if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3010return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3017_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3018_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host));
3020if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3023return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3027return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3031if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3034return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3040return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme);
3046int idx = _info.Offset.Path;
3053return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host,
3054idx - _info.Offset.Host);
3060_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/')
3061delimiterAwareIdx = _info.Offset.Path + 1;
3063delimiterAwareIdx = _info.Offset.Path;
3065if (delimiterAwareIdx >= _info.Offset.Query)
3069return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx);
3074delimiterAwareIdx = _info.Offset.Query + 1;
3076delimiterAwareIdx = _info.Offset.Query;
3078if (delimiterAwareIdx >= _info.Offset.Fragment)
3081return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx);
3086delimiterAwareIdx = _info.Offset.Fragment + 1;
3088delimiterAwareIdx = _info.Offset.Fragment;
3090if (delimiterAwareIdx >= _info.Offset.End)
3093return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx);
3096return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty :
3097_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User);
3103return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User),
3104":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3107return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path);
3113_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3114_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host));
3116if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3119return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3122return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path);
3131delimiterAwareIdx = _info.Offset.Host - 1;
3133delimiterAwareIdx = _info.Offset.Host;
3135if (_info.Offset.User >= delimiterAwareIdx)
3138return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User);
3188ReadOnlySpan<char> str = inputStr.AsSpan(_info.Offset.Scheme);
3220int userStart = _info.Offset.User;
3221Check result = CheckCanonical(inputStr.AsSpan(userStart, _info.Offset.Host - userStart), '@', out _);
3264_info.Offset.Query = queryStart;
3265_info.Offset.Fragment = inputStr.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode
3266_info.Offset.End = inputStr.Length;
3271int idx = _info.Offset.Path;
3295&& (_info.Offset.Path == length || inputStr[_info.Offset.Path] is not ('/' or '\\')))
3372_info.Offset.Query = idx;
3399_info.Offset.Fragment = idx;
3426_info.Offset.End = idx;
3444ReadOnlySpan<char> original = _originalUnicodeString.AsSpan(_info.Offset.Path);
3463_info.Offset.Scheme = 0;
3464_info.Offset.User = vsb.Length;
3465_info.Offset.Host = vsb.Length;
3474_info.Offset.Path = vsb.Length;
4209if (_info.Offset.Path == _info.Offset.Query)
4223dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4242if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|')
4245chars[dosPathIdx + _info.Offset.Path - 1] = ':';
4250str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path),
4255dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4276dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));