| 688 | } |
| 689 | |
| 690 | void parse_verbatim(DynamicString &str, const char *json) |
| 691 | { |
| 692 | if (json == NULL) { |
| 693 | fatal("json is NULL"); |
| 694 | return; |
| 695 | } |
| 696 | |
| 697 | NEXT_OR_RETURN(json, '"', /*void*/); |
| 698 | NEXT_OR_RETURN(json, '"', /*void*/); |
| 699 | NEXT_OR_RETURN(json, '"', /*void*/); |
| 700 | |
| 701 | const char *end = strstr(json, "\"\"\""); |
| 702 | if (end == NULL) { |
| 703 | fatal("Bad verbatim string"); |
| 704 | return; |
| 705 | } |
| 706 | |
| 707 | // Find last '"'. |
| 708 | end += 3; |
| 709 | while (*end && *end == '"') |
| 710 | ++end; |
| 711 | |
| 712 | str.set(json, u32(end - 3 - json)); |
| 713 | } |
| 714 | |
| 715 | } // namespace json |
| 716 | |