hashname ::= 'integrity=<' '>' Parses optional ',integrity=<...>' suffix from Next. If Next is empty, returns true with empty Integrity. On success, Next is consumed and Integrity is set.
| 286 | // If Next is empty, returns true with empty Integrity. |
| 287 | // On success, Next is consumed and Integrity is set. |
| 288 | Expect<void> tryParseIntegritySuffix(std::string_view &Next, |
| 289 | std::string_view &Integrity) { |
| 290 | if (Next.empty()) { |
| 291 | Integrity = {}; |
| 292 | return {}; |
| 293 | } |
| 294 | if (!tryRead(",integrity=<"sv, Next)) |
| 295 | return reportError("expected ',integrity=<' after "sv); |
| 296 | std::string_view IntegrityData; |
| 297 | if (!readUntil(Next, '>', IntegrityData)) |
| 298 | return reportError("expected '>' closing integrity"sv); |
| 299 | if (!isIntegrityMetadata(IntegrityData)) |
| 300 | return reportError("invalid integrity metadata"sv); |
| 301 | if (!isEOF(Next)) |
| 302 | return reportError("unexpected trailing content after integrity"sv); |
| 303 | Integrity = IntegrityData; |
| 304 | return {}; |
| 305 | } |
| 306 | |
| 307 | // pkgpath ::= <namespace> <words> |
| 308 | // Parses 'namespace:package' from Next, stopping at delimiters in StopChars. |
no test coverage detected