4 writes to _info
System.Private.Uri (4)
224 references to _info
System.Private.Uri (224)
System\Uri.cs (210)
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.ScopeId != null ?
1188string.Concat(host.AsSpan(1, host.Length - 2), _info.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)
2437string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, ref _info.ScopeId);
2485if (_info.ScopeId is not null)
2494if ((_info.Offset.Host + i) >= _info.Offset.End ||
2495host[i] != _string[_info.Offset.Host + i])
2505_info.Host = host;
2573if (_info.Host != null)
2579if (_info.Host is null)
2606host = CreateHostStringHelper(host, 0, host.Length, ref flags, ref _info.ScopeId);
2609if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i])
2628_info.Offset.PortValue = 0;
2638if (port != _info.Offset.PortValue)
2646_info.Offset.PortValue = (ushort)port;
2650_info.Host = host;
2663Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0);
2681else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2702Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0);
2716else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2790ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User);
2843string host = _info.Host!;
2883if ((parts & UriComponents.SerializationInfoString) != 0 && HostType == Flags.IPv6HostType && _info.ScopeId != null)
2886dest.Append(_info.ScopeId);
2899bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten);
2927if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment)
2929int offset = (_info.Offset.Query + 1);
2942str.AsSpan(offset, _info.Offset.Fragment - offset),
2959UriHelper.UnescapeString(str, offset, _info.Offset.Fragment,
2966if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End)
2968int offset = _info.Offset.Fragment + 1;
2981str.AsSpan(offset, _info.Offset.End - offset),
2998UriHelper.UnescapeString(str, offset, _info.Offset.End,
3020return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3023_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3024_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host));
3033return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host);
3035return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host),
3036":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3040if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3043return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3050_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3051_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host));
3053if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3056return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3060return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3064if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3067return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3073return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme);
3079int idx = _info.Offset.Path;
3086return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host,
3087idx - _info.Offset.Host);
3093_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/')
3094delimiterAwareIdx = _info.Offset.Path + 1;
3096delimiterAwareIdx = _info.Offset.Path;
3098if (delimiterAwareIdx >= _info.Offset.Query)
3102return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx);
3107delimiterAwareIdx = _info.Offset.Query + 1;
3109delimiterAwareIdx = _info.Offset.Query;
3111if (delimiterAwareIdx >= _info.Offset.Fragment)
3114return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx);
3119delimiterAwareIdx = _info.Offset.Fragment + 1;
3121delimiterAwareIdx = _info.Offset.Fragment;
3123if (delimiterAwareIdx >= _info.Offset.End)
3126return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx);
3129return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty :
3130_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User);
3136return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User),
3137":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture));
3140return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path);
3146_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3147_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host));
3149if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3152return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3155return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path);
3164delimiterAwareIdx = _info.Offset.Host - 1;
3166delimiterAwareIdx = _info.Offset.Host;
3168if (_info.Offset.User >= delimiterAwareIdx)
3171return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User);
3210int idx = _info.Offset.Scheme;
3247idx = _info.Offset.User;
3248result = CheckCanonical(str, ref idx, _info.Offset.Host, '@');
3282idx = _info.Offset.Path;
3283origIdx = _info.Offset.Path;
3302_info.Offset.Path = (ushort)_string.Length;
3303idx = _info.Offset.Path;
3330_info.Offset.Query = (ushort)idx;
3331_info.Offset.Fragment = (ushort)str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode
3332_info.Offset.End = (ushort)str.Length;
3411&& (_info.Offset.Path == length || (str[_info.Offset.Path] != '/' && str[_info.Offset.Path] != '\\')))
3525_info.Offset.Query = (ushort)idx;
3579_info.Offset.Fragment = (ushort)idx;
3606_info.Offset.End = (ushort)idx;
3787Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info)));
4299if (_info.Offset.Path == _info.Offset.Query)
4313dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4338if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|')
4341chars[dosPathIdx + _info.Offset.Path - 1] = ':';
4346str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path),
4351dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4372dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));