Commit 79e211c1 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

cosmetic changes

parent 891c91d2
...@@ -115,21 +115,21 @@ protected: ...@@ -115,21 +115,21 @@ protected:
bool isValid() const noexcept { return io; } bool isValid() const noexcept { return io; }
bool trySequence(quint32* rows=nullptr) { levels.push_back(rows); bool trySequence(quint32* rows=nullptr) { levels.push_back(rows);
if (Q_LIKELY(rows)) { putInteger (*rows , cbor::ArrayType); } if (Q_LIKELY(rows)) { putInteger (*rows , cbor::ArrayType); }
else { putMajorValue(cbor::IndefiniteLength, cbor::ArrayType); } return true; } else { putMajorValue(cbor::IndefiniteLength, cbor::ArrayType); } return true; }
bool tryRecord (quint32* cols=nullptr) { levels.push_back(cols); bool tryRecord (quint32* cols=nullptr) { levels.push_back(cols);
if (Q_LIKELY(cols)) { putInteger (*cols , cbor::MapType ); } if (Q_LIKELY(cols)) { putInteger (*cols , cbor::MapType ); }
else { putMajorValue(cbor::IndefiniteLength, cbor::MapType ); } return true; } else { putMajorValue(cbor::IndefiniteLength, cbor::MapType ); } return true; }
bool tryNull ( ) { putSimpleValue(cbor::Null ); return true; } bool tryNull ( ) { putSimpleValue(cbor::Null ); return true; }
bool tryBind ( QUtf8DataView u) { putInteger (quint64(u.size()), cbor::TextStringType); io->append(u.data(), u.size()); return true; } bool tryBind ( QUtf8DataView u) { putInteger (quint64(u.size()), cbor::TextStringType); io->append(u.data(), u.size()); return true; }
bool tryBind ( QString&& s) { QUtf8Data u(s.toUtf8()); bool tryBind ( QString&& s) { QUtf8Data u(s.toUtf8());
putInteger (quint64(u.size()), cbor::TextStringType); io->append(u.utf8()); return true; } putInteger (quint64(u.size()), cbor::TextStringType); io->append(u.utf8()); return true; }
//static const char mimeHeader[] = "Content-Type:text/plain;charset=utf-16\xD\xA\xD\xA"; //static const char mimeHeader[] = "Content-Type:text/plain;charset=utf-16\xD\xA\xD\xA";
//QByteArray utf16(QByteArray::fromRawData(reinterpret_cast<const char*>(s.utf16()), s.size()*int(sizeof(QChar)))); //QByteArray utf16(QByteArray::fromRawData(reinterpret_cast<const char*>(s.utf16()), s.size()*int(sizeof(QChar))));
//return putMajorValue (cbor::NextByteUnsignedInt,cbor::TagType ) && io->putChar(cbor::MimeMessage) && //return putMajorValue (cbor::NextByteUnsignedInt,cbor::TagType ) && io->putChar(cbor::MimeMessage) &&
// putInteger (sizeof(mimeHeader)+ // putInteger (sizeof(mimeHeader)+
// utf16.size() ,cbor::ByteStringType) && io->write(mimeHeader, sizeof(mimeHeader)) // utf16.size() ,cbor::ByteStringType) && io->write(mimeHeader, sizeof(mimeHeader))
// && (Q_LIKELY(io->write(utf16)) || s[0]==QChar('\0')); } // && (Q_LIKELY(io->write(utf16)) || s[0]==QChar('\0')); }
bool tryBind ( QByteArray&& s) { putInteger (quint64(s.size()), cbor::ByteStringType); io->append(s); return true; } bool tryBind ( QByteArray&& s) { putInteger (quint64(s.size()), cbor::ByteStringType); io->append(s); return true; }
bool tryBind ( bool&& b) { putSimpleValue(b ? cbor::True : cbor::False); return true; } bool tryBind ( bool&& b) { putSimpleValue(b ? cbor::True : cbor::False); return true; }
bool tryBind ( float&& n) { putSimpleValue(cbor::Next32BitFloat); putBigEndian(n); return true; } bool tryBind ( float&& n) { putSimpleValue(cbor::Next32BitFloat); putBigEndian(n); return true; }
......
...@@ -284,7 +284,7 @@ struct QTransmogrifier<QColor> { ...@@ -284,7 +284,7 @@ struct QTransmogrifier<QColor> {
} }
if (c.alpha()<255) { r = r.bind("alpha",quint8(c.alpha())); } if (c.alpha()<255) { r = r.bind("alpha",quint8(c.alpha())); }
return r.bind("base",quint8(255)); // Explicits ARGBCMYKSLV components' base (H base is 360 corresponding to color wheel degrees, with -1 used for gray in addition to S being 0) return r.bind("base",quint8(255)); // Explicits ARGBCMYKSLV components' base (H base is 360 corresponding to color wheel degrees, with -1 used for gray in addition to S being 0)
// QDebug use of float values removes need for base but may lose precision // QDebug use of float values removes need for base but may lose precision
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment