Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetNextValue()

string System.Net.Http.AuthenticationHelper.DigestResponse.GetNextValue ( string data,
int currentIndex,
bool expectQuotes,
out int parsedIndex )
inlineprivate

Definition at line 108 of file AuthenticationHelper.cs.

109 {
110 bool flag = false;
111 if (data[currentIndex] == '"')
112 {
113 flag = true;
114 currentIndex++;
115 }
116 if (expectQuotes && !flag)
117 {
118 parsedIndex = currentIndex;
119 return null;
120 }
122 while (currentIndex < data.Length && ((flag && data[currentIndex] != '"') || (!flag && data[currentIndex] != ',')))
123 {
124 stringBuilder.Append(data[currentIndex]);
125 currentIndex++;
126 if (currentIndex == data.Length || (!flag && CharIsSpaceOrTab(data[currentIndex])))
127 {
128 break;
129 }
130 if (flag && data[currentIndex] == '"' && data[currentIndex - 1] == '\\')
131 {
132 stringBuilder.Append(data[currentIndex]);
133 currentIndex++;
134 }
135 }
136 if (flag)
137 {
138 currentIndex++;
139 }
140 while (currentIndex < data.Length && CharIsSpaceOrTab(data[currentIndex]))
141 {
142 currentIndex++;
143 }
144 if (currentIndex == data.Length)
145 {
146 parsedIndex = currentIndex;
148 }
149 if (data[currentIndex++] != ',')
150 {
151 parsedIndex = currentIndex;
152 return null;
153 }
154 while (currentIndex < data.Length && CharIsSpaceOrTab(data[currentIndex]))
155 {
156 currentIndex++;
157 }
158 parsedIndex = currentIndex;
160 }
static string GetStringAndRelease(StringBuilder sb)
static StringBuilder Acquire(int capacity=16)

References System.Text.StringBuilderCache.Acquire(), System.Net.Http.AuthenticationHelper.DigestResponse.CharIsSpaceOrTab(), and System.Text.StringBuilderCache.GetStringAndRelease().

Referenced by System.Net.Http.AuthenticationHelper.DigestResponse.Parse().