diff --git a/coding/file_container.cpp b/coding/file_container.cpp index d66d63bdba..cfe3d957fb 100644 --- a/coding/file_container.cpp +++ b/coding/file_container.cpp @@ -60,6 +60,14 @@ FilesContainerR::ReaderT FilesContainerR::GetReader(Tag const & tag) const MYTHROW(Reader::OpenException, (tag)); } +bool FilesContainerR::IsReaderExist(Tag const & tag) const +{ + InfoContainer::const_iterator i = + lower_bound(m_info.begin(), m_info.end(), tag, LessInfo()); + + return (i != m_info.end() && i->m_tag == tag); +} + ///////////////////////////////////////////////////////////////////////////// // FilesContainerW ///////////////////////////////////////////////////////////////////////////// diff --git a/coding/file_container.hpp b/coding/file_container.hpp index 30d231bc76..3b877608bf 100644 --- a/coding/file_container.hpp +++ b/coding/file_container.hpp @@ -90,6 +90,8 @@ public: ReaderT GetReader(Tag const & tag) const; + bool IsReaderExist(Tag const & tag) const; + template void ForEachTag(F f) const { for (size_t i = 0; i < m_info.size(); ++i)