]> granicus.if.org Git - taglib/commitdiff
Remove some private data members not needed to be carried.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 30 Nov 2015 03:53:52 +0000 (12:53 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 30 Nov 2015 03:53:52 +0000 (12:53 +0900)
taglib/ape/apetag.cpp
taglib/ape/apetag.h

index 170a77c858ba5e1264fd7b1aeb58cfdbca108883..71a98c18721219092b16f312d71057bc45db8967 100644 (file)
@@ -46,15 +46,7 @@ using namespace APE;
 class APE::Tag::TagPrivate
 {
 public:
-  TagPrivate() :
-    file(0),
-    footerLocation(-1) {}
-
-  TagLib::File *file;
-  long footerLocation;
-
   Footer footer;
-
   ItemListMap itemListMap;
 };
 
@@ -72,10 +64,7 @@ APE::Tag::Tag(TagLib::File *file, long footerLocation) :
   TagLib::Tag(),
   d(new TagPrivate())
 {
-  d->file = file;
-  d->footerLocation = footerLocation;
-
-  read();
+  read(file, footerLocation);
 }
 
 APE::Tag::~Tag()
@@ -330,19 +319,19 @@ bool APE::Tag::isEmpty() const
 // protected methods
 ////////////////////////////////////////////////////////////////////////////////
 
-void APE::Tag::read()
+void APE::Tag::read(TagLib::File *file, long footerLocation)
 {
-  if(d->file && d->file->isValid()) {
+  if(file && file->isValid()) {
 
-    d->file->seek(d->footerLocation);
-    d->footer.setData(d->file->readBlock(Footer::size()));
+    file->seek(footerLocation);
+    d->footer.setData(file->readBlock(Footer::size()));
 
     if(d->footer.tagSize() <= Footer::size() ||
-       d->footer.tagSize() > uint(d->file->length()))
+       d->footer.tagSize() > uint(file->length()))
       return;
 
-    d->file->seek(d->footerLocation + Footer::size() - d->footer.tagSize());
-    parse(d->file->readBlock(d->footer.tagSize() - Footer::size()));
+    file->seek(footerLocation + Footer::size() - d->footer.tagSize());
+    parse(file->readBlock(d->footer.tagSize() - Footer::size()));
   }
 }
 
index 55572612818cf672689e515565c15fa682b71378..6c9999cf24e2cb90fc03046427235b12861c93c5 100644 (file)
@@ -188,7 +188,7 @@ namespace TagLib {
       /*!
        * Reads from the file specified in the constructor.
        */
-      void read();
+      void read(TagLib::File *file, long footerLocation);
 
       /*!
        * Parses the body of the tag in \a data.