5 writes to _info
System.Private.Uri (5)
System\Uri.cs (3)
579_info = null!; 625_info = null!; 2426Interlocked.CompareExchange(ref _info, info, null!);
System\UriExt.cs (2)
1038_info = otherUri._info; 1046_info = null!;
224 references to _info
System.Private.Uri (224)
System\Uri.cs (209)
149Debug.Assert(InFact(Flags.MinimalUriInfoSet) == (_info is not null)); 151if (_info is UriInfo info) 261lock (_info) 339char ch = _string[_info.Offset.Path]; 366[MemberNotNull(nameof(_info))] 375Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 376return _info; 388[MemberNotNull(nameof(_info))] 1015Debug.Assert(_info != null); 1016Debug.Assert(_info.Host != null); 1022start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path; 1024string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) && 1025_info.Offset.Query == _info.Offset.End) 1028? _string.Substring(start + 1, _info.Offset.Query - start - 1) 1029: _string.Substring(start, _info.Offset.Query - start); 1047string host = _info.Host; 1048start = _info.Offset.Path; 1068ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1125return (int)_info.Offset.PortValue; 1209return _info.Host!; 1224if (_info?.IdnHost is null) 1228string host = _info.Host!; 1237host = _info._moreInfo?.ScopeId is string scopeId ? 1249_info.IdnHost = host; 1252return _info.IdnHost; 1591return _info.String ??= 1614if (_info.String is not null) 1616result = _info.String; 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] != ':') 1835if (!_info.Host!.Equals(other._info.Host)) 1850MoreInfo selfInfo = _info.MoreInfo; 1851MoreInfo otherInfo = other._info.MoreInfo; 2448lock (_info) 2464string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2512if (_info._moreInfo?.ScopeId is not null) 2521if ((_info.Offset.Host + i) >= _info.Offset.End || 2522host[i] != _string[_info.Offset.Host + i]) 2532_info.Host = host; 2604if (_info.Host != null) 2610if (_info.Host is null) 2634host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info); 2638if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2657_info.Offset.PortValue = 0; 2667if (port != _info.Offset.PortValue) 2675_info.Offset.PortValue = (ushort)port; 2679_info.Host = host; 2692Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2710else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2731Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2745else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2821ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2871string host = _info.Host!; 2914if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info._moreInfo?.ScopeId is string scopeId) 2930bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2958if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2960int offset = (_info.Offset.Query + 1); 2964FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true); 2968if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2970int offset = _info.Offset.Fragment + 1; 2974FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false); 3032return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3035_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3036_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host)); 3045return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 3047return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host), 3048":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3052if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3055return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3062_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3063_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host)); 3065if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3068return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3072return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3076if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3079return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3085return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3091int idx = _info.Offset.Path; 3098return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3099idx - _info.Offset.Host); 3105_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3106delimiterAwareIdx = _info.Offset.Path + 1; 3108delimiterAwareIdx = _info.Offset.Path; 3110if (delimiterAwareIdx >= _info.Offset.Query) 3114return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3119delimiterAwareIdx = _info.Offset.Query + 1; 3121delimiterAwareIdx = _info.Offset.Query; 3123if (delimiterAwareIdx >= _info.Offset.Fragment) 3126return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3131delimiterAwareIdx = _info.Offset.Fragment + 1; 3133delimiterAwareIdx = _info.Offset.Fragment; 3135if (delimiterAwareIdx >= _info.Offset.End) 3138return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3141return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 3142_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3148return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User), 3149":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3152return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3158_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3159_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host)); 3161if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3164return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3167return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3176delimiterAwareIdx = _info.Offset.Host - 1; 3178delimiterAwareIdx = _info.Offset.Host; 3180if (_info.Offset.User >= delimiterAwareIdx) 3183return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3222int idx = _info.Offset.Scheme; 3259idx = _info.Offset.User; 3260result = CheckCanonical(str, ref idx, _info.Offset.Host, '@'); 3294idx = _info.Offset.Path; 3295origIdx = _info.Offset.Path; 3313_info.Offset.Scheme = 0; 3314_info.Offset.User = _string.Length; 3315_info.Offset.Host = _string.Length; 3318_info.Offset.Path = _string.Length; 3319idx = _info.Offset.Path; 3346_info.Offset.Query = idx; 3347_info.Offset.Fragment = str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3348_info.Offset.End = str.Length; 3421&& (_info.Offset.Path == length || (str[_info.Offset.Path] != '/' && str[_info.Offset.Path] != '\\'))) 3529_info.Offset.Query = idx; 3577_info.Offset.Fragment = idx; 3604_info.Offset.End = idx; 3785Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 4307if (_info.Offset.Path == _info.Offset.Query) 4321dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4346if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4349chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4354str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4359dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4380dest.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); 504idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 2; 505if (idx >= _info.Offset.User || _string[idx - 1] == '\\' || _string[idx] == '\\') 510while (++idx < _info.Offset.User && (_string[idx] == '/' || _string[idx] == '\\')) 520if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 530if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 542idx = _info.Offset.User; 543Check result = CheckCanonical(str, ref idx, _info.Offset.Path, '/'); 938return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 954return _info.Host!; 1038_info = otherUri._info; 1052int portIndex = otherUri._info.Offset.Path; 1056while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 1064portIndex = otherUri._info.Offset.Path;