26 #ifndef TAGLIB_BYTEVECTOR_H
27 #define TAGLIB_BYTEVECTOR_H
48 #ifndef DO_NOT_DOCUMENT
49 typedef std::vector<char>::iterator Iterator;
50 typedef std::vector<char>::const_iterator ConstIterator;
51 typedef std::vector<char>::reverse_iterator ReverseIterator;
52 typedef std::vector<char>::const_reverse_iterator ConstReverseIterator;
84 ByteVector(
const char *data,
unsigned int length);
103 ByteVector &setData(
const char *data,
unsigned int length);
123 const char *data()
const;
130 ByteVector mid(
unsigned int index,
unsigned int length = 0xffffffff)
const;
136 char at(
unsigned int index)
const;
144 int find(
const ByteVector &pattern,
unsigned int offset = 0,
int byteAlign = 1)
const;
152 int find(
char c,
unsigned int offset = 0,
int byteAlign = 1)
const;
160 int rfind(
const ByteVector &pattern,
unsigned int offset = 0,
int byteAlign = 1)
const;
169 bool containsAt(
const ByteVector &pattern,
unsigned int offset,
170 unsigned int patternOffset = 0,
unsigned int patternLength = 0xffffffff)
const;
175 bool startsWith(
const ByteVector &pattern)
const;
180 bool endsWith(
const ByteVector &pattern)
const;
186 ByteVector &replace(
char oldByte,
char newByte);
204 int endsWithPartialMatch(
const ByteVector &pattern)
const;
224 unsigned int size()
const;
231 ByteVector &resize(
unsigned int size,
char padding = 0);
241 ConstIterator begin()
const;
251 ConstIterator end()
const;
256 ReverseIterator rbegin();
261 ConstReverseIterator rbegin()
const;
266 ReverseIterator rend();
271 ConstReverseIterator rend()
const;
292 bool isEmpty()
const;
300 unsigned int checksum()
const;
312 unsigned int toUInt(
bool mostSignificantByteFirst =
true)
const;
324 unsigned int toUInt(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
337 unsigned int toUInt(
unsigned int offset,
unsigned int length,
338 bool mostSignificantByteFirst =
true)
const;
349 short toShort(
bool mostSignificantByteFirst =
true)
const;
360 short toShort(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
371 unsigned short toUShort(
bool mostSignificantByteFirst =
true)
const;
382 unsigned short toUShort(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
394 long long toLongLong(
bool mostSignificantByteFirst =
true)
const;
406 long long toLongLong(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
412 float toFloat32LE(
size_t offset)
const;
418 float toFloat32BE(
size_t offset)
const;
424 double toFloat64LE(
size_t offset)
const;
430 double toFloat64BE(
size_t offset)
const;
438 long double toFloat80LE(
size_t offset)
const;
446 long double toFloat80BE(
size_t offset)
const;
467 static ByteVector fromShort(
short value,
bool mostSignificantByteFirst =
true);
478 static ByteVector fromLongLong(
long long value,
bool mostSignificantByteFirst =
true);
502 static ByteVector fromFloat64LE(
double value);
510 static ByteVector fromFloat64BE(
double value);
515 static ByteVector fromCString(
const char *s,
unsigned int length = 0xffffffff);
520 const char &operator[](
int index)
const;
525 char &operator[](
int index);
541 bool operator==(
const char *s)
const;
547 bool operator!=(
const char *s)
const;
624 class ByteVectorPrivate;
625 ByteVectorPrivate *d;