From: Tsuda Kageyu Date: Sun, 23 Aug 2015 09:21:51 +0000 (+0900) Subject: Revert "Remove some private data members not needed to carry." X-Git-Tag: v1.10beta~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9f898698dd95d9a410ac45e7b7a2e9483dc327b;p=taglib Revert "Remove some private data members not needed to carry." This reverts commit 7c17d32b3a8bc3ed718af3790452fec33ebd307b. --- diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index 00934dbb..e0c2a24e 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -46,7 +46,14 @@ using namespace APE; class APE::Tag::TagPrivate { public: + TagPrivate() : file(0), footerLocation(-1), tagLength(0) {} + + TagLib::File *file; + long footerLocation; + long tagLength; + Footer footer; + ItemListMap itemListMap; }; @@ -54,17 +61,18 @@ public: // public methods //////////////////////////////////////////////////////////////////////////////// -APE::Tag::Tag() : - TagLib::Tag(), - d(new TagPrivate()) +APE::Tag::Tag() : TagLib::Tag() { + d = new TagPrivate; } -APE::Tag::Tag(TagLib::File *file, long footerLocation) : - TagLib::Tag(), - d(new TagPrivate()) +APE::Tag::Tag(TagLib::File *file, long footerLocation) : TagLib::Tag() { - read(file, footerLocation); + d = new TagPrivate; + d->file = file; + d->footerLocation = footerLocation; + + read(); } APE::Tag::~Tag() @@ -319,19 +327,19 @@ bool APE::Tag::isEmpty() const // protected methods //////////////////////////////////////////////////////////////////////////////// -void APE::Tag::read(TagLib::File *file, long footerLocation) +void APE::Tag::read() { - if(file && file->isValid()) { + if(d->file && d->file->isValid()) { - file->seek(footerLocation); - d->footer.setData(file->readBlock(Footer::size())); + d->file->seek(d->footerLocation); + d->footer.setData(d->file->readBlock(Footer::size())); if(d->footer.tagSize() <= Footer::size() || - d->footer.tagSize() > uint(file->length())) + d->footer.tagSize() > uint(d->file->length())) return; - file->seek(footerLocation + Footer::size() - d->footer.tagSize()); - parse(file->readBlock(d->footer.tagSize() - Footer::size())); + d->file->seek(d->footerLocation + Footer::size() - d->footer.tagSize()); + parse(d->file->readBlock(d->footer.tagSize() - Footer::size())); } } diff --git a/taglib/ape/apetag.h b/taglib/ape/apetag.h index 6c9999cf..55572612 100644 --- a/taglib/ape/apetag.h +++ b/taglib/ape/apetag.h @@ -188,7 +188,7 @@ namespace TagLib { /*! * Reads from the file specified in the constructor. */ - void read(TagLib::File *file, long footerLocation); + void read(); /*! * Parses the body of the tag in \a data.