本文整理汇总了C++中QDataStream::writeRawBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ QDataStream::writeRawBytes方法的具体用法?C++ QDataStream::writeRawBytes怎么用?C++ QDataStream::writeRawBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDataStream
的用法示例。
在下文中一共展示了QDataStream::writeRawBytes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: backup
void Class::backup(QDataStream & dt) const
{
switch (stereotype) {
case 'i':
dt << ((Q_INT8)((abstractp) ? 'i' : 'I'));
break;
case 'e':
dt << ((Q_INT8) 'E');
break;
default:
// class
dt << ((Q_INT8)((abstractp) ? 'c' : 'C'));
break;
}
Q_INT32 len;
len = text(0).length();
dt << len;
dt.writeRawBytes(text(0), len);
len = filename.length();
dt << len;
dt.writeRawBytes(filename, len);
len = description.length();
dt << len;
if (!description.isEmpty())
dt.writeRawBytes(description, len);
}
示例2: addAttachment
void ElogThread::addAttachment( QDataStream& stream,
const QString& boundary,
const QByteArray& byteArray,
int iFileNumber,
const QString& name ) {
if (byteArray.count() > 0) {
QString strStart = QString("Content-Disposition: form-data; name=\"attfile%1\"; filename=\"%2\"\r\n\r\n").arg(iFileNumber).arg(name);
QString strEnd = QString("%1\r\n").arg(boundary);
stream.writeRawBytes(strStart.ascii(), strStart.length());
stream.writeRawBytes(byteArray.data(), byteArray.count());
stream.writeRawBytes(strEnd.ascii(), strEnd.length());
}
}
示例3: backup
void Package::backup(QDataStream & dt) const
{
dt << ((Q_INT8) '{');
Q_INT32 len;
len = text(0).length();
dt << len;
dt.writeRawBytes(text(0), len);
len = path.length();
dt << len;
dt.writeRawBytes(path, len);
backup_children(dt);
}
示例4: addAttribute
void ElogThread::addAttribute( QDataStream& stream,
const QString& boundary,
const QString& tag,
const QString& strValue,
bool bEncode ) {
if (!strValue.isEmpty()) {
QString str;
if( bEncode ) {
QCString enc = KCodecs::base64Encode(strValue.latin1());
str = QString("%1\r\nContent-Disposition: form-data; name=\"%2\"\r\n\r\n%3\r\n").arg(boundary).arg(tag).arg(enc.data());
} else {
str = QString("%1\r\nContent-Disposition: form-data; name=\"%2\"\r\n\r\n%3\r\n").arg(boundary).arg(tag).arg(strValue);
}
stream.writeRawBytes(str.ascii(), str.length());
}
}
示例5: writeCString
void writeCString(QDataStream &stream, QCString &str)
{
stream.writeRawBytes(str.data(), str.length());
stream << (Q_UINT8)0;
}
示例6: packByteArray
static void packByteArray( QDataStream& out, const QByteArray& array )
{
packUInt32( out, array.size() );
out.writeRawBytes( array.data(), array.size() );
}