5 writes to _info
System.Private.Uri (5)
System\Uri.cs (3)
530_info = null!; 576_info = null!; 2400Interlocked.CompareExchange(ref _info, info, null!);
System\UriExt.cs (2)
1061_info = otherUri._info; 1069_info = null!;
226 references to _info
System.Private.Uri (226)
System\Uri.cs (211)
214lock (_info) 292char ch = _string[_info.Offset.Path]; 319[MemberNotNull(nameof(_info))] 327Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 328return _info; 339[MemberNotNull(nameof(_info))] 965Debug.Assert(_info != null); 966Debug.Assert(_info.Host != null); 972start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path; 974string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) && 975_info.Offset.Query == _info.Offset.End) 978? _string.Substring(start + 1, _info.Offset.Query - start - 1) 979: _string.Substring(start, _info.Offset.Query - start); 997start = _info.Offset.Path; 999string host = _info.Host; 1000result = new char[host.Length + 3 + _info.Offset.Fragment - _info.Offset.Path]; 1026UriHelper.UnescapeString(_string, start, _info.Offset.Query, result, ref count, c_DummyChar, 1075return (int)_info.Offset.PortValue; 1159return _info.Host!; 1174if (_info?.IdnHost is null) 1178string host = _info.Host!; 1187host = _info._moreInfo?.ScopeId is string scopeId ? 1207_info.IdnHost = host; 1210return _info.IdnHost; 1561return _info.String ??= 1584if (_info.String is not null) 1586result = _info.String; 1616(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\ 1626result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 1764int i1 = _info.Offset.Host; 1765int end1 = _info.Offset.Path; 1767int i2 = other._info.Offset.Host; 1768int end2 = other._info.Offset.Path; 1791if (i1 < _info.Offset.Path && _string[i1] != ':') 1805if (!_info.Host!.Equals(other._info.Host)) 1820MoreInfo selfInfo = _info.MoreInfo; 1821MoreInfo otherInfo = other._info.MoreInfo; 2422lock (_info) 2438string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2486if (_info._moreInfo?.ScopeId is not null) 2495if ((_info.Offset.Host + i) >= _info.Offset.End || 2496host[i] != _string[_info.Offset.Host + i]) 2506_info.Host = host; 2578if (_info.Host != null) 2584if (_info.Host is null) 2611host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info); 2615if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2634_info.Offset.PortValue = 0; 2644if (port != _info.Offset.PortValue) 2652_info.Offset.PortValue = (ushort)port; 2656_info.Host = host; 2669Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2687else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2708Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2722else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2796ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2849string host = _info.Host!; 2889if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info._moreInfo?.ScopeId is string scopeId) 2905bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2933if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2935int offset = (_info.Offset.Query + 1); 2948str.AsSpan(offset, _info.Offset.Fragment - offset), 2965UriHelper.UnescapeString(str, offset, _info.Offset.Fragment, 2972if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2974int offset = _info.Offset.Fragment + 1; 2987str.AsSpan(offset, _info.Offset.End - offset), 3004UriHelper.UnescapeString(str, offset, _info.Offset.End, 3026return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3029_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3030_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host)); 3039return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 3041return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host), 3042":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3046if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3049return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3056_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3057_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host)); 3059if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3062return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3066return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3070if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3073return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3079return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3085int idx = _info.Offset.Path; 3092return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3093idx - _info.Offset.Host); 3099_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3100delimiterAwareIdx = _info.Offset.Path + 1; 3102delimiterAwareIdx = _info.Offset.Path; 3104if (delimiterAwareIdx >= _info.Offset.Query) 3108return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3113delimiterAwareIdx = _info.Offset.Query + 1; 3115delimiterAwareIdx = _info.Offset.Query; 3117if (delimiterAwareIdx >= _info.Offset.Fragment) 3120return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3125delimiterAwareIdx = _info.Offset.Fragment + 1; 3127delimiterAwareIdx = _info.Offset.Fragment; 3129if (delimiterAwareIdx >= _info.Offset.End) 3132return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3135return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 3136_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3142return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User), 3143":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3146return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3152_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3153_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host)); 3155if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3158return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3161return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3170delimiterAwareIdx = _info.Offset.Host - 1; 3172delimiterAwareIdx = _info.Offset.Host; 3174if (_info.Offset.User >= delimiterAwareIdx) 3177return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3216int idx = _info.Offset.Scheme; 3253idx = _info.Offset.User; 3254result = CheckCanonical(str, ref idx, _info.Offset.Host, '@'); 3288idx = _info.Offset.Path; 3289origIdx = _info.Offset.Path; 3307_info.Offset.Scheme = 0; 3308_info.Offset.User = (ushort)_string.Length; 3309_info.Offset.Host = (ushort)_string.Length; 3312_info.Offset.Path = (ushort)_string.Length; 3313idx = _info.Offset.Path; 3340_info.Offset.Query = (ushort)idx; 3341_info.Offset.Fragment = (ushort)str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3342_info.Offset.End = (ushort)str.Length; 3421&& (_info.Offset.Path == length || (str[_info.Offset.Path] != '/' && str[_info.Offset.Path] != '\\'))) 3535_info.Offset.Query = (ushort)idx; 3589_info.Offset.Fragment = (ushort)idx; 3616_info.Offset.End = (ushort)idx; 3797Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 4312if (_info.Offset.Path == _info.Offset.Query) 4326dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4351if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4354chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4359str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4364dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4385dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
System\UriExt.cs (15)
31Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 509idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 2; 510if (idx >= _info.Offset.User || _string[idx - 1] == '\\' || _string[idx] == '\\') 515while (++idx < _info.Offset.User && (_string[idx] == '/' || _string[idx] == '\\')) 525if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 535if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 547idx = _info.Offset.User; 548Check result = CheckCanonical(str, ref idx, _info.Offset.Path, '/'); 951return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 967return _info.Host!; 1061_info = otherUri._info; 1075int portIndex = otherUri._info.Offset.Path; 1079while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 1087portIndex = otherUri._info.Offset.Path;