本文整理汇总了C++中hash::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ hash::contains方法的具体用法?C++ hash::contains怎么用?C++ hash::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hash
的用法示例。
在下文中一共展示了hash::contains方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSystemException
void Error::readSystemException(hash data) {
if (!data.contains(1)) {
LOG_ERROR("Empty User Exception");
return;
}
bool ok;
int errorCode = data[1].toInt(&ok);
if (!ok) {
LOG_ERROR("Unknown User Exception");
return;
}
EDAMErrorCode(errorCode);
if (data.contains(2)) {
QString message = data[2].toString();
LOG_INFO(message);
}
if (data.contains(3)) {
int rateLimitDuration = data[3].toInt();
LOG_INFO(QString("Rate Limit Duration: %1 s.").arg(rateLimitDuration));
}
}
示例2: readExceptions
void Error::readExceptions(hash data) {
if (data.contains(1))
readUserException(data[1].value<hash>());
if (data.contains(2))
readSystemException(data[2].value<hash>());
if (data.contains(3))
readNotFoundException(data[3].value<hash>());
}
示例3: readNotFoundException
void Error::readNotFoundException(hash data) {
QString e("Not Found Exception");
if (data.contains(1)) {
QString identifier = data[1].toString();
e.append(" Identifier:");
e.append(identifier);
}
if (data.contains(2)) {
QString key = data[2].toString();
e.append(" Key:");
e.append(key);
}
LOG_ERROR(e);
}
示例4: readUserException
void Error::readUserException(hash data) {
if (!data.contains(1)) {
LOG_ERROR("Empty User Exception");
return;
}
bool ok;
int errorCode = data[1].toInt(&ok);
if (!ok) {
LOG_ERROR("Unknown User Exception");
return;
}
EDAMErrorCode(errorCode);
QString parameter;
if (data.contains(2)) {
parameter = QString::fromUtf8(data[2].toByteArray());
LOG_INFO(parameter);
}
}
示例5: loadFromData
void NoteBook::loadFromData(hash data)
{
qDebug() << "readData" << data.keys();
if (data.contains(1))
guid = QString::fromUtf8(data[1].toByteArray());
if (data.contains(2))
name = QString::fromUtf8(data[2].toByteArray());
if (data.contains(5))
updateSequenceNum = data[5].toInt();
if (data.contains(6))
defaultNotebook = data[6].toBool();
if (data.contains(7))
serviceCreated = QDateTime::fromMSecsSinceEpoch(data[7].toLongLong());
if (data.contains(8))
serviceUpdated = QDateTime::fromMSecsSinceEpoch(data[8].toLongLong());
if (data.contains(12))
stack = QString::fromUtf8(data[12].toByteArray());
}
示例6: readAttributes
void Note::readAttributes(hash data)
{
if (data.contains(1))
attributes["subjectDate"] = data[1];
if (data.contains(10))
attributes["latitude"] = data[10];
if (data.contains(11))
attributes["longitude"] = data[11];
if (data.contains(12))
attributes["altitude"] = data[12];
if (data.contains(13))
attributes["author"] = data[13];
if (data.contains(14))
attributes["sourceURL"] = data[14];
if (data.contains(15))
attributes["sourceURL"] = data[15];
if (data.contains(16))
attributes["sourceApplication"] = data[16];
if (data.contains(17))
attributes["shareDate"] = data[17];
if (data.contains(18))
attributes["reminderOrder"] = data[18];
if (data.contains(19))
attributes["reminderDoneTime"] = data[19];
if (data.contains(20))
attributes["reminderTime"] = data[20];
if (data.contains(21))
attributes["placeName"] = data[21];
if (data.contains(22))
attributes["contentClass"] = data[22];
if (data.contains(23))
attributes["applicationData"] = data[23];
if (data.contains(24))
attributes["lastEditedBy"] = data[24];
if (data.contains(25))
attributes["classifications"] = data[25];
if (data.contains(27))
attributes["creatorId"] = data[27];
if (data.contains(28))
attributes["lastEditorId"] = data[28];
}
示例7: loadFromData
void Note::loadFromData(hash data)
{
if (data.contains(1))
guid = QString::fromUtf8(data[1].toByteArray());
if (data.contains(2))
title = QString::fromUtf8(data[2].toByteArray());
if (data.contains(3))
content = QString::fromUtf8(data[3].toByteArray());
if (data.contains(4))
contentHash = data[4].toByteArray().toHex();
if (data.contains(5))
contentLength = data[5].toInt();
if (data.contains(6))
created = QDateTime::fromMSecsSinceEpoch(data[6].toLongLong());
if (data.contains(7))
updated = QDateTime::fromMSecsSinceEpoch(data[7].toLongLong());
if (data.contains(8))
deleted = QDateTime::fromMSecsSinceEpoch(data[8].toLongLong());
if (data.contains(9))
active = data[9].toBool();
if (data.contains(10))
updateSequenceNum = data[10].toInt();
if (data.contains(11))
notebookGuid = QString::fromUtf8(data[11].toByteArray());
if (data.contains(12)) {
list l = data[12].toList();
for (int i=0; i<l.size(); i++){
QString tguid = QString::fromUtf8(l.at(i).toByteArray());
tagGuids.append(tguid);
}
}
if (data.contains(13)) {
list l = data[13].toList();
QSqlDatabase::database().transaction();
for (int i=0; i<l.size(); i++){
hash res = l.at(i).value<hash>();
Resource *r = new Resource(this, res);
delete r;
}
QSqlDatabase::database().commit();
}
if (data.contains(14)) {
hash attr = data[14].value<hash>();
readAttributes(attr);
}
}