TagLib::ByteVector Class Reference

A byte vector. More...

`#include <tbytevector.h>`

## Public Member Functions

| ByteVector ()
| ByteVector (unsigned int size, char value=0)
| ByteVector (const ByteVector &v)
| ByteVector (const ByteVector &v, unsigned int offset, unsigned int length)
| ByteVector (char c)
| ByteVector (const char *data, unsigned int length)
| ByteVector (const char *data)
| ~ByteVector ()
ByteVector & | setData (const char *s, unsigned int length)
ByteVector & | setData (const char *data)
char * | data ()
const char * | data () const
ByteVector | mid (unsigned int index, unsigned int length=0xffffffff) const
char | at (unsigned int index) const
int | find (const ByteVector &pattern, unsigned int offset=0, int byteAlign=1) const
int | find (char c, unsigned int offset=0, int byteAlign=1) const
int | rfind (const ByteVector &pattern, unsigned int offset=0, int byteAlign=1) const
bool | containsAt (const ByteVector &pattern, unsigned int offset, unsigned int patternOffset=0, unsigned int patternLength=0xffffffff) const
bool | startsWith (const ByteVector &pattern) const
bool | endsWith (const ByteVector &pattern) const
ByteVector & | replace (char oldByte, char newByte)
ByteVector & | replace (const ByteVector &pattern, const ByteVector &with)
int | endsWithPartialMatch (const ByteVector &pattern) const
ByteVector & | append (const ByteVector &v)
ByteVector & | append (char c)
ByteVector & | clear ()
unsigned int | size () const
ByteVector & | resize (unsigned int size, char padding=0)
Iterator | begin ()
ConstIterator | begin () const
ConstIterator | cbegin () const
Iterator | end ()
ConstIterator | end () const
ConstIterator | cend () const
ReverseIterator | rbegin ()
ConstReverseIterator | rbegin () const
ReverseIterator | rend ()
ConstReverseIterator | rend () const
bool | isEmpty () const
unsigned int | toUInt (bool mostSignificantByteFirst=true) const
unsigned int | toUInt (unsigned int offset, bool mostSignificantByteFirst=true) const
unsigned int | toUInt (unsigned int offset, unsigned int length, bool mostSignificantByteFirst=true) const
short | toShort (bool mostSignificantByteFirst=true) const
short | toShort (unsigned int offset, bool mostSignificantByteFirst=true) const
unsigned short | toUShort (bool mostSignificantByteFirst=true) const
unsigned short | toUShort (unsigned int offset, bool mostSignificantByteFirst=true) const
long long | toLongLong (bool mostSignificantByteFirst=true) const
long long | toLongLong (unsigned int offset, bool mostSignificantByteFirst=true) const
unsigned long long | toULongLong (bool mostSignificantByteFirst=true) const
unsigned long long | toULongLong (unsigned int offset, bool mostSignificantByteFirst=true) const
float | toFloat32LE (size_t offset) const
float | toFloat32BE (size_t offset) const
double | toFloat64LE (size_t offset) const
double | toFloat64BE (size_t offset) const
long double | toFloat80LE (size_t offset) const
long double | toFloat80BE (size_t offset) const
const char & | operator[] (int index) const
char & | operator[] (int index)
bool | operator== (const ByteVector &v) const
bool | operator!= (const ByteVector &v) const
bool | operator== (const char *s) const
bool | operator!= (const char *s) const
bool | operator< (const ByteVector &v) const
bool | operator> (const ByteVector &v) const
ByteVector | operator+ (const ByteVector &v) const
ByteVector & | operator= (const ByteVector &v)
ByteVector & | operator= (char c)
ByteVector & | operator= (const char *data)
void | swap (ByteVector &v) noexcept
ByteVector | toHex () const
ByteVector | toBase64 () const

## Static Public Member Functions

static ByteVector | fromUInt (unsigned int value, bool mostSignificantByteFirst=true)
static ByteVector | fromShort (short value, bool mostSignificantByteFirst=true)
static ByteVector | fromUShort (unsigned short value, bool mostSignificantByteFirst=true)
static ByteVector | fromLongLong (long long value, bool mostSignificantByteFirst=true)
static ByteVector | fromULongLong (unsigned long long value, bool mostSignificantByteFirst=true)
static ByteVector | fromFloat32LE (float value)
static ByteVector | fromFloat32BE (float value)
static ByteVector | fromFloat64LE (double value)
static ByteVector | fromFloat64BE (double value)
static ByteVector | fromCString (const char *s, unsigned int length=0xffffffff)
static ByteVector | fromBase64 (const ByteVector &)

## Protected Member Functions

void | detach ()

## Related Symbols

(Note that these are not member symbols.)
TAGLIB_EXPORT std::ostream & | operator<< (std::ostream &s, const TagLib::ByteVector &v)

## Detailed Description

A byte vector.

This class provides an implicitly shared byte vector with some methods that are useful for tagging purposes. Many of the search functions are tailored to what is useful for finding tag related patterns in a data array.

## Constructor & Destructor Documentation

## ByteVector() [1/7]

TagLib::ByteVector::ByteVector | ( |  | ) |

Constructs an empty byte vector.

Referenced by append(), append(), ByteVector(), ByteVector(), clear(), containsAt(), endsWith(), endsWithPartialMatch(), find(), fromBase64(), fromCString(), fromFloat32BE(), fromFloat32LE(), fromFloat64BE(), fromFloat64LE(), fromLongLong(), fromShort(), fromUInt(), fromULongLong(), fromUShort(), mid(), operator!=(), operator+(), operator<(), operator=(), operator=(), operator=(), operator==(), operator>(), replace(), replace(), resize(), rfind(), setData(), setData(), startsWith(), swap(), toBase64(), and toHex().

## ByteVector() [2/7]

TagLib::ByteVector::ByteVector | ( | unsigned int | size,
|  | char | value = 0 )

Construct a vector of size size with all values set to value by default.

References size().

## ByteVector() [3/7]

TagLib::ByteVector::ByteVector | ( | const ByteVector & | v | ) |

Constructs a byte vector that is a copy of v.

References ByteVector().

## ByteVector() [4/7]

TagLib::ByteVector::ByteVector | ( | const ByteVector & | v,
|  | unsigned int | offset,
|  | unsigned int | length )

Constructs a byte vector that is a copy of v.

References ByteVector().

## ByteVector() [5/7]

TagLib::ByteVector::ByteVector | ( | char | c | ) |

Constructs a byte vector that contains c.

## ByteVector() [6/7]

TagLib::ByteVector::ByteVector | ( | const char * | data,
|  | unsigned int | length )

Constructs a byte vector that copies data for up to length bytes.

References data().

## ByteVector() [7/7]

TagLib::ByteVector::ByteVector | ( | const char * | data | ) |

Constructs a byte vector that copies data up to the first null byte. This is particularly useful for constructing byte arrays from string constants.

Warning
  The behavior is undefined if data is not null terminated.

References data().

## ~ByteVector()

TagLib::ByteVector::~ByteVector | ( |  | ) |

Destroys this ByteVector instance.

## Member Function Documentation

## append() [1/2]

ByteVector & TagLib::ByteVector::append | ( | char | c | ) |

Appends c to the end of the ByteVector.

References ByteVector().

## append() [2/2]

ByteVector & TagLib::ByteVector::append | ( | const ByteVector & | v | ) |

Appends v to the end of the ByteVector.

References ByteVector().

## at()

char TagLib::ByteVector::at | ( | unsigned int | index | ) | const

This essentially performs the same as operator[](), but instead of causing a runtime error if the index is out of bounds, it will return a null byte.

## begin() [1/2]

Iterator TagLib::ByteVector::begin | ( |  | ) |

Returns an Iterator that points to the front of the vector.

## begin() [2/2]

ConstIterator TagLib::ByteVector::begin | ( |  | ) | const

Returns a ConstIterator that points to the front of the vector.

## cbegin()

ConstIterator TagLib::ByteVector::cbegin | ( |  | ) | const

Returns a ConstIterator that points to the front of the vector.

## cend()

ConstIterator TagLib::ByteVector::cend | ( |  | ) | const

Returns a ConstIterator that points to the back of the vector.

## clear()

ByteVector & TagLib::ByteVector::clear | ( |  | ) |

Clears the data.

References ByteVector().

## containsAt()

bool TagLib::ByteVector::containsAt | ( | const ByteVector & | pattern,
|  | unsigned int | offset,
|  | unsigned int | patternOffset = 0,
|  | unsigned int | patternLength = 0xffffffff ) const

Checks to see if the vector contains the pattern starting at position offset. Optionally, if you only want to search for part of the pattern you can specify an offset within the pattern to start from. Also, you can specify to only check for the first patternLength bytes of pattern with the patternLength argument.

References ByteVector().

## data() [1/2]

char * TagLib::ByteVector::data | ( |  | ) |

Returns a pointer to the internal data structure.

Warning
  Care should be taken when modifying this data structure as it is easy to corrupt the ByteVector when doing so. Specifically, while the data may be changed, its length may not be.

Referenced by ByteVector(), ByteVector(), operator=(), and setData().

## data() [2/2]

const char * TagLib::ByteVector::data | ( |  | ) | const

Returns a pointer to the internal data structure which may not be modified.

## detach()

void TagLib::ByteVector::detach | ( |  | ) |

protected

If this ByteVector is being shared via implicit sharing, do a deep copy of the data and separate from the shared members. This should be called by all non-const subclass members.

References TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE.

## end() [1/2]

Iterator TagLib::ByteVector::end | ( |  | ) |

Returns an Iterator that points to the back of the vector.

## end() [2/2]

ConstIterator TagLib::ByteVector::end | ( |  | ) | const

Returns a ConstIterator that points to the back of the vector.

## endsWith()

bool TagLib::ByteVector::endsWith | ( | const ByteVector & | pattern | ) | const

Returns `true` if the vector ends with pattern.

References ByteVector().

## endsWithPartialMatch()

int TagLib::ByteVector::endsWithPartialMatch | ( | const ByteVector & | pattern | ) | const

Checks for a partial match of pattern at the end of the vector. It returns the offset of the partial match within the vector, or -1 if the pattern is not found. This method is particularly useful when searching for patterns that start in one vector and end in another. When combined with startsWith() it can be used to find a pattern that overlaps two buffers.

Note
  This will not match the complete pattern at the end of the string; use endsWith() for that.

References ByteVector().

## find() [1/2]

int TagLib::ByteVector::find | ( | char | c,
|  | unsigned int | offset = 0,
|  | int | byteAlign = 1 ) const

Searches the char for c starting at offset and returns the offset. Returns -1 if the pattern was not found. If byteAlign is specified the pattern will only be matched if it starts on a byte divisible by byteAlign (starting from offset).

## find() [2/2]

int TagLib::ByteVector::find | ( | const ByteVector & | pattern,
|  | unsigned int | offset = 0,
|  | int | byteAlign = 1 ) const

Searches the ByteVector for pattern starting at offset and returns the offset. Returns -1 if the pattern was not found. If byteAlign is specified the pattern will only be matched if it starts on a byte divisible by byteAlign (starting from offset).

References ByteVector().

## fromBase64()

ByteVector TagLib::ByteVector::fromBase64 | ( | const ByteVector & |  | ) |

static

Decodes the base64 encoded byte vector.

See also
  toBase64()

References ByteVector().

## fromCString()

ByteVector TagLib::ByteVector::fromCString | ( | const char * | s,
|  | unsigned int | length = 0xffffffff )

static

Returns a ByteVector based on the CString s.

References ByteVector().

## fromFloat32BE()

ByteVector TagLib::ByteVector::fromFloat32BE | ( | float | value | ) |

static

Creates a 4 byte ByteVector based on value as an IEEE754 32-bit big-endian floating point number.

See also
  toFloat32BE()

References ByteVector().

## fromFloat32LE()

ByteVector TagLib::ByteVector::fromFloat32LE | ( | float | value | ) |

static

Creates a 4 byte ByteVector based on value as an IEEE754 32-bit little-endian floating point number.

See also
  toFloat32LE()

References ByteVector().

## fromFloat64BE()

ByteVector TagLib::ByteVector::fromFloat64BE | ( | double | value | ) |

static

Creates an 8 byte ByteVector based on value as an IEEE754 64-bit big-endian floating point number.

See also
  toFloat64BE()

References ByteVector().

## fromFloat64LE()

ByteVector TagLib::ByteVector::fromFloat64LE | ( | double | value | ) |

static

Creates an 8 byte ByteVector based on value as an IEEE754 64-bit little-endian floating point number.

See also
  toFloat64LE()

References ByteVector().

## fromLongLong()

ByteVector TagLib::ByteVector::fromLongLong | ( | long long | value,
|  | bool | mostSignificantByteFirst = true )

static

Creates an 8 byte ByteVector based on value. If mostSignificantByteFirst is `true`, then this will operate left to right in building the ByteVector. For example if mostSignificantByteFirst is `true` then $00 00 00 01 == 0x0000000000000001 == 1, if `false`, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.

See also
  toLongLong()

References ByteVector().

## fromShort()

ByteVector TagLib::ByteVector::fromShort | ( | short | value,
|  | bool | mostSignificantByteFirst = true )

static

Creates a 2 byte ByteVector based on value. If mostSignificantByteFirst is `true`, then this will operate left to right in building the ByteVector. For example if mostSignificantByteFirst is `true` then $00 01 == 0x0001 == 1, if `false`, $01 00 == 0x0100 == 1.

See also
  toShort()

References ByteVector().

## fromUInt()

ByteVector TagLib::ByteVector::fromUInt | ( | unsigned int | value,
|  | bool | mostSignificantByteFirst = true )

static

Creates a 4 byte ByteVector based on value. If mostSignificantByteFirst is `true`, then this will operate left to right in building the ByteVector. For example if mostSignificantByteFirst is `true` then $00 00 00 01 == 0x00000001 == 1, if `false`, $01 00 00 00 == 0x01000000 == 1.

See also
  toUInt()

References ByteVector().

## fromULongLong()

ByteVector TagLib::ByteVector::fromULongLong | ( | unsigned long long | value,
|  | bool | mostSignificantByteFirst = true )

static

Creates an 8 byte ByteVector based on value. If mostSignificantByteFirst is `true`, then this will operate left to right in building the ByteVector. For example if mostSignificantByteFirst is `true` then $00 00 00 01 == 0x0000000000000001 == 1, if `false`, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.

See also
  toULongLong()

References ByteVector().

## fromUShort()

ByteVector TagLib::ByteVector::fromUShort | ( | unsigned short | value,
|  | bool | mostSignificantByteFirst = true )

static

Creates a 2 byte ByteVector based on value. If mostSignificantByteFirst is `true`, then this will operate left to right in building the ByteVector. For example if mostSignificantByteFirst is `true` then $00 01 == 0x0001 == 1, if `false`, $01 00 == 0x0100 == 1.

See also
  toUShort()

References ByteVector().

## isEmpty()

bool TagLib::ByteVector::isEmpty | ( |  | ) | const

Returns `true` if the ByteVector is empty.

See also
  size()

## mid()

ByteVector TagLib::ByteVector::mid | ( | unsigned int | index,
|  | unsigned int | length = 0xffffffff ) const

Returns a byte vector made up of the bytes starting at index and for length bytes. If length is not specified it will return the bytes from index to the end of the vector.

References ByteVector().

## operator!=() [1/2]

bool TagLib::ByteVector::operator!= | ( | const ByteVector & | v | ) | const

Returns `true` if this ByteVector and v are not equal.

References ByteVector().

## operator!=() [2/2]

bool TagLib::ByteVector::operator!= | ( | const char * | s | ) | const

Returns `true` if this ByteVector and the null terminated C string s do not contain the same data.

## operator+()

ByteVector TagLib::ByteVector::operator+ | ( | const ByteVector & | v | ) | const

Returns a vector that is v appended to this vector.

References ByteVector().

## operator<()

bool TagLib::ByteVector::operator< | ( | const ByteVector & | v | ) | const

Returns `true` if this ByteVector is less than v. The value of the vectors is determined by evaluating the character from left to right, and in the event one vector is a superset of the other, the size is used.

References ByteVector().

## operator=() [1/3]

ByteVector & TagLib::ByteVector::operator= | ( | char | c | ) |

Copies a byte c.

References ByteVector().

## operator=() [2/3]

ByteVector & TagLib::ByteVector::operator= | ( | const ByteVector & | v | ) |

Copies ByteVector v.

References ByteVector().

## operator=() [3/3]

ByteVector & TagLib::ByteVector::operator= | ( | const char * | data | ) |

Copies data up to the first null byte.

Warning
  The behavior is undefined if data is not null terminated.

References ByteVector(), and data().

## operator==() [1/2]

bool TagLib::ByteVector::operator== | ( | const ByteVector & | v | ) | const

Returns `true` if this ByteVector and v are equal.

References ByteVector().

## operator==() [2/2]

bool TagLib::ByteVector::operator== | ( | const char * | s | ) | const

Returns `true` if this ByteVector and the null terminated C string s contain the same data.

## operator>()

bool TagLib::ByteVector::operator> | ( | const ByteVector & | v | ) | const

Returns `true` if this ByteVector is greater than v.

References ByteVector().

## operator[]() [1/2]

char & TagLib::ByteVector::operator[] | ( | int | index | ) |

Returns a reference to the byte at index.

## operator[]() [2/2]

const char & TagLib::ByteVector::operator[] | ( | int | index | ) | const

Returns a const reference to the byte at index.

## rbegin() [1/2]

ReverseIterator TagLib::ByteVector::rbegin | ( |  | ) |

Returns a ReverseIterator that points to the front of the vector.

## rbegin() [2/2]

ConstReverseIterator TagLib::ByteVector::rbegin | ( |  | ) | const

Returns a ConstReverseIterator that points to the front of the vector.

## rend() [1/2]

ReverseIterator TagLib::ByteVector::rend | ( |  | ) |

Returns a ReverseIterator that points to the back of the vector.

## rend() [2/2]

ConstReverseIterator TagLib::ByteVector::rend | ( |  | ) | const

Returns a ConstReverseIterator that points to the back of the vector.

## replace() [1/2]

ByteVector & TagLib::ByteVector::replace | ( | char | oldByte,
|  | char | newByte )

Replaces oldByte with newByte and returns a reference to the ByteVector after the operation. This does modify the vector.

References ByteVector().

## replace() [2/2]

ByteVector & TagLib::ByteVector::replace | ( | const ByteVector & | pattern,
|  | const ByteVector & | with )

Replaces pattern with with and returns a reference to the ByteVector after the operation. This does modify the vector.

References ByteVector().

## resize()

ByteVector & TagLib::ByteVector::resize | ( | unsigned int | size,
|  | char | padding = 0 )

Resize the vector to size. If the vector is currently less than size, pad the remaining spaces with padding. Returns a reference to the resized vector.

References ByteVector(), and size().

## rfind()

int TagLib::ByteVector::rfind | ( | const ByteVector & | pattern,
|  | unsigned int | offset = 0,
|  | int | byteAlign = 1 ) const

Searches the ByteVector for pattern starting from either the end of the vector or offset and returns the offset. Returns -1 if the pattern was not found. If byteAlign is specified the pattern will only be matched if it starts on a byte divisible by byteAlign (starting from offset).

References ByteVector().

## setData() [1/2]

ByteVector & TagLib::ByteVector::setData | ( | const char * | data | ) |

Sets the data for the byte array copies data up to the first null byte. The behavior is undefined if data is not null terminated.

References ByteVector(), and data().

## setData() [2/2]

ByteVector & TagLib::ByteVector::setData | ( | const char * | s,
|  | unsigned int | length )

Sets the data for the byte array using the first length bytes of s

References ByteVector().

## size()

unsigned int TagLib::ByteVector::size | ( |  | ) | const

Returns the size of the array.

Referenced by ByteVector(), and resize().

## startsWith()

bool TagLib::ByteVector::startsWith | ( | const ByteVector & | pattern | ) | const

Returns `true` if the vector starts with pattern.

References ByteVector().

## swap()

void TagLib::ByteVector::swap | ( | ByteVector & | v | ) |

noexcept

Exchanges the content of the ByteVector with the content of v.

References ByteVector().

## toBase64()

ByteVector TagLib::ByteVector::toBase64 | ( |  | ) | const

Returns a base64 encoded copy of the byte vector

See also
  fromBase64()

References ByteVector().

## toFloat32BE()

float TagLib::ByteVector::toFloat32BE | ( | size_t | offset | ) | const

Converts the 4 bytes at offset of the vector to a float as an IEEE754 32-bit big-endian floating point number.

See also
  fromFloat32BE()

## toFloat32LE()

float TagLib::ByteVector::toFloat32LE | ( | size_t | offset | ) | const

Converts the 4 bytes at offset of the vector to a float as an IEEE754 32-bit little-endian floating point number.

See also
  fromFloat32LE()

## toFloat64BE()

double TagLib::ByteVector::toFloat64BE | ( | size_t | offset | ) | const

Converts the 8 bytes at offset of the vector to a double as an IEEE754 64-bit big-endian floating point number.

See also
  fromFloat64BE()

## toFloat64LE()

double TagLib::ByteVector::toFloat64LE | ( | size_t | offset | ) | const

Converts the 8 bytes at offset of the vector to a double as an IEEE754 64-bit little-endian floating point number.

See also
  fromFloat64LE()

## toFloat80BE()

long double TagLib::ByteVector::toFloat80BE | ( | size_t | offset | ) | const

Converts the 10 bytes at offset of the vector to a long double as an IEEE754 80-bit big-endian floating point number.

Note
  This may compromise the precision depending on the size of long double.

## toFloat80LE()

long double TagLib::ByteVector::toFloat80LE | ( | size_t | offset | ) | const

Converts the 10 bytes at offset of the vector to a long double as an IEEE754 80-bit little-endian floating point number.

Note
  This may compromise the precision depending on the size of long double.

## toHex()

ByteVector TagLib::ByteVector::toHex | ( |  | ) | const

Returns a hex-encoded copy of the byte vector.

References ByteVector().

## toLongLong() [1/2]

long long TagLib::ByteVector::toLongLong | ( | bool | mostSignificantByteFirst = true | ) | const

Converts the first 8 bytes of the vector to a (signed) long long.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, if `false`, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.

See also
  fromLongLong()

## toLongLong() [2/2]

long long TagLib::ByteVector::toLongLong | ( | unsigned int | offset,
|  | bool | mostSignificantByteFirst = true ) const

Converts the 8 bytes at offset of the vector to a (signed) long long.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, if `false`, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.

See also
  fromLongLong()

## toShort() [1/2]

short TagLib::ByteVector::toShort | ( | bool | mostSignificantByteFirst = true | ) | const

Converts the first 2 bytes of the vector to a (signed) short.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $01 == 0x0001 == 1, if `false`, $01 00 == 0x01000000 == 1.

See also
  fromShort()

## toShort() [2/2]

short TagLib::ByteVector::toShort | ( | unsigned int | offset,
|  | bool | mostSignificantByteFirst = true ) const

Converts the 2 bytes at offset of the vector to a (signed) short.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $01 == 0x0001 == 1, if `false`, $01 00 == 0x01000000 == 1.

See also
  fromShort()

## toUInt() [1/3]

unsigned int TagLib::ByteVector::toUInt | ( | bool | mostSignificantByteFirst = true | ) | const

Converts the first 4 bytes of the vector to an unsigned integer.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $00 $00 $01 == 0x00000001 == 1, if `false`, $01 00 00 00 == 0x01000000 == 1.

See also
  fromUInt()

## toUInt() [2/3]

unsigned int TagLib::ByteVector::toUInt | ( | unsigned int | offset,
|  | bool | mostSignificantByteFirst = true ) const

Converts the 4 bytes at offset of the vector to an unsigned integer.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $00 $00 $01 == 0x00000001 == 1, if `false`, $01 00 00 00 == 0x01000000 == 1.

See also
  fromUInt()

## toUInt() [3/3]

unsigned int TagLib::ByteVector::toUInt | ( | unsigned int | offset,
|  | unsigned int | length,
|  | bool | mostSignificantByteFirst = true ) const

Converts the length bytes at offset of the vector to an unsigned integer. If length is larger than 4, the excess is ignored.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $00 $00 $01 == 0x00000001 == 1, if `false`, $01 00 00 00 == 0x01000000 == 1.

See also
  fromUInt()

## toULongLong() [1/2]

unsigned long long TagLib::ByteVector::toULongLong | ( | bool | mostSignificantByteFirst = true | ) | const

Converts the first 8 bytes of the vector to an unsigned long long.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, if `false`, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.

See also
  fromULongLong()

## toULongLong() [2/2]

unsigned long long TagLib::ByteVector::toULongLong | ( | unsigned int | offset,
|  | bool | mostSignificantByteFirst = true ) const

Converts the 8 bytes at offset of the vector to an unsigned long long.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, if `false`, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.

See also
  fromULongLong()

## toUShort() [1/2]

unsigned short TagLib::ByteVector::toUShort | ( | bool | mostSignificantByteFirst = true | ) | const

Converts the first 2 bytes of the vector to an unsigned short.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $01 == 0x0001 == 1, if `false`, $01 00 == 0x01000000 == 1.

See also
  fromUShort()

## toUShort() [2/2]

unsigned short TagLib::ByteVector::toUShort | ( | unsigned int | offset,
|  | bool | mostSignificantByteFirst = true ) const

Converts the 2 bytes at offset of the vector to an unsigned short.

If mostSignificantByteFirst is `true` this will operate left to right evaluating the integer. For example if mostSignificantByteFirst is `true` then $00 $01 == 0x0001 == 1, if `false`, $01 00 == 0x01000000 == 1.

See also
  fromUShort()

## Friends And Related Symbol Documentation

## operator<<()

TAGLIB_EXPORT std::ostream & operator<< | ( | std::ostream & | s,
|  | const TagLib::ByteVector & | v )

related

Streams the ByteVector v to the output stream s.

References TAGLIB_EXPORT.

The documentation for this class was generated from the following file:

- tbytevector.h