Check specifically for GarbageAtEnd error

- Out parameter for garbage data\n- Rename parseUntilMalformed to parseUntilGarbage

Signed-off-by: Dylan Schooner <dschooner05@gmail.com>
This commit is contained in:
Dylan Schooner
2025-12-18 15:23:48 -05:00
parent 9c7fe72f9c
commit 51b47050f9
4 changed files with 11 additions and 7 deletions

View File

@@ -107,8 +107,8 @@ QJsonArray toJsonArray(const QList<T>& container)
////////////////// READING ////////////////////
// Attempt to parse JSON up until unexpected data is encountered
QJsonDocument parseUntilMalformed(const QByteArray& json, QJsonParseError* error = nullptr);
// Attempt to parse JSON up until garbage is encountered
QJsonDocument parseUntilGarbage(const QByteArray& json, QJsonParseError* error = nullptr, QString* garbage = nullptr);
/// @throw JsonException
template <typename T>