190 references to Offset
System.Private.Uri (190)
System\Uri.cs (179)
169Offset offset = info.Offset; 353char ch = _string[_info.Offset.Path]; 1007start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path; 1009string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) && 1010_info.Offset.Query == _info.Offset.End) 1013? _string.Substring(start + 1, _info.Offset.Query - start - 1) 1014: _string.Substring(start, _info.Offset.Query - start); 1033start = _info.Offset.Path; 1053ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1110return (int)_info.Offset.PortValue; 1632(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\ 1642result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 1780int i1 = _info.Offset.Host; 1781int end1 = _info.Offset.Path; 1783int i2 = other._info.Offset.Host; 1784int end2 = other._info.Offset.Path; 1807if (i1 < _info.Offset.Path && _string[i1] != ':') 2219info.Offset.End = str.Length; 2232info.Offset.Scheme++; 2295info.Offset.PortValue = (ushort)_syntax.DefaultPort; 2297info.Offset.User = idx; 2310info.Offset.Host = idx; 2364info.Offset.PortValue = (ushort)port; 2378info.Offset.Path = idx; 2421string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2473if ((_info.Offset.Host + i) >= _info.Offset.End || 2474host[i] != _string[_info.Offset.Host + i]) 2579if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2598_info.Offset.PortValue = 0; 2608if (port != _info.Offset.PortValue) 2616_info.Offset.PortValue = (ushort)port; 2651else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2686else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2762ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2871bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2899if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2901int offset = (_info.Offset.Query + 1); 2905FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true); 2909if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2911int offset = _info.Offset.Fragment + 1; 2915FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false); 2973return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 2976_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 2977_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host)); 2986return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 2988return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host), 2989":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 2993if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 2996return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3003_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3004_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host)); 3006if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3009return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3013return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3017if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3020return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3026return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3032int idx = _info.Offset.Path; 3039return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3040idx - _info.Offset.Host); 3046_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3047delimiterAwareIdx = _info.Offset.Path + 1; 3049delimiterAwareIdx = _info.Offset.Path; 3051if (delimiterAwareIdx >= _info.Offset.Query) 3055return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3060delimiterAwareIdx = _info.Offset.Query + 1; 3062delimiterAwareIdx = _info.Offset.Query; 3064if (delimiterAwareIdx >= _info.Offset.Fragment) 3067return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3072delimiterAwareIdx = _info.Offset.Fragment + 1; 3074delimiterAwareIdx = _info.Offset.Fragment; 3076if (delimiterAwareIdx >= _info.Offset.End) 3079return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3082return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 3083_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3089return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User), 3090":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3093return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3099_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3100_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host)); 3102if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3105return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3108return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3117delimiterAwareIdx = _info.Offset.Host - 1; 3119delimiterAwareIdx = _info.Offset.Host; 3121if (_info.Offset.User >= delimiterAwareIdx) 3124return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3174ReadOnlySpan<char> str = inputStr.AsSpan(_info.Offset.Scheme); 3206int userStart = _info.Offset.User; 3207Check result = CheckCanonical(inputStr.AsSpan(userStart, _info.Offset.Host - userStart), '@', out _); 3250_info.Offset.Query = queryStart; 3251_info.Offset.Fragment = inputStr.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3252_info.Offset.End = inputStr.Length; 3257int idx = _info.Offset.Path; 3281&& (_info.Offset.Path == length || inputStr[_info.Offset.Path] is not ('/' or '\\'))) 3358_info.Offset.Query = idx; 3385_info.Offset.Fragment = idx; 3412_info.Offset.End = idx; 3430ReadOnlySpan<char> original = _originalUnicodeString.AsSpan(_info.Offset.Path); 3449_info.Offset.Scheme = 0; 3450_info.Offset.User = vsb.Length; 3451_info.Offset.Host = vsb.Length; 3460_info.Offset.Path = vsb.Length; 4187if (_info.Offset.Path == _info.Offset.Query) 4201dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4220if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4223chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4228str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4233dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4254dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
System\UriExt.cs (11)
459int idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 3; 461if (idx < _info.Offset.User && str[idx] is '/' or '\\') 472if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 482if (IsDosPath && str[_info.Offset.Path + SecuredPathIndex - 1] == '|') 489int idx = _info.Offset.User; 490Check result = CheckCanonical(str.AsSpan(idx, _info.Offset.Path - idx), '/', out _); 818return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 933int portIndex = otherUri._info.Offset.Path; 937while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 945portIndex = otherUri._info.Offset.Path;