15 writes to _string
System.Private.Uri (15)
System\Uri.cs (9)
2150_string = _string.Substring(0, idx);
2168_string = _string.Substring(0, idx);
2218_string = newHost;
3307_string = string.Empty;
3311_string = _syntax.SchemeName + SchemeDelimiter;
3329_string = string.Concat(_string, _originalUnicodeString.AsSpan(origIdx));
3389_string += EscapeUnescapeIri(_originalUnicodeString, offset, origIdx, isQuery: false);
3519_string += EscapeUnescapeIri(_originalUnicodeString, offset, origIdx, isQuery: true);
3570_string += EscapeUnescapeIri(_originalUnicodeString, offset, origIdx, isQuery: false);
124 references to _string
System.Private.Uri (124)
System\Uri.cs (99)
168Debug.Assert(offset.End >= offset.Fragment && offset.End <= _string.Length);
188Debug.Assert(Ascii.IsValid(_string));
339char ch = _string[_info.Offset.Path];
548[MemberNotNull(nameof(_string))]
1026? _string
1027: (IsDosPath && _string[start] is '/' or '\\')
1028? _string.Substring(start + 1, _info.Offset.Query - start - 1)
1029: _string.Substring(start, _info.Offset.Query - start);
1059if (_string[start] is '/' or '\\')
1068ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start);
1184public string OriginalString => _originalUnicodeString ?? _string;
1588return _string;
1610result = _string;
1647(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\
1657result = _string.AsSpan(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
1778if (string.Equals(_string, other._string, IsUncOrDosPath ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
1800string str = other._string;
1809if (_string[i1] != str[i2])
1822if (i1 < _info.Offset.Path && _string[i1] != ':')
2010int length = _string.Length;
2017Debug.Assert(ReferenceEquals(_string, OriginalString));
2019fixed (char* pUriString = _string)
2150_string = _string.Substring(0, idx);
2168_string = _string.Substring(0, idx);
2244info.Offset.End = _string.Length;
2257while (UriHelper.IsLWS(_string[idx]))
2269while (idx < end && (_string[idx] == '/' || _string[idx] == '\\'))
2280while (_string[idx++] != ':')
2287if (_string[idx] == '\\' || _string[idx + 1] == '\\')
2296while (idx < end && (_string[idx] == '/' || _string[idx] == '\\'))
2340while (_string[idx] != '@')
2465string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info);
2523host[i] != _string[_info.Offset.Host + i])
2639if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i])
2711else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2746else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
2769string str = _string;
2786string str = _string;
3033return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3036_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3037_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host));
3046return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host);
3048return string.Concat(_string.AsSpan(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host),
3053if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3054return _string;
3056return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3063_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3064_string.AsSpan(_info.Offset.Host, _info.Offset.Fragment - _info.Offset.Host));
3066if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3067return _string;
3069return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3073return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme);
3077if (_info.Offset.Scheme == 0 && _info.Offset.Fragment == _string.Length)
3078return _string;
3080return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme);
3086return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme);
3096while (_string[--idx] != ':')
3099return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host,
3106_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/')
3115return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx);
3127return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx);
3139return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx);
3143_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User);
3149return string.Concat(_string.AsSpan(_info.Offset.User, _info.Offset.Path - _info.Offset.User),
3153return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path);
3159_string.AsSpan(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme),
3160_string.AsSpan(_info.Offset.Host, _info.Offset.End - _info.Offset.Host));
3162if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length)
3163return _string;
3165return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme);
3168return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path);
3184return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User);
3224int length = _string.Length;
3230fixed (char* str = _string)
3232GetLengthWithoutTrailingSpaces(_string, ref length, idx);
3315_info.Offset.User = _string.Length;
3316_info.Offset.Host = _string.Length;
3319_info.Offset.Path = _string.Length;
3329_string = string.Concat(_string, _originalUnicodeString.AsSpan(origIdx));
3332string str = _string;
3391length = _string.Length;
3393if (_string == _originalUnicodeString)
3395GetLengthWithoutTrailingSpaces(_string, ref length, idx);
3399fixed (char* str = _string)
3521length = _string.Length;
3523if (_string == _originalUnicodeString)
3525GetLengthWithoutTrailingSpaces(_string, ref length, idx);
3532fixed (char* str = _string)
3572length = _string.Length;
3574GetLengthWithoutTrailingSpaces(_string, ref length, idx);
3580fixed (char* str = _string)
4322dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4338ReadOnlySpan<char> str = _string;
4354dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
4375dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
System\UriExt.cs (25)
19[MemberNotNull(nameof(_string))]
39ParsingError err = ParseScheme(_string, ref _flags, ref _syntax!);
60((uriKind == UriKind.Relative || (_string.Length >= 2 && (_string[0] != '\\' || _string[1] != '\\')))
93if (IriParsing && CheckForUnicodeOrEscapedUnreserved(_string))
98_originalUnicodeString = _string; // original string location changed
442fixed (char* str = _string)
451if (CheckForColonInFirstPathSegment(_string))
455return (CheckCanonical(str, ref idx, _string.Length, c_EOL)
505if (idx >= _info.Offset.User || _string[idx - 1] == '\\' || _string[idx] == '\\')
510while (++idx < _info.Offset.User && (_string[idx] == '/' || _string[idx] == '\\'))
530if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')
559if (idx + 1 >= _string.Length || str[idx] != '/' || str[idx + 1] != '/')
875if (ReferenceEquals(newUriString, baseUri._string))
885return UriHelper.EscapeString(_string, checkExistingEscaped: true, UriHelper.UnreservedReserved);
889return UnescapeDataString(_string);
893if (_string.Length == 0)
897UriHelper.UnescapeString(_string, ref vsb, c_DummyChar, c_DummyChar, c_DummyChar, UnescapeMode.EscapeUnescape, null, false);
1028[MemberNotNull(nameof(_string))]
1056while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host)
1060if (otherUri._string[portIndex] != ':')
1072_string = otherUri._string;