From 54cfc473464ae4102709d3b1943d568d7ac842bc Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Tue, 7 Mar 2017 21:30:05 +0000 Subject: [PATCH] class RWLock should not be in the Exiv2::Internal namespace --- include/exiv2/properties.hpp | 6 +++--- include/exiv2/rwlock.hpp | 2 -- src/properties.cpp | 16 ++++++++-------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/exiv2/properties.hpp b/include/exiv2/properties.hpp index b406ff19..3645c4e3 100644 --- a/include/exiv2/properties.hpp +++ b/include/exiv2/properties.hpp @@ -109,11 +109,11 @@ namespace Exiv2 { //! Prevent assignment: not implemented. XmpProperties& operator=(const XmpProperties& rhs); - private: + private: static const XmpNsInfo* nsInfoUnsafe(const std::string& prefix); static void unregisterNsUnsafe(const std::string& ns); static const XmpNsInfo* lookupNsRegistryUnsafe(const XmpNsInfo::Prefix& prefix); - + public: /*! @brief Return the title (label) of the property. @@ -213,7 +213,7 @@ namespace Exiv2 { @note This invalidates XMP keys generated in this namespace. */ static void unregisterNs(const std::string& ns); - static Internal::RWLock rwLock_; + static Exiv2::RWLock rwLock_; /*! @brief Unregister all custom namespaces. diff --git a/include/exiv2/rwlock.hpp b/include/exiv2/rwlock.hpp index c67c818b..3bf86db3 100644 --- a/include/exiv2/rwlock.hpp +++ b/include/exiv2/rwlock.hpp @@ -27,7 +27,6 @@ #endif namespace Exiv2 { - namespace Internal { #ifdef _MSC_VER // Visual Studio 2013 and later use SRWLOCK #if _MSC_VER >= 1800 @@ -207,7 +206,6 @@ namespace Exiv2 { private: RWLock &rwlock_; }; - } } #endif // RW_LOCK_HPP diff --git a/src/properties.cpp b/src/properties.cpp index 6cb04b26..8f8546e7 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -2488,11 +2488,11 @@ namespace Exiv2 { } XmpProperties::NsRegistry XmpProperties::nsRegistry_; - Internal::RWLock XmpProperties::rwLock_; + Exiv2::RWLock XmpProperties::rwLock_; const XmpNsInfo* XmpProperties::lookupNsRegistry(const XmpNsInfo::Prefix& prefix) { - Internal::ScopedReadLock srl(rwLock_); + ScopedReadLock srl(rwLock_); return lookupNsRegistryUnsafe(prefix); } @@ -2508,7 +2508,7 @@ namespace Exiv2 { void XmpProperties::registerNs(const std::string& ns, const std::string& prefix) { - Internal::ScopedWriteLock swl(rwLock_); + ScopedWriteLock swl(rwLock_); std::string ns2 = ns; if ( ns2.substr(ns2.size() - 1, 1) != "/" @@ -2541,7 +2541,7 @@ namespace Exiv2 { void XmpProperties::unregisterNs(const std::string& ns) { - Internal::ScopedWriteLock swl(rwLock_); + ScopedWriteLock swl(rwLock_); unregisterNsUnsafe(ns); } @@ -2557,7 +2557,7 @@ namespace Exiv2 { void XmpProperties::unregisterNs() { - Internal::ScopedWriteLock swl(rwLock_); + ScopedWriteLock swl(rwLock_); NsRegistry::iterator i = nsRegistry_.begin(); while (i != nsRegistry_.end()) { @@ -2568,7 +2568,7 @@ namespace Exiv2 { std::string XmpProperties::prefix(const std::string& ns) { - Internal::ScopedReadLock srl(rwLock_); + ScopedReadLock srl(rwLock_); std::string ns2 = ns; if ( ns2.substr(ns2.size() - 1, 1) != "/" && ns2.substr(ns2.size() - 1, 1) != "#") ns2 += "/"; @@ -2586,7 +2586,7 @@ namespace Exiv2 { std::string XmpProperties::ns(const std::string& prefix) { - Internal::ScopedReadLock srl(rwLock_); + ScopedReadLock srl(rwLock_); const XmpNsInfo* xn = lookupNsRegistryUnsafe(XmpNsInfo::Prefix(prefix)); if (xn != 0) return xn->ns_; return nsInfoUnsafe(prefix)->ns_; @@ -2653,7 +2653,7 @@ namespace Exiv2 { const XmpNsInfo* XmpProperties::nsInfo(const std::string& prefix) { - Internal::ScopedReadLock srl(rwLock_); + ScopedReadLock srl(rwLock_); return nsInfoUnsafe(prefix); }