Logo Search packages:      
Sourcecode: qt4-x11 version File versions

int QByteArray::size (  )  const [inline]

Returns the number of bytes in this byte array.

The last byte in the byte array is at position size() - 1. In addition, QByteArray ensures that the byte at position size() is always '\0', so that you can use the return value of data() and constData() as arguments to functions that expect '\0'-terminated strings.

Example:

        QByteArray ba("Hello");
        int n = ba.size();          // n == 5
        ba.data()[0];               // returns 'H'
        ba.data()[4];               // returns 'o'
        ba.data()[5];               // returns '\0'

See also:
isEmpty(), resize()

Definition at line 326 of file qbytearray.h.

Referenced by QString::append(), at(), QTextCodec::codecForHtml(), Q3Socket::consumeWriteBuf(), Q3UrlOperator::copyGotData(), QBitArray::count(), Q3TextDrag::decode(), Q3ColorDrag::decode(), Q3UriDrag::decode(), Q3IconDrag::encodedData(), QClipboard::event(), Q3Socket::flush(), QSqlDriver::formatValue(), fromBase64(), QImage::fromData(), QUrl::fromPercentEncoding(), QUrl::fromPunycode(), QXmlInputSource::fromRawData(), QByteArrayMatcher::indexIn(), indexOf(), QPixmap::loadFromData(), QImage::loadFromData(), QBitArray::operator &=(), QString::operator+=(), operator<(), QString::operator<(), operator<<(), QString::operator<=(), operator<=(), operator=(), QString::operator=(), operator==(), operator>(), QString::operator>(), QString::operator>=(), operator>=(), operator[](), QBitArray::operator^=(), QBitArray::operator|=(), QBitArray::operator~(), QIODevice::peek(), QString::prepend(), Q3Ftp::put(), QFtp::put(), QBitArray::QBitArray(), qCompress(), QHash< Key, T >::qHash(), qUncompress(), QIODevice::readAll(), QIODevice::readLine(), Q3Process::readLineStderr(), Q3Process::readLineStdout(), replace(), QBitArray::resize(), QWidget::restoreGeometry(), QAbstractFormBuilder::save(), QUrl::setEncodedUrl(), QByteArrayMatcher::setPattern(), QUrl::setQueryItems(), Q3UriDrag::setUris(), QBitArray::size(), Q3Socket::sn_read(), Q3CString::sprintf(), toBase64(), QUrl::toPercentEncoding(), QUrl::toPunycode(), QString::toUtf8(), truncate(), QIODevice::write(), and Q3Socket::writeData().

{ return d->size; }


Generated by  Doxygen 1.6.0   Back to index