5 writes to _info
System.Private.Uri (5)
System\Uri.cs (3)
580_info = null!; 626_info = null!; 2378Interlocked.CompareExchange(ref _info, info, null!);
System\UriExt.cs (2)
899_info = otherUri._info; 907_info = null!;
221 references to _info
System.Private.Uri (221)
System\Uri.cs (207)
158Debug.Assert(InFact(Flags.MinimalUriInfoSet) == (_info is not null)); 160if (_info is UriInfo info) 270lock (_info) 348char ch = _string[_info.Offset.Path]; 375[MemberNotNull(nameof(_info))] 384Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 385return _info; 397[MemberNotNull(nameof(_info))] 995Debug.Assert(_info != null); 996Debug.Assert(_info.Host != null); 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); 1027string host = _info.Host; 1028start = _info.Offset.Path; 1048ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1105return (int)_info.Offset.PortValue; 1189return _info.Host!; 1204if (_info?.IdnHost is null) 1208string host = _info.Host!; 1217host = _info._moreInfo?.ScopeId is string scopeId ? 1229_info.IdnHost = host; 1232return _info.IdnHost; 1572return _info.String ??= 1595if (_info.String is not null) 1597result = _info.String; 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] != ':') 1816if (!_info.Host!.Equals(other._info.Host)) 1831MoreInfo selfInfo = _info.MoreInfo; 1832MoreInfo otherInfo = other._info.MoreInfo; 2400lock (_info) 2416string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2459if (_info._moreInfo?.ScopeId is not null) 2468if ((_info.Offset.Host + i) >= _info.Offset.End || 2469host[i] != _string[_info.Offset.Host + i]) 2479_info.Host = host; 2551if (_info.Host != null) 2557if (_info.Host is null) 2570host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info); 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; 2615_info.Host = host; 2628Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2646else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2667Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2681else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2757ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2807string host = _info.Host!; 2850if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info._moreInfo?.ScopeId is string scopeId) 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; 3675Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 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));
System\UriExt.cs (14)
41Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 445int idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 3; 447if (idx < _info.Offset.User && str[idx] is '/' or '\\') 458if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 468if (IsDosPath && str[_info.Offset.Path + SecuredPathIndex - 1] == '|') 475int idx = _info.Offset.User; 476Check result = CheckCanonical(str.AsSpan(idx, _info.Offset.Path - idx), '/', out _); 798return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 814return _info.Host!; 899_info = otherUri._info; 913int portIndex = otherUri._info.Offset.Path; 917while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 925portIndex = otherUri._info.Offset.Path;