- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

Classes | Functions

# qbytearray.h File Reference

`#include <QtCore/qatomic.h>`
`#include <QtCore/qnamespace.h>`
`#include <string.h>`
`#include <stdarg.h>`

Go to the source code of this file.

## Classes
class | QByteArray
struct | QByteArray::Data
class | QByteRef
## Functions
QT_BEGIN_HEADER QT_BEGIN_NAMESPACE Q_CORE_EXPORT char * | qstrdup (const char *)
uint | qstrlen (const char *str)
uint | qstrnlen (const char *str, uint maxlen)
Q_CORE_EXPORT char * | qstrcpy (char *dst, const char *src)
Q_CORE_EXPORT char * | qstrncpy (char *dst, const char *src, uint len)
Q_CORE_EXPORT int | qstrcmp (const char *str1, const char *str2)
Q_CORE_EXPORT int | qstrcmp (const QByteArray &str1, const QByteArray &str2)
Q_CORE_EXPORT int | qstrcmp (const QByteArray &str1, const char *str2)
static int | qstrcmp (const char *str1, const QByteArray &str2)
int | qstrncmp (const char *str1, const char *str2, uint len)
Q_CORE_EXPORT int | qstricmp (const char *, const char *)
Q_CORE_EXPORT int | qstrnicmp (const char *, const char *, uint len)
Q_CORE_EXPORT int | qvsnprintf (char *str, size_t n, const char *fmt, va_list ap)
Q_CORE_EXPORT int | qsnprintf (char *str, size_t n, const char *fmt,...)
Q_CORE_EXPORT quint16 | qChecksum (const char *s, uint len)
bool | operator== (const QByteArray &a1, const QByteArray &a2)
bool | operator== (const QByteArray &a1, const char *a2)
bool | operator== (const char *a1, const QByteArray &a2)
bool | operator!= (const QByteArray &a1, const QByteArray &a2)
bool | operator!= (const QByteArray &a1, const char *a2)
bool | operator!= (const char *a1, const QByteArray &a2)
bool | operator< (const QByteArray &a1, const QByteArray &a2)
bool | operator< (const QByteArray &a1, const char *a2)
bool | operator< (const char *a1, const QByteArray &a2)
bool | operator<= (const QByteArray &a1, const QByteArray &a2)
bool | operator<= (const QByteArray &a1, const char *a2)
bool | operator<= (const char *a1, const QByteArray &a2)
bool | operator> (const QByteArray &a1, const QByteArray &a2)
bool | operator> (const QByteArray &a1, const char *a2)
bool | operator> (const char *a1, const QByteArray &a2)
bool | operator>= (const QByteArray &a1, const QByteArray &a2)
bool | operator>= (const QByteArray &a1, const char *a2)
bool | operator>= (const char *a1, const QByteArray &a2)
const QByteArray | operator+ (const QByteArray &a1, const QByteArray &a2)
const QByteArray | operator+ (const QByteArray &a1, const char *a2)
const QByteArray | operator+ (const QByteArray &a1, char a2)
const QByteArray | operator+ (const char *a1, const QByteArray &a2)
const QByteArray | operator+ (char a1, const QByteArray &a2)
Q_CORE_EXPORT QDataStream & | operator<< (QDataStream &, const QByteArray &)
Q_CORE_EXPORT QDataStream & | operator>> (QDataStream &, QByteArray &)
Q_CORE_EXPORT QByteArray | qCompress (const uchar *data, int nbytes, int compressionLevel=-1)
Q_CORE_EXPORT QByteArray | qUncompress (const uchar *data, int nbytes)
QByteArray | qCompress (const QByteArray &data, int compressionLevel=-1)
QByteArray | qUncompress (const QByteArray &data)
| Q_DECLARE_TYPEINFO (QByteArray, Q_MOVABLE_TYPE)

## Function Documentation

QT_BEGIN_HEADER QT_BEGIN_NAMESPACE Q_CORE_EXPORT char* qstrdup | ( | const char * |  | ) |

Search for all occurrences

uint qstrlen | ( | const char * | str | ) | `[inline]`

Search for all occurrences

Definition at line 67 of file qbytearray.h.

    { return str ? uint(strlen(str)) : 0; }

uint qstrnlen | ( | const char * | str,
|  | uint | maxlen
| ) |  | `[inline]`

Search for all occurrences

Definition at line 70 of file qbytearray.h.

    {
        uint length = 0;
        if (str) {
            while (length < maxlen && *str++)
                length++;
        }
        return length;
    }

Q_CORE_EXPORT char* qstrcpy | ( | char * | dst,
|  | const char * | src
| ) |  |

Search for all occurrences

Q_CORE_EXPORT char* qstrncpy | ( | char * | dst,
|  | const char * | src,
|  | uint | len
| ) |  |

Search for all occurrences

Q_CORE_EXPORT int qstrcmp | ( | const char * | str1,
|  | const char * | str2
| ) |  |

Search for all occurrences

Q_CORE_EXPORT int qstrcmp | ( | const QByteArray & | str1,
|  | const QByteArray & | str2
| ) |  |

Search for all occurrences

Q_CORE_EXPORT int qstrcmp | ( | const QByteArray & | str1,
|  | const char * | str2
| ) |  |

Search for all occurrences

static int qstrcmp | ( | const char * | str1,
|  | const QByteArray & | str2
| ) |  | `[inline, static]`

Search for all occurrences

Definition at line 86 of file qbytearray.h.

    { return -qstrcmp(str2, str1); }

int qstrncmp | ( | const char * | str1,
|  | const char * | str2,
|  | uint | len
| ) |  | `[inline]`

Search for all occurrences

Definition at line 89 of file qbytearray.h.

    {
        return (str1 && str2) ? strncmp(str1, str2, len)
            : (str1 ? 1 : (str2 ? -1 : 0));
    }

Q_CORE_EXPORT int qstricmp | ( | const char * | ,
|  | const char * |
| ) |  |

Search for all occurrences

Q_CORE_EXPORT int qstrnicmp | ( | const char * | ,
|  | const char * | ,
|  | uint | len
| ) |  |

Search for all occurrences

Q_CORE_EXPORT int qvsnprintf | ( | char * | str,
|  | size_t | n,
|  | const char * | fmt,
|  | va_list | ap
| ) |  |

Search for all occurrences

Q_CORE_EXPORT int qsnprintf | ( | char * | str,
|  | size_t | n,
|  | const char * | fmt,
|  |  | ...
| ) |  |

Search for all occurrences

Q_CORE_EXPORT quint16 qChecksum | ( | const char * | s,
|  | uint | len
| ) |  |

Search for all occurrences

bool operator== | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 509 of file qbytearray.h.

    { return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }

bool operator== | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 511 of file qbytearray.h.

    { return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }

bool operator== | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 513 of file qbytearray.h.

    { return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }

bool operator!= | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Examples:
  PtexExtractor/ptex/PtexDict.h, PtexExtractor/ptex/PtexHashMap.h, PtexExtractor/ptex/Ptexture.h, PtexImporter/ptex/PtexDict.h, PtexImporter/ptex/PtexHashMap.h, and PtexImporter/ptex/Ptexture.h.

Definition at line 515 of file qbytearray.h.

    { return !(a1==a2); }

bool operator!= | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 517 of file qbytearray.h.

    { return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }

bool operator!= | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 519 of file qbytearray.h.

    { return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }

bool operator< | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 521 of file qbytearray.h.

    { return qstrcmp(a1, a2) < 0; }

bool operator< | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 523 of file qbytearray.h.

    { return qstrcmp(a1, a2) < 0; }

bool operator< | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 525 of file qbytearray.h.

    { return qstrcmp(a1, a2) < 0; }

bool operator<= | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 527 of file qbytearray.h.

    { return qstrcmp(a1, a2) <= 0; }

bool operator<= | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 529 of file qbytearray.h.

    { return qstrcmp(a1, a2) <= 0; }

bool operator<= | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 531 of file qbytearray.h.

    { return qstrcmp(a1, a2) <= 0; }

bool operator> | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 533 of file qbytearray.h.

    { return qstrcmp(a1, a2) > 0; }

bool operator> | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 535 of file qbytearray.h.

    { return qstrcmp(a1, a2) > 0; }

bool operator> | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 537 of file qbytearray.h.

    { return qstrcmp(a1, a2) > 0; }

bool operator>= | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Examples:
  PtexExtractor/ptex/Ptexture.h, and PtexImporter/ptex/Ptexture.h.

Definition at line 539 of file qbytearray.h.

    { return qstrcmp(a1, a2) >= 0; }

bool operator>= | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 541 of file qbytearray.h.

    { return qstrcmp(a1, a2) >= 0; }

bool operator>= | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 543 of file qbytearray.h.

    { return qstrcmp(a1, a2) >= 0; }

const QByteArray operator+ | ( | const QByteArray & | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 545 of file qbytearray.h.

    { return QByteArray(a1) += a2; }

const QByteArray operator+ | ( | const QByteArray & | a1,
|  | const char * | a2
| ) |  | `[inline]`

Definition at line 547 of file qbytearray.h.

    { return QByteArray(a1) += a2; }

const QByteArray operator+ | ( | const QByteArray & | a1,
|  | char | a2
| ) |  | `[inline]`

Definition at line 549 of file qbytearray.h.

    { return QByteArray(a1) += a2; }

const QByteArray operator+ | ( | const char * | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 551 of file qbytearray.h.

    { return QByteArray(a1) += a2; }

const QByteArray operator+ | ( | char | a1,
|  | const QByteArray & | a2
| ) |  | `[inline]`

Definition at line 553 of file qbytearray.h.

    { return QByteArray(&a1, 1) += a2; }

Q_CORE_EXPORT QDataStream& operator<< | ( | QDataStream & | ,
|  | const QByteArray & |
| ) |  |

Q_CORE_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QByteArray & |
| ) |  |

Q_CORE_EXPORT QByteArray qCompress | ( | const uchar * | data,
|  | int | nbytes,
|  | int | compressionLevel = `-1`
| ) |  |

Search for all occurrences

Q_CORE_EXPORT QByteArray qUncompress | ( | const uchar * | data,
|  | int | nbytes
| ) |  |

Search for all occurrences

QByteArray qCompress | ( | const QByteArray & | data,
|  | int | compressionLevel = `-1`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 584 of file qbytearray.h.

    { return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }

QByteArray qUncompress | ( | const QByteArray & | data | ) | `[inline]`

Search for all occurrences

Definition at line 586 of file qbytearray.h.

    { return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }

Q_DECLARE_TYPEINFO | ( | QByteArray | ,
|  | Q_MOVABLE_TYPE |
| ) |  |

Search for all occurrences