void MPC::Properties::read()
{
- if(d->data.mid(0, 3) != "MP+")
+ if(!d->data.startsWith("MP+"))
return;
d->version = d->data[3] & 15;
ByteVector data = d->file->readBlock(128);
// some initial sanity checking
- if(data.size() == 128 && data.mid(0, 3) == "TAG")
+ if(data.size() == 128 && data.startsWith("TAG"))
parse(data);
else
debug("ID3v1 tag is not valid or could not be read at the specified offset.");
{
// Check to see if a valid Xing header is available.
- if(data.mid(0, 4) != "Xing")
+ if(!data.startsWith("Xing"))
return;
// If the XingHeader doesn't contain the number of frames and the total stream
// Sanity check -- make sure that we were in fact able to read as much data as
// we asked for and that the page begins with "OggS".
- if(data.size() != 27 || data.mid(0, 4) != "OggS") {
+ if(data.size() != 27 || !data.startsWith("OggS")) {
debug("Ogg::PageHeader::read() -- error reading page header");
return;
}