207 references to Offset
System.Private.Uri (207)
System\Uri.cs (195)
155Offset offset = info.Offset; 339char ch = _string[_info.Offset.Path]; 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); 1048start = _info.Offset.Path; 1068ReadOnlySpan<char> path = _string.AsSpan(start, _info.Offset.Query - start); 1125return (int)_info.Offset.PortValue; 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); 1795int i1 = _info.Offset.Host; 1796int end1 = _info.Offset.Path; 1798int i2 = other._info.Offset.Host; 1799int end2 = other._info.Offset.Path; 1822if (i1 < _info.Offset.Path && _string[i1] != ':') 2244info.Offset.End = _string.Length; 2260++info.Offset.Scheme; 2282++info.Offset.Scheme; 2307info.Offset.PortValue = (ushort)_syntax.DefaultPort; 2315info.Offset.User = (int)(cF & Flags.IndexMask); 2316info.Offset.Host = info.Offset.User; 2317info.Offset.Path = info.Offset.User; 2326info.Offset.User = idx; 2331info.Offset.Host = idx; 2332info.Offset.Path = (int)(cF & Flags.IndexMask); 2345info.Offset.Host = idx; 2349info.Offset.Host = idx; 2366info.Offset.Path = idx; 2376info.Offset.End = _originalUnicodeString.Length; 2378if (idx < info.Offset.End) 2387if (++idx < info.Offset.End) 2397for (++idx; idx < info.Offset.End; ++idx) 2410info.Offset.PortValue = (ushort)port; 2419info.Offset.Path = idx; 2465string host = CreateHostStringHelper(_string, _info.Offset.Host, _info.Offset.Path, ref flags, _info); 2522if ((_info.Offset.Host + i) >= _info.Offset.End || 2523host[i] != _string[_info.Offset.Host + i]) 2639if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2658_info.Offset.PortValue = 0; 2668if (port != _info.Offset.PortValue) 2676_info.Offset.PortValue = (ushort)port; 2711else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2746else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2822ReadOnlySpan<char> slice = str.AsSpan(_info.Offset.User, _info.Offset.Host - _info.Offset.User); 2931bool success = _info.Offset.PortValue.TryFormat(dest.AppendSpan(MaxUshortLength), out int charsWritten); 2959if ((parts & UriComponents.Query) != 0 && _info.Offset.Query < _info.Offset.Fragment) 2961int offset = (_info.Offset.Query + 1); 2965FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.Fragment - offset), ref dest, nonCanonical, formatAs, isQuery: true); 2969if ((parts & UriComponents.Fragment) != 0 && _info.Offset.Fragment < _info.Offset.End) 2971int offset = _info.Offset.Fragment + 1; 2975FormatQueryOrFragment(str.AsSpan(offset, _info.Offset.End - offset), ref dest, nonCanonical, formatAs, isQuery: false); 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), 3049":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 3053if (_info.Offset.Scheme == 0 && _info.Offset.End == _string.Length) 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) 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) 3080return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3086return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3092int idx = _info.Offset.Path; 3099return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3100idx - _info.Offset.Host); 3106_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3107delimiterAwareIdx = _info.Offset.Path + 1; 3109delimiterAwareIdx = _info.Offset.Path; 3111if (delimiterAwareIdx >= _info.Offset.Query) 3115return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3120delimiterAwareIdx = _info.Offset.Query + 1; 3122delimiterAwareIdx = _info.Offset.Query; 3124if (delimiterAwareIdx >= _info.Offset.Fragment) 3127return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3132delimiterAwareIdx = _info.Offset.Fragment + 1; 3134delimiterAwareIdx = _info.Offset.Fragment; 3136if (delimiterAwareIdx >= _info.Offset.End) 3139return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3142return (_info.Offset.Path - _info.Offset.User == 0) ? string.Empty : 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), 3150":", _info.Offset.PortValue.ToString(CultureInfo.InvariantCulture)); 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) 3165return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3168return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3177delimiterAwareIdx = _info.Offset.Host - 1; 3179delimiterAwareIdx = _info.Offset.Host; 3181if (_info.Offset.User >= delimiterAwareIdx) 3184return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3223int idx = _info.Offset.Scheme; 3260idx = _info.Offset.User; 3261result = CheckCanonical(str, ref idx, _info.Offset.Host, '@'); 3295idx = _info.Offset.Path; 3296origIdx = _info.Offset.Path; 3314_info.Offset.Scheme = 0; 3315_info.Offset.User = _string.Length; 3316_info.Offset.Host = _string.Length; 3319_info.Offset.Path = _string.Length; 3320idx = _info.Offset.Path; 3347_info.Offset.Query = idx; 3348_info.Offset.Fragment = str.Length; // There is no fragment in DisablePathAndQueryCanonicalization mode 3349_info.Offset.End = str.Length; 3422&& (_info.Offset.Path == length || (str[_info.Offset.Path] != '/' && str[_info.Offset.Path] != '\\'))) 3530_info.Offset.Query = idx; 3578_info.Offset.Fragment = idx; 3605_info.Offset.End = idx; 4308if (_info.Offset.Path == _info.Offset.Query) 4322dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4347if (dosPathIdx != 0 && str[dosPathIdx + _info.Offset.Path - 1] == '|') 4350chars[dosPathIdx + _info.Offset.Path - 1] = ':'; 4355str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4360dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path)); 4381dest.Append(_string.AsSpan(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path));
System\UriExt.cs (12)
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); 1052int portIndex = otherUri._info.Offset.Path; 1056while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 1064portIndex = otherUri._info.Offset.Path;