5 writes to _info
System.Private.Uri (5)
System\Uri.cs (3)
585_info = null!; 631_info = null!; 2383Interlocked.CompareExchange(ref _info, info, null!);
System\UriExt.cs (2)
919_info = otherUri._info; 927_info = null!;
221 references to _info
System.Private.Uri (221)
System\Uri.cs (207)
163Debug.Assert(InFact(Flags.MinimalUriInfoSet) == (_info is not null)); 165if (_info is UriInfo info) 275lock (_info) 353char ch = _string[_info.Offset.Path]; 380[MemberNotNull(nameof(_info))] 389Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 390return _info; 402[MemberNotNull(nameof(_info))] 1000Debug.Assert(_info != null); 1001Debug.Assert(_info.Host != null); 1007start = IsUncPath ? _info.Offset.Host - 2 : _info.Offset.Path; 1009string str = (IsImplicitFile && _info.Offset.Host == (IsDosPath ? 0 : 2) && 1010_info.Offset.Query == _info.Offset.End) 1013? _string.Substring(start + 1, _info.Offset.Query - start - 1) 1014: _string.Substring(start, _info.Offset.Query - start); 1032string host = _info.Host; 1033start = _info.Offset.Path; 1053ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1110return (int)_info.Offset.PortValue; 1194return _info.Host!; 1209if (_info?.IdnHost is null) 1213string host = _info.Host!; 1222host = _info._moreInfo?.ScopeId is string scopeId ? 1234_info.IdnHost = host; 1237return _info.IdnHost; 1577return _info.String ??= 1600if (_info.String is not null) 1602result = _info.String; 1632(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\ 1642result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 1780int i1 = _info.Offset.Host; 1781int end1 = _info.Offset.Path; 1783int i2 = other._info.Offset.Host; 1784int end2 = other._info.Offset.Path; 1807if (i1 < _info.Offset.Path && _string[i1] != ':') 1821if (!_info.Host!.Equals(other._info.Host)) 1836MoreInfo selfInfo = _info.MoreInfo; 1837MoreInfo otherInfo = other._info.MoreInfo; 2405lock (_info) 2421string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2464if (_info._moreInfo?.ScopeId is not null) 2473if ((_info.Offset.Host + i) >= _info.Offset.End || 2474host[i] != _string[_info.Offset.Host + i]) 2484_info.Host = host; 2556if (_info.Host != null) 2562if (_info.Host is null) 2575host = CreateHostStringHelper(host, 0, host.Length, ref flags, _info); 2579if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2598_info.Offset.PortValue = 0; 2608if (port != _info.Offset.PortValue) 2616_info.Offset.PortValue = (ushort)port; 2620_info.Host = host; 2633Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2651else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2672Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2686else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2762ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2812string host = _info.Host!; 2855if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info._moreInfo?.ScopeId is string scopeId) 2871bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2899if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2901int offset = (_info.Offset.Query + 1); 2905FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true); 2909if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2911int offset = _info.Offset.Fragment + 1; 2915FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false); 2973return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 2976_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 2977_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host)); 2986return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 2988return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host), 2989":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 2993if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 2996return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3003_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3004_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host)); 3006if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3009return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3013return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3017if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length) 3020return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3026return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3032int idx = _info.Offset.Path; 3039return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3040idx - _info.Offset.Host); 3046_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3047delimiterAwareIdx = _info.Offset.Path + 1; 3049delimiterAwareIdx = _info.Offset.Path; 3051if (delimiterAwareIdx >= _info.Offset.Query) 3055return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3060delimiterAwareIdx = _info.Offset.Query + 1; 3062delimiterAwareIdx = _info.Offset.Query; 3064if (delimiterAwareIdx >= _info.Offset.Fragment) 3067return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3072delimiterAwareIdx = _info.Offset.Fragment + 1; 3074delimiterAwareIdx = _info.Offset.Fragment; 3076if (delimiterAwareIdx >= _info.Offset.End) 3079return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3082return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 3083_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3089return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User), 3090":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3093return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3099_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme), 3100_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host)); 3102if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 3105return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3108return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3117delimiterAwareIdx = _info.Offset.Host - 1; 3119delimiterAwareIdx = _info.Offset.Host; 3121if (_info.Offset.User >= delimiterAwareIdx) 3124return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3174ReadOnlySpan<char> str = inputStr.AsSpan(_info.Offset.Scheme); 3206int userStart = _info.Offset.User; 3207Check result = CheckCanonical(inputStr.AsSpan(userStart, _info.Offset.Host - userStart), '@', out _); 3250_info.Offset.Query = queryStart; 3251_info.Offset.Fragment = inputStr.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3252_info.Offset.End = inputStr.Length; 3257int idx = _info.Offset.Path; 3281&& (_info.Offset.Path == length || inputStr[_info.Offset.Path] is not ('/' or '\\'))) 3358_info.Offset.Query = idx; 3385_info.Offset.Fragment = idx; 3412_info.Offset.End = idx; 3430ReadOnlySpan<char> original = _originalUnicodeString.AsSpan(_info.Offset.Path); 3449_info.Offset.Scheme = 0; 3450_info.Offset.User = vsb.Length; 3451_info.Offset.Host = vsb.Length; 3460_info.Offset.Path = vsb.Length; 3690Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 4187if (_info.Offset.Path == _info.Offset.Query) 4201dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4220if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4223chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4228str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4233dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4254dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
System\UriExt.cs (14)
44Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 459int idx = _info.Offset.Scheme + _syntax.SchemeName.Length + 3; 461if (idx < _info.Offset.User && str[idx] is '/' or '\\') 472if (InFact(Flags.FirstSlashAbsent) && _info.Offset.Query > _info.Offset.Path) 482if (IsDosPath && str[_info.Offset.Path + SecuredPathIndex - 1] == '|') 489int idx = _info.Offset.User; 490Check result = CheckCanonical(str.AsSpan(idx, _info.Offset.Path - idx), '/', out _); 818return _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture); 834return _info.Host!; 919_info = otherUri._info; 933int portIndex = otherUri._info.Offset.Path; 937while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 945portIndex = otherUri._info.Offset.Path;