MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / readNoteCollectionCounts

Function readNoteCollectionCounts

qevercloud/generated/types.cpp:1532–1599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1530}
1531
1532void readNoteCollectionCounts(ThriftBinaryBufferReader& r, NoteCollectionCounts& s) {
1533 QString fname;
1534 ThriftFieldType::type fieldType;
1535 qint16 fieldId;
1536 r.readStructBegin(fname);
1537 while(true) {
1538 r.readFieldBegin(fname, fieldType, fieldId);
1539 if(fieldType == ThriftFieldType::T_STOP) break;
1540 if(fieldId == 1) {
1541 if(fieldType == ThriftFieldType::T_MAP) {
1542 QMap< Guid, qint32 > v;
1543 quint32 size;
1544 ThriftFieldType::type keyType;
1545 ThriftFieldType::type elemType;
1546 r.readMapBegin(keyType, elemType, size);
1547 if(keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, "Incorrect map key type (NoteCollectionCounts.notebookCounts)");
1548 if(elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, "Incorrect map value type (NoteCollectionCounts.notebookCounts)");
1549 for(quint32 i = 0; i < size; i++) {
1550 Guid key;
1551 r.readString(key);
1552 qint32 value;
1553 r.readI32(value);
1554 v[key] = value;
1555 }
1556 r.readMapEnd();
1557 s.notebookCounts = v;
1558 } else {
1559 r.skip(fieldType);
1560 }
1561 } else
1562 if(fieldId == 2) {
1563 if(fieldType == ThriftFieldType::T_MAP) {
1564 QMap< Guid, qint32 > v;
1565 quint32 size;
1566 ThriftFieldType::type keyType;
1567 ThriftFieldType::type elemType;
1568 r.readMapBegin(keyType, elemType, size);
1569 if(keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, "Incorrect map key type (NoteCollectionCounts.tagCounts)");
1570 if(elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, "Incorrect map value type (NoteCollectionCounts.tagCounts)");
1571 for(quint32 i = 0; i < size; i++) {
1572 Guid key;
1573 r.readString(key);
1574 qint32 value;
1575 r.readI32(value);
1576 v[key] = value;
1577 }
1578 r.readMapEnd();
1579 s.tagCounts = v;
1580 } else {
1581 r.skip(fieldType);
1582 }
1583 } else
1584 if(fieldId == 3) {
1585 if(fieldType == ThriftFieldType::T_I32) {
1586 qint32 v;
1587 r.readI32(v);
1588 s.trashCount = v;
1589 } else {

Callers 1

Calls 10

ThriftExceptionClass · 0.85
readStructBeginMethod · 0.80
readFieldBeginMethod · 0.80
readMapBeginMethod · 0.80
readStringMethod · 0.80
readI32Method · 0.80
readMapEndMethod · 0.80
skipMethod · 0.80
readFieldEndMethod · 0.80
readStructEndMethod · 0.80

Tested by

no test coverage detected