From 34ab65aa57c19f1c445fddc238e4ccf439618325 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 31 Jul 2015 23:59:22 +0900 Subject: [PATCH] MP4: Hide an internal function from the public header. --- taglib/mp4/mp4file.cpp | 35 ++++++++++++++++++++--------------- taglib/mp4/mp4file.h | 2 -- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/taglib/mp4/mp4file.cpp b/taglib/mp4/mp4file.cpp index 84055c11..1fc1524f 100644 --- a/taglib/mp4/mp4file.cpp +++ b/taglib/mp4/mp4file.cpp @@ -32,6 +32,23 @@ using namespace TagLib; +namespace +{ + bool checkValid(const MP4::AtomList &list) + { + for(MP4::AtomList::ConstIterator it = list.begin(); it != list.end(); ++it) { + + if((*it)->length == 0) + return false; + + if(!checkValid((*it)->children)) + return false; + } + + return true; + } +} + class MP4::File::FilePrivate { public: @@ -47,8 +64,8 @@ public: delete properties; } - MP4::Tag *tag; - MP4::Atoms *atoms; + MP4::Tag *tag; + MP4::Atoms *atoms; MP4::Properties *properties; }; @@ -100,18 +117,6 @@ MP4::File::audioProperties() const return d->properties; } -bool -MP4::File::checkValid(const MP4::AtomList &list) -{ - for(uint i = 0; i < list.size(); i++) { - if(list[i]->length == 0) - return false; - if(!checkValid(list[i]->children)) - return false; - } - return true; -} - void MP4::File::read(bool readProperties) { @@ -119,7 +124,7 @@ MP4::File::read(bool readProperties) return; d->atoms = new Atoms(this); - if (!checkValid(d->atoms->atoms)) { + if(!checkValid(d->atoms->atoms)) { setValid(false); return; } diff --git a/taglib/mp4/mp4file.h b/taglib/mp4/mp4file.h index 0d615216..28880f84 100644 --- a/taglib/mp4/mp4file.h +++ b/taglib/mp4/mp4file.h @@ -115,9 +115,7 @@ namespace TagLib { bool save(); private: - void read(bool readProperties); - bool checkValid(const MP4::AtomList &list); class FilePrivate; FilePrivate *d;