void QTweetListUpdate::parseJsonFinished(const QJsonDocument &jsonDoc) { if (jsonDoc.isObject()) { QTweetList list = QTweetConvert::jsonObjectToTweetList(jsonDoc.object()); emit parsedList(list); } }
void QTweetListCreate::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QTweetList list = QTweetConvert::variantMapToTweetList(json.toMap()); emit parsedList(list); } else { qDebug() << "QTweetListCreate json parser error: " << errorMsg; emit error(QTweetJsonError(errorMsg, json.toByteArray())); } }
void QTweetListCreate::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QTweetList list = QTweetConvert::variantMapToTweetList(json.toMap()); emit parsedList(list); } else { qDebug() << "QTweetListCreate json parser error: " << errorMsg; setLastErrorMessage(errorMsg); emit error(JsonParsingError, errorMsg); } }
ListPtr Bencoder::parseList(const std::string& str, unsigned int& pos) { m_logger->log(logger::Logger::FINE, "Bencoder::ParseList()"); m_logger->begin(logger::Logger::DEBUG); m_logger->prop("str", const_cast<std::string&>(str)); m_logger->end("Bencoder::ParseList()"); assert(str[pos] == 'l'); ListPtr parsedList(new List); int firstLetterLength = 1; // l letter unsigned int posInString = pos + firstLetterLength; while (str[posInString] != 'e') { parseNextType(str, posInString, parsedList); } return parsedList; }