5 writes to _info
System.Private.Uri (5)
System\Uri.cs (3)
584_info = null!; 630_info = null!; 2394Interlocked.CompareExchange(ref _info, info, null!);
System\UriExt.cs (2)
962_info = otherUri._info; 970_info = null!;
222 references to _info
System.Private.Uri (222)
System\Uri.cs (208)
154Debug.Assert(InFact(Flags.MinimalUriInfoSet) == (_info is not null)); 156if (_info is UriInfo info) 266lock (_info) 344char ch = _string[_info.Offset.Path]; 371[MemberNotNull(nameof(_info))] 380Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 381return _info; 393[MemberNotNull(nameof(_info))] 1011Debug.Assert(_info != null); 1012Debug.Assert(_info.Host != null); 1018start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path; 1020string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) && 1021_info.Offset.Query == _info.Offset.End) 1024? _string.Substring(start + 1, _info.Offset.Query - start - 1) 1025: _string.Substring(start, _info.Offset.Query - start); 1043string host = _info.Host; 1044start = _info.Offset.Path; 1064ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1121return (int)_info.Offset.PortValue; 1205return _info.Host!; 1220if (_info?.IdnHost is null) 1224string host = _info.Host!; 1233host = _info._moreInfo?.ScopeId is string scopeId ? 1245_info.IdnHost = host; 1248return _info.IdnHost; 1588return _info.String ??= 1611if (_info.String is not null) 1613result = _info.String; 1643(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\ 1653result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 1791int i1 = _info.Offset.Host; 1792int end1 = _info.Offset.Path; 1794int i2 = other._info.Offset.Host; 1795int end2 = other._info.Offset.Path; 1818if (i1 < _info.Offset.Path && _string[i1] != ':') 1832if (!_info.Host!.Equals(other._info.Host)) 1847MoreInfo selfInfo = _info.MoreInfo; 1848MoreInfo otherInfo = other._info.MoreInfo; 2416lock (_info) 2432string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2475if (_info._moreInfo?.ScopeId is not null) 2484if ((_info.Offset.Host + i) >= _info.Offset.End || 2485host[i] != _string[_info.Offset.Host + i]) 2495_info.Host = host; 2567if (_info.Host != null) 2573if (_info.Host is null) 2586host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info); 2590if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2609_info.Offset.PortValue = 0; 2619if (port != _info.Offset.PortValue) 2627_info.Offset.PortValue = (ushort)port; 2631_info.Host = host; 2644Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2662else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2683Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2697else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2773ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2823string host = _info.Host!; 2866if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info._moreInfo?.ScopeId is string scopeId) 2882bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2910if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2912int offset = (_info.Offset.Query + 1); 2916FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true); 2920if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2922int offset = _info.Offset.Fragment + 1; 2926FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false); 2984return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 2987_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 2988_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host)); 2997return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 2999return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host), 3000":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3004if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3007return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3014_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3015_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host)); 3017if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3020return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3024return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3028if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3031return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3037return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3043int idx = _info.Offset.Path; 3050return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3051idx - _info.Offset.Host); 3057_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3058delimiterAwareIdx = _info.Offset.Path + 1; 3060delimiterAwareIdx = _info.Offset.Path; 3062if (delimiterAwareIdx >= _info.Offset.Query) 3066return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3071delimiterAwareIdx = _info.Offset.Query + 1; 3073delimiterAwareIdx = _info.Offset.Query; 3075if (delimiterAwareIdx >= _info.Offset.Fragment) 3078return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3083delimiterAwareIdx = _info.Offset.Fragment + 1; 3085delimiterAwareIdx = _info.Offset.Fragment; 3087if (delimiterAwareIdx >= _info.Offset.End) 3090return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3093return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 3094_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3100return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User), 3101":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3104return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3110_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3111_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host)); 3113if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3116return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3119return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3128delimiterAwareIdx = _info.Offset.Host - 1; 3130delimiterAwareIdx = _info.Offset.Host; 3132if (_info.Offset.User >= delimiterAwareIdx) 3135return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3174int idx = _info.Offset.Scheme; 3218idx = _info.Offset.User; 3219result = CheckCanonical(_string.AsSpan(idx, _info.Offset.Host - idx), '@', out _); 3244idx = _info.Offset.Path; 3245origIdx = _info.Offset.Path; 3261_info.Offset.Scheme = 0; 3262_info.Offset.User = _string.Length; 3263_info.Offset.Host = _string.Length; 3270_info.Offset.Path = _string.Length; 3271idx = _info.Offset.Path; 3298_info.Offset.Query = idx; 3299_info.Offset.Fragment = str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3300_info.Offset.End = str.Length; 3370&& (_info.Offset.Path == length || _string[_info.Offset.Path] is not ('/' or '\\'))) 3478_info.Offset.Query = idx; 3525_info.Offset.Fragment = idx; 3551_info.Offset.End = idx; 3730Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 4241if (_info.Offset.Path == _info.Offset.Query) 4255dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4274if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4277chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4282str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4287dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4308dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
System\UriExt.cs (14)
31Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 449int idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 3; 451if (idx < _info.Offset.User && str[idx] is '/' or '\\') 462if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 472if (IsDosPath && str[_info.Offset.Path + SecuredPathIndex - 1] == '|') 479int idx = _info.Offset.User; 480Check result = CheckCanonical(str.AsSpan(idx, _info.Offset.Path - idx), '/', out _); 862return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 878return _info.Host!; 962_info = otherUri._info; 976int portIndex = otherUri._info.Offset.Path; 980while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 988portIndex = otherUri._info.Offset.Path;