5 writes to _info
System.Private.Uri (5)
System\Uri.cs (3)
586_info = null!; 633_info = null!; 2397Interlocked.CompareExchange(ref _info, info, null!);
System\UriExt.cs (2)
953_info = otherUri._info; 961_info = null!;
221 references to _info
System.Private.Uri (221)
System\Uri.cs (207)
156Debug.Assert(InFact(Flags.MinimalUriInfoSet) == (_info is not null)); 158if (_info is UriInfo info) 268lock (_info) 346char ch = _string[_info.Offset.Path]; 373[MemberNotNull(nameof(_info))] 382Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 383return _info; 395[MemberNotNull(nameof(_info))] 1014Debug.Assert(_info != null); 1015Debug.Assert(_info.Host != null); 1021start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path; 1023string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) && 1024_info.Offset.Query == _info.Offset.End) 1027? _string.Substring(start + 1, _info.Offset.Query - start - 1) 1028: _string.Substring(start, _info.Offset.Query - start); 1046string host = _info.Host; 1047start = _info.Offset.Path; 1067ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1124return (int)_info.Offset.PortValue; 1208return _info.Host!; 1223if (_info?.IdnHost is null) 1227string host = _info.Host!; 1236host = _info._moreInfo?.ScopeId is string scopeId ? 1248_info.IdnHost = host; 1251return _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; 2419lock (_info) 2435string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2478if (_info._moreInfo?.ScopeId is not null) 2487if ((_info.Offset.Host + i) >= _info.Offset.End || 2488host[i] != _string[_info.Offset.Host + i]) 2498_info.Host = host; 2570if (_info.Host != null) 2576if (_info.Host is null) 2589host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info); 2593if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2612_info.Offset.PortValue = 0; 2622if (port != _info.Offset.PortValue) 2630_info.Offset.PortValue = (ushort)port; 2634_info.Host = host; 2647Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2665else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2686Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2700else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2776ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2826string host = _info.Host!; 2869if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info._moreInfo?.ScopeId is string scopeId) 2885bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2913if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2915int offset = (_info.Offset.Query + 1); 2919FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true); 2923if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2925int offset = _info.Offset.Fragment + 1; 2929FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false); 2987return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 2990_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 2991_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host)); 3000return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 3002return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host), 3003":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3007if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3010return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3017_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3018_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host)); 3020if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3023return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3027return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3031if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3034return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3040return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3046int idx = _info.Offset.Path; 3053return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3054idx - _info.Offset.Host); 3060_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3061delimiterAwareIdx = _info.Offset.Path + 1; 3063delimiterAwareIdx = _info.Offset.Path; 3065if (delimiterAwareIdx >= _info.Offset.Query) 3069return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3074delimiterAwareIdx = _info.Offset.Query + 1; 3076delimiterAwareIdx = _info.Offset.Query; 3078if (delimiterAwareIdx >= _info.Offset.Fragment) 3081return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3086delimiterAwareIdx = _info.Offset.Fragment + 1; 3088delimiterAwareIdx = _info.Offset.Fragment; 3090if (delimiterAwareIdx >= _info.Offset.End) 3093return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3096return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 3097_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3103return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User), 3104":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3107return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3113_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3114_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host)); 3116if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3119return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3122return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3131delimiterAwareIdx = _info.Offset.Host - 1; 3133delimiterAwareIdx = _info.Offset.Host; 3135if (_info.Offset.User >= delimiterAwareIdx) 3138return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3188ReadOnlySpan<char> str = inputStr.AsSpan(_info.Offset.Scheme); 3220int userStart = _info.Offset.User; 3221Check result = CheckCanonical(inputStr.AsSpan(userStart, _info.Offset.Host - userStart), '@', out _); 3264_info.Offset.Query = queryStart; 3265_info.Offset.Fragment = inputStr.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3266_info.Offset.End = inputStr.Length; 3271int idx = _info.Offset.Path; 3295&& (_info.Offset.Path == length || inputStr[_info.Offset.Path] is not ('/' or '\\'))) 3372_info.Offset.Query = idx; 3399_info.Offset.Fragment = idx; 3426_info.Offset.End = idx; 3444ReadOnlySpan<char> original = _originalUnicodeString.AsSpan(_info.Offset.Path); 3463_info.Offset.Scheme = 0; 3464_info.Offset.User = vsb.Length; 3465_info.Offset.Host = vsb.Length; 3474_info.Offset.Path = vsb.Length; 3695Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 4209if (_info.Offset.Path == _info.Offset.Query) 4223dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4242if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4245chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4250str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4255dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4276dest.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); 451int idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 3; 453if (idx < _info.Offset.User && str[idx] is '/' or '\\') 464if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 474if (IsDosPath && str[_info.Offset.Path + SecuredPathIndex - 1] == '|') 481int idx = _info.Offset.User; 482Check result = CheckCanonical(str.AsSpan(idx, _info.Offset.Path - idx), '/', out _); 853return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 869return _info.Host!; 953_info = otherUri._info; 967int portIndex = otherUri._info.Offset.Path; 971while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 979portIndex = otherUri._info.Offset.Path;