26 #ifndef TAGLIB_BYTEVECTOR_H 27 #define TAGLIB_BYTEVECTOR_H 48 #ifndef DO_NOT_DOCUMENT 49 using Iterator = std::vector<char>::iterator;
50 using ConstIterator = std::vector<char>::const_iterator;
51 using ReverseIterator = std::vector<char>::reverse_iterator;
52 using ConstReverseIterator = std::vector<char>::const_reverse_iterator;
84 ByteVector(
const char *data,
unsigned int length);
103 ByteVector &setData(
const char *s,
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;
246 ConstIterator cbegin()
const;
256 ConstIterator end()
const;
261 ConstIterator cend()
const;
266 ReverseIterator rbegin();
271 ConstReverseIterator rbegin()
const;
276 ReverseIterator rend();
281 ConstReverseIterator rend()
const;
288 bool isEmpty()
const;
300 unsigned int toUInt(
bool mostSignificantByteFirst =
true)
const;
312 unsigned int toUInt(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
325 unsigned int toUInt(
unsigned int offset,
unsigned int length,
326 bool mostSignificantByteFirst =
true)
const;
337 short toShort(
bool mostSignificantByteFirst =
true)
const;
348 short toShort(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
359 unsigned short toUShort(
bool mostSignificantByteFirst =
true)
const;
370 unsigned short toUShort(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
382 long long toLongLong(
bool mostSignificantByteFirst =
true)
const;
394 long long toLongLong(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
406 unsigned long long toULongLong(
bool mostSignificantByteFirst =
true)
const;
418 unsigned long long toULongLong(
unsigned int offset,
bool mostSignificantByteFirst =
true)
const;
426 float toFloat32LE(
size_t offset)
const;
434 float toFloat32BE(
size_t offset)
const;
442 double toFloat64LE(
size_t offset)
const;
450 double toFloat64BE(
size_t offset)
const;
458 long double toFloat80LE(
size_t offset)
const;
466 long double toFloat80BE(
size_t offset)
const;
487 static ByteVector fromShort(
short value,
bool mostSignificantByteFirst =
true);
497 static ByteVector fromUShort(
unsigned short value,
bool mostSignificantByteFirst =
true);
508 static ByteVector fromLongLong(
long long value,
bool mostSignificantByteFirst =
true);
519 static ByteVector fromULongLong(
unsigned long long value,
bool mostSignificantByteFirst =
true);
543 static ByteVector fromFloat64LE(
double value);
551 static ByteVector fromFloat64BE(
double value);
556 static ByteVector fromCString(
const char *s,
unsigned int length = 0xffffffff);
561 const char &operator[](
int index)
const;
566 char &operator[](
int index);
582 bool operator==(
const char *s)
const;
588 bool operator!=(
const char *s)
const;
657 class ByteVectorPrivate;
659 std::unique_ptr<ByteVectorPrivate> d;
TAGLIB_EXPORT std::ostream & operator<<(std::ostream &s, const TagLib::ByteVector &v)
A byte vector.
Definition: tbytevector.h:45
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
TAGLIB_EXPORT ByteVector fromUInt(unsigned int value)
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
TAGLIB_EXPORT unsigned int toUInt(const ByteVector &data)
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41