From 866b4c61fb5686cfba0f25b6a915efe9209bfc88 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Wed, 23 Nov 2005 21:09:48 +0000 Subject: [PATCH] Renamed Ptr types FooPtr / constFooPtr (deprecated old) to Foo_Ptr / Foo_constPtr (new) To be more consistent with Ptr types declared within a class as Foo::Ptr / Foo::constPtr zypp/base/PtrTypes.h: Renamed ImplPtr (we have too much Impl's) into 'RW_pointer'. This indicates it's smart pointerness. Updated doc for it and added code example. --- zypp/CapFactory.cc | 14 +++++----- zypp/CapFactory.h | 2 +- zypp/Capability.cc | 2 +- zypp/Capability.h | 8 +++--- zypp/Dependencies.cc | 6 ++--- zypp/Edition.h | 2 +- zypp/Rel.h | 2 +- zypp/Resolvable.h | 2 +- zypp/SolverContext.cc | 6 ++--- zypp/SolverContext.h | 6 ++--- zypp/base/PtrTypes.h | 51 ++++++++++++++++++++++++------------ zypp/detail/ResObjectFactory.h | 8 +++--- zypp/parser/yum/YUMFileListParser.cc | 10 +++---- zypp/parser/yum/YUMFileListParser.h | 8 +++--- zypp/parser/yum/YUMGroupParser.cc | 14 +++++----- zypp/parser/yum/YUMGroupParser.h | 12 ++++----- zypp/parser/yum/YUMOtherParser.cc | 10 +++---- zypp/parser/yum/YUMOtherParser.h | 8 +++--- zypp/parser/yum/YUMPatchParser.cc | 18 ++++++------- zypp/parser/yum/YUMPatchParser.h | 16 +++++------ zypp/parser/yum/YUMPrimaryParser.cc | 12 ++++----- zypp/parser/yum/YUMPrimaryParser.h | 10 +++---- zypp/parser/yum/YUMRepomdParser.cc | 10 +++---- zypp/parser/yum/YUMRepomdParser.h | 8 +++--- 24 files changed, 131 insertions(+), 114 deletions(-) diff --git a/zypp/CapFactory.cc b/zypp/CapFactory.cc index b67a656..0eb38e8 100644 --- a/zypp/CapFactory.cc +++ b/zypp/CapFactory.cc @@ -25,17 +25,17 @@ using namespace std; namespace { ///////////////////////////////////////////////////////////////// - typedef zypp::capability::CapabilityImplPtr CapabilityImplPtr; + typedef zypp::capability::CapabilityImpl_Ptr CapabilityImpl_Ptr; /** \todo check set ordering to assert no dups */ - struct USetOrder : public std::binary_function + struct USetOrder : public std::binary_function { - bool operator()( const CapabilityImplPtr & lhs, - const CapabilityImplPtr & rhs ) const + bool operator()( const CapabilityImpl_Ptr & lhs, + const CapabilityImpl_Ptr & rhs ) const { return lhs->asString() < rhs->asString(); } }; - typedef std::set USet; + typedef std::set USet; USet _uset; @@ -102,7 +102,7 @@ namespace zypp // fix it! if ( strval_r.empty() ) throw "no Resolvable::Kind"; - CapabilityImplPtr newcap( new capability::NamedCap( defaultRefers_r, strval_r ) ); + CapabilityImpl_Ptr newcap( new capability::NamedCap( defaultRefers_r, strval_r ) ); USet::iterator in( _uset.insert( newcap ).first ); return Capability( *in ); } @@ -118,7 +118,7 @@ namespace zypp Rel op_r, const Edition & edition_r ) const { - CapabilityImplPtr newcap( new capability::NamedCap( refers_r, name_r ) ); + CapabilityImpl_Ptr newcap( new capability::NamedCap( refers_r, name_r ) ); USet::iterator in( _uset.insert( newcap ).first ); return Capability( *in ); } diff --git a/zypp/CapFactory.h b/zypp/CapFactory.h index ee93619..57cbfcf 100644 --- a/zypp/CapFactory.h +++ b/zypp/CapFactory.h @@ -65,7 +65,7 @@ namespace zypp /** Implementation */ struct Impl; /** Pointer to implementation */ - base::ImplPtr _pimpl; + base::RW_pointer _pimpl; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/Capability.cc b/zypp/Capability.cc index bf0e9c4..f9f607b 100644 --- a/zypp/Capability.cc +++ b/zypp/Capability.cc @@ -27,7 +27,7 @@ namespace zypp // METHOD NAME : Capability::Capability // METHOD TYPE : Ctor // - Capability::Capability( ImplPtr impl_r ) + Capability::Capability( Impl_Ptr impl_r ) : _pimpl( impl_r ) {} diff --git a/zypp/Capability.h b/zypp/Capability.h index df08b7a..57482c0 100644 --- a/zypp/Capability.h +++ b/zypp/Capability.h @@ -53,11 +53,11 @@ namespace zypp private: typedef capability::CapabilityImpl Impl; - typedef capability::CapabilityImpl_Ptr ImplPtr ; - typedef capability::CapabilityImpl_constPtr ImplconstPtr; + typedef capability::CapabilityImpl_Ptr Impl_Ptr ; + typedef capability::CapabilityImpl_constPtr Impl_constPtr; /** Factory ctor */ explicit - Capability( ImplPtr impl_r ); + Capability( Impl_Ptr impl_r ); public: /** Factory */ typedef CapFactory Factory; @@ -77,7 +77,7 @@ namespace zypp private: /** Pointer to implementation */ - base::ImplPtr _pimpl; + base::RW_pointer _pimpl; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/Dependencies.cc b/zypp/Dependencies.cc index bd7f041..fdd4ab4 100644 --- a/zypp/Dependencies.cc +++ b/zypp/Dependencies.cc @@ -50,14 +50,14 @@ namespace zypp /** */ CapSet _freshens; - static DependenciesImplPtr nodeps() + static DependenciesImpl_Ptr nodeps() { if ( !_nodeps ) { _nodeps = new DependenciesImpl; _nodeps->ref(); } return _nodeps; } private: - static DependenciesImplPtr _nodeps; + static DependenciesImpl_Ptr _nodeps; }; /////////////////////////////////////////////////////////////////// IMPL_PTR_TYPE(DependenciesImpl) @@ -149,7 +149,7 @@ namespace zypp #define ZYPP_DEPENDENCIES_COW \ if(_pimpl->refCount()>1) \ { \ - detail::DependenciesImplPtr _cow_tmp = new detail::DependenciesImpl; \ + detail::DependenciesImpl_Ptr _cow_tmp = new detail::DependenciesImpl; \ _cow_tmp->_provides = _pimpl->_provides; \ _cow_tmp->_prerequires = _pimpl->_prerequires; \ _cow_tmp->_requires = _pimpl->_requires; \ diff --git a/zypp/Edition.h b/zypp/Edition.h index 6235dbb..eb94cd3 100644 --- a/zypp/Edition.h +++ b/zypp/Edition.h @@ -82,7 +82,7 @@ namespace zypp /** Hides implementation */ struct Impl; /** Pointer to implementation */ - base::ImplPtr _pimpl; + base::RW_pointer _pimpl; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/Rel.h b/zypp/Rel.h index cd534d0..89cfbe1 100644 --- a/zypp/Rel.h +++ b/zypp/Rel.h @@ -42,7 +42,7 @@ namespace zypp { /** \name Relational operators * These are the \em real relational operator contants to - * use. Don't mind that it's not an enum. See also: \ref inSwitch + * use. Don't mind that it's not an enum. See also: \ref zypp::Rel::inSwitch */ //@{ static const Rel EQ; diff --git a/zypp/Resolvable.h b/zypp/Resolvable.h index f184b84..1694b83 100644 --- a/zypp/Resolvable.h +++ b/zypp/Resolvable.h @@ -73,7 +73,7 @@ namespace zypp /** Implementation */ struct Impl; /** Pointer to implementation */ - base::ImplPtr _pimpl; + base::RW_pointer _pimpl; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/SolverContext.cc b/zypp/SolverContext.cc index 7d97df8..8d42a73 100644 --- a/zypp/SolverContext.cc +++ b/zypp/SolverContext.cc @@ -70,7 +70,7 @@ namespace zypp // METHOD NAME : SolverContext::SolverContext // METHOD TYPE : Ctor // - SolverContext::SolverContext( detail::SolverContextImplPtr impl_r ) + SolverContext::SolverContext( detail::SolverContextImpl_Ptr impl_r ) : _pimpl( impl_r ) {} @@ -85,9 +85,9 @@ namespace zypp /////////////////////////////////////////////////////////////////// // // METHOD NAME : SolverContext::sayFriend - // METHOD TYPE : detail::constSolverContextImplPtr + // METHOD TYPE : detail::constSolverContextImpl_Ptr // - detail::constSolverContextImplPtr SolverContext::sayFriend() const + detail::SolverContextImpl_constPtr SolverContext::sayFriend() const { return _pimpl; } /****************************************************************** diff --git a/zypp/SolverContext.h b/zypp/SolverContext.h index 36a5bba..c8dbe60 100644 --- a/zypp/SolverContext.h +++ b/zypp/SolverContext.h @@ -39,16 +39,16 @@ namespace zypp SolverContext(); /** Factory ctor */ explicit - SolverContext( detail::SolverContextImplPtr impl_r ); + SolverContext( detail::SolverContextImpl_Ptr impl_r ); /** Dtor */ ~SolverContext(); private: /** Pointer to implementation */ - detail::SolverContextImplPtr _pimpl; + detail::SolverContextImpl_Ptr _pimpl; public: /** Avoid a bunch of friend decl. */ - detail::constSolverContextImplPtr sayFriend() const; + detail::SolverContextImpl_constPtr sayFriend() const; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/base/PtrTypes.h b/zypp/base/PtrTypes.h index fdcc142..b10f259 100644 --- a/zypp/base/PtrTypes.h +++ b/zypp/base/PtrTypes.h @@ -38,6 +38,9 @@ namespace zypp * \li \c shared_ptr Object ownership shared among multiple pointers * * \li \c weak_ptr Non-owning observers of an object owned by shared_ptr. + * + * And \ref zypp::base::RW_pointer, as wrapper around a smart pointer, + * poviding \c const correct read/write access to the object it refers. */ /*@{*/ @@ -52,42 +55,60 @@ namespace zypp /** Use boost::intrusive_ptr as Ptr type*/ using boost::intrusive_ptr; + using boost::static_pointer_cast; using boost::const_pointer_cast; using boost::dynamic_pointer_cast; /////////////////////////////////////////////////////////////////// // - // CLASS NAME : ImplPtr + // CLASS NAME : RW_pointer // /** Wrapper for \c const correct access via \ref ZYPP_BASE_SMART_PTR. * - * zypp::base::ImplPtr\<_D,_Ptr> stores a \ref ZYPP_BASE_SMART_PTR + * zypp::base::RW_pointer\<_D,_Ptr> stores a \ref ZYPP_BASE_SMART_PTR * of type \c _Ptr, which must be convertible into a _D *. Pointer * style access (via \c -> and \c *) offers a const _D * in const - * a context, otherwise a _D *. + * a context, otherwise a _D *. Thus \em RW_ means \em read/write, + * as you get a different type, dependent on whether you're allowed to + * read or write. * * Forwarding access from an interface to an implemantation class, an - * ImplPtr prevents const interface methods from accidentally calling + * RW_pointer prevents const interface methods from accidentally calling * nonconst implementation methods. In case you have to do so, call * unconst to get the _D *. * * The second template argument defaults to _Ptr = shared_ptr<_D>. + * \code + * #include "zypp/base/PtrTypes.h" + * + * class Foo + * { + * ... + * private: + * // Implementation class + * struct Impl; + * // Pointer to implementation; actually a shared_ptr + * base::RW_pointer _pimpl; * + * void baa() { _pimpl->... } // is Impl * + * void baa() const { _pimpl->... } // is Impl const * + * }; + * \endcode * \todo refine ctor and assign. */ template > - struct ImplPtr + struct RW_pointer { typedef _D element_type; explicit - ImplPtr( typename _Ptr::element_type * dptr = 0 ) + RW_pointer( typename _Ptr::element_type * dptr = 0 ) : _dptr( dptr ) {} explicit - ImplPtr( _Ptr dptr ) + RW_pointer( _Ptr dptr ) : _dptr( dptr ) {} @@ -100,18 +121,17 @@ namespace zypp _D * unconst() const { return _dptr.get(); } - _Ptr _dptr; }; - /** \relates ImplPtr Stream output. + /** \relates RW_pointer Stream output. * - * Print the \r _D object the ImplPtr refers, or \c "NULL" + * Print the \c _D object the RW_pointer refers, or \c "NULL" * if the pointer is \c NULL. */ template inline std::ostream & - operator<<( std::ostream & str, const ImplPtr<_D, _Ptr> & obj ) + operator<<( std::ostream & str, const RW_pointer<_D, _Ptr> & obj ) { if ( obj.get() ) return str << *obj.get(); @@ -121,7 +141,7 @@ namespace zypp /////////////////////////////////////////////////////////////////// /** Wrapper for \c const correct access via pointer. * - * Template specialization of ImplPtr, storing a raw _P *, + * Template specialization of RW_pointer, storing a raw _P *, * which must be convertible into a _D *. * * \note The object pointed to will \b not be deleted. If you need @@ -129,12 +149,12 @@ namespace zypp * raw pointer. */ template - struct ImplPtr<_D,_P*> + struct RW_pointer<_D,_P*> { typedef _D element_type; explicit - ImplPtr( _P * dptr = 0 ) + RW_pointer( _P * dptr = 0 ) : _dptr( dptr ) {} @@ -147,7 +167,6 @@ namespace zypp _D * unconst() const { return _dptr; } - _P * _dptr; }; @@ -167,8 +186,6 @@ namespace zypp class NAME; \ extern void intrusive_ptr_add_ref( const NAME * ); \ extern void intrusive_ptr_release( const NAME * ); \ -typedef zypp::base::intrusive_ptr NAME##Ptr; \ -typedef zypp::base::intrusive_ptr const##NAME##Ptr; \ typedef zypp::base::intrusive_ptr NAME##_Ptr; \ typedef zypp::base::intrusive_ptr NAME##_constPtr; diff --git a/zypp/detail/ResObjectFactory.h b/zypp/detail/ResObjectFactory.h index 1226afc..b72b61e 100644 --- a/zypp/detail/ResObjectFactory.h +++ b/zypp/detail/ResObjectFactory.h @@ -34,8 +34,8 @@ namespace zypp public: typedef ResImplConnect Self; typedef typename _Res::Impl Impl; - typedef base::shared_ptr ImplPtr; - // Ptr typed not needed + typedef base::shared_ptr Impl_Ptr; + // Ptr types not needed // typedef base::intrusive_ptr Ptr; // typedef base::intrusive_ptr constPtr; public: @@ -43,14 +43,14 @@ namespace zypp ResImplConnect( const std::string & name_r, const Edition & edition_r, const Arch & arch_r, - ImplPtr impl_r ) + Impl_Ptr impl_r ) : _Res( name_r, edition_r, arch_r ) , _impl( impl_r ) { _impl->_backRef = this; } virtual ~ResImplConnect() { _impl->_backRef = 0; } private: - ImplPtr _impl; + Impl_Ptr _impl; virtual Impl & pimpl() { return *_impl; } virtual const Impl & pimpl() const { return *_impl; } }; diff --git a/zypp/parser/yum/YUMFileListParser.cc b/zypp/parser/yum/YUMFileListParser.cc index e4e01c0..eccefc7 100644 --- a/zypp/parser/yum/YUMFileListParser.cc +++ b/zypp/parser/yum/YUMFileListParser.cc @@ -33,7 +33,7 @@ namespace zypp { YUMFileListParser::YUMFileListParser(istream &is, const string& baseUrl) - : XMLNodeIterator(is, baseUrl,FILELISTSCHEMA) + : XMLNodeIterator(is, baseUrl,FILELISTSCHEMA) { fetchNext(); } @@ -41,8 +41,8 @@ namespace zypp { YUMFileListParser::YUMFileListParser() { } - YUMFileListParser::YUMFileListParser(YUMFileListDataPtr& entry) - : XMLNodeIterator(entry) + YUMFileListParser::YUMFileListParser(YUMFileListData_Ptr& entry) + : XMLNodeIterator(entry) { } @@ -65,11 +65,11 @@ namespace zypp { // do the actual processing - YUMFileListDataPtr + YUMFileListData_Ptr YUMFileListParser::process(const xmlTextReaderPtr reader) { assert(reader); - YUMFileListDataPtr dataPtr = new YUMFileListData; + YUMFileListData_Ptr dataPtr = new YUMFileListData; xmlNodePtr dataNode = xmlTextReaderExpand(reader); assert(dataNode); diff --git a/zypp/parser/yum/YUMFileListParser.h b/zypp/parser/yum/YUMFileListParser.h index d80f61c..e4e7e85 100644 --- a/zypp/parser/yum/YUMFileListParser.h +++ b/zypp/parser/yum/YUMFileListParser.h @@ -27,7 +27,7 @@ namespace zypp { /** * @short Parser for YUM filelists files * Use this class as an iterator that produces, one after one, - * YUMFileListDataPtr(s) for the XML package elements. + * YUMFileListData_Ptr(s) for the XML package elements. * Here's an example: * * for (YUMFileListParser iter(anIstream, baseUrl), @@ -44,7 +44,7 @@ namespace zypp { * continue parsing, XMLNodeIterator will log it and consider the input as finished. * You can query the exit status with errorStatus(). */ - class YUMFileListParser : public XMLNodeIterator + class YUMFileListParser : public XMLNodeIterator { public: /** @@ -54,7 +54,7 @@ namespace zypp { */ YUMFileListParser(std::istream &is, const std::string &baseUrl); YUMFileListParser(); - YUMFileListParser(YUMFileListDataPtr& entry); + YUMFileListParser(YUMFileListData_Ptr& entry); /** @@ -75,7 +75,7 @@ namespace zypp { * @param reader * @return */ - virtual YUMFileListDataPtr process(const xmlTextReaderPtr reader); + virtual YUMFileListData_Ptr process(const xmlTextReaderPtr reader); /** * converts the xml stuff to c++ stuff and filters the right namespaces diff --git a/zypp/parser/yum/YUMGroupParser.cc b/zypp/parser/yum/YUMGroupParser.cc index f7789a1..d9402de 100644 --- a/zypp/parser/yum/YUMGroupParser.cc +++ b/zypp/parser/yum/YUMGroupParser.cc @@ -28,8 +28,8 @@ namespace zypp { YUMGroupParser::YUMGroupParser() { } - YUMGroupParser::YUMGroupParser(YUMGroupDataPtr& entry) - : XMLNodeIterator(entry) + YUMGroupParser::YUMGroupParser(YUMGroupData_Ptr& entry) + : XMLNodeIterator(entry) { } @@ -45,11 +45,11 @@ namespace zypp { } // do the actual processing - YUMGroupDataPtr + YUMGroupData_Ptr YUMGroupParser::process(const xmlTextReaderPtr reader) { assert(reader); - YUMGroupDataPtr dataPtr = new YUMGroupData; + YUMGroupData_Ptr dataPtr = new YUMGroupData; xmlNodePtr dataNode = xmlTextReaderExpand(reader); assert(dataNode); @@ -92,7 +92,7 @@ namespace zypp { return dataPtr; } /* end process */ - void YUMGroupParser::parseGrouplist(YUMGroupDataPtr dataPtr, + void YUMGroupParser::parseGrouplist(YUMGroupData_Ptr dataPtr, xmlNodePtr node) { assert(dataPtr); @@ -117,7 +117,7 @@ namespace zypp { } - void YUMGroupParser::parsePackageList(YUMGroupDataPtr dataPtr, + void YUMGroupParser::parsePackageList(YUMGroupData_Ptr dataPtr, xmlNodePtr node) { assert(dataPtr); @@ -147,7 +147,7 @@ namespace zypp { YUMGroupParser::YUMGroupParser(istream &is, const string &baseUrl) - : XMLNodeIterator(is, baseUrl,GROUPSCHEMA) + : XMLNodeIterator(is, baseUrl,GROUPSCHEMA) { fetchNext(); } diff --git a/zypp/parser/yum/YUMGroupParser.h b/zypp/parser/yum/YUMGroupParser.h index fdd5eea..9bfcf6d 100644 --- a/zypp/parser/yum/YUMGroupParser.h +++ b/zypp/parser/yum/YUMGroupParser.h @@ -29,7 +29,7 @@ namespace zypp { * @short Parser for YUM group files. * * Use this class as an iterator that produces, one after one, - * YUMGroupDataPtr(s) for the XML group elements. + * YUMGroupData_Ptr(s) for the XML group elements. * Here's an example: * * for (YUMGroupParser iter(anIstream, baseUrl), @@ -46,20 +46,20 @@ namespace zypp { * continue parsing, XMLNodeIterator will log it and consider the input as finished. * You can query the exit status with errorStatus(). */ - class YUMGroupParser : public XMLNodeIterator + class YUMGroupParser : public XMLNodeIterator { public: YUMGroupParser(std::istream &is, const std::string &baseUrl); YUMGroupParser(); - YUMGroupParser(YUMGroupDataPtr& entry); + YUMGroupParser(YUMGroupData_Ptr& entry); virtual ~YUMGroupParser(); private: virtual bool isInterested(const xmlNodePtr nodePtr); - virtual YUMGroupDataPtr process(const xmlTextReaderPtr reader); - void parseGrouplist(YUMGroupDataPtr dataPtr, + virtual YUMGroupData_Ptr process(const xmlTextReaderPtr reader); + void parseGrouplist(YUMGroupData_Ptr dataPtr, xmlNodePtr node); - void parsePackageList(YUMGroupDataPtr dataPtr, + void parsePackageList(YUMGroupData_Ptr dataPtr, xmlNodePtr node); LibXMLHelper _helper; diff --git a/zypp/parser/yum/YUMOtherParser.cc b/zypp/parser/yum/YUMOtherParser.cc index f41e1a6..4292164 100644 --- a/zypp/parser/yum/YUMOtherParser.cc +++ b/zypp/parser/yum/YUMOtherParser.cc @@ -30,7 +30,7 @@ namespace zypp { YUMOtherParser::YUMOtherParser(istream &is, const string& baseUrl) - : XMLNodeIterator(is, baseUrl,OTHERSCHEMA) + : XMLNodeIterator(is, baseUrl,OTHERSCHEMA) { fetchNext(); } @@ -38,8 +38,8 @@ namespace zypp { YUMOtherParser::YUMOtherParser() { } - YUMOtherParser::YUMOtherParser(YUMOtherDataPtr& entry) - : XMLNodeIterator(entry) + YUMOtherParser::YUMOtherParser(YUMOtherData_Ptr& entry) + : XMLNodeIterator(entry) { } @@ -62,11 +62,11 @@ namespace zypp { // do the actual processing - YUMOtherDataPtr + YUMOtherData_Ptr YUMOtherParser::process(const xmlTextReaderPtr reader) { assert(reader); - YUMOtherDataPtr dataPtr = new YUMOtherData; + YUMOtherData_Ptr dataPtr = new YUMOtherData; xmlNodePtr dataNode = xmlTextReaderExpand(reader); assert(dataNode); diff --git a/zypp/parser/yum/YUMOtherParser.h b/zypp/parser/yum/YUMOtherParser.h index 9087468..cc3263b 100644 --- a/zypp/parser/yum/YUMOtherParser.h +++ b/zypp/parser/yum/YUMOtherParser.h @@ -27,7 +27,7 @@ namespace zypp { /** * @short Parser for YUM other.xml files * Use this class as an iterator that produces, one after one, - * YUMOtherDataPtr(s) for the XML package elements. + * YUMOtherData_Ptr(s) for the XML package elements. * Here's an example: * * for (YUMOtherParser iter(anIstream, baseUrl), @@ -44,7 +44,7 @@ namespace zypp { * continue parsing, XMLNodeIterator will log it and consider the input as finished. * You can query the exit status with errorStatus(). */ - class YUMOtherParser : public XMLNodeIterator + class YUMOtherParser : public XMLNodeIterator { public: /** @@ -55,7 +55,7 @@ namespace zypp { YUMOtherParser(std::istream &is, const std::string &baseUrl); YUMOtherParser(); - YUMOtherParser(YUMOtherDataPtr& entry); + YUMOtherParser(YUMOtherData_Ptr& entry); /** * Destructor. @@ -75,7 +75,7 @@ namespace zypp { * @param reader * @return */ - virtual YUMOtherDataPtr process(const xmlTextReaderPtr reader); + virtual YUMOtherData_Ptr process(const xmlTextReaderPtr reader); /** * converts the xml stuff to c++ stuff and filters the right namespaces diff --git a/zypp/parser/yum/YUMPatchParser.cc b/zypp/parser/yum/YUMPatchParser.cc index ae1cc8a..0506e04 100644 --- a/zypp/parser/yum/YUMPatchParser.cc +++ b/zypp/parser/yum/YUMPatchParser.cc @@ -30,7 +30,7 @@ namespace zypp { { } YUMPatchParser::YUMPatchParser(istream &is, const string& baseUrl) - : XMLNodeIterator(is, baseUrl,PATCHSCHEMA) + : XMLNodeIterator(is, baseUrl,PATCHSCHEMA) { fetchNext(); } @@ -38,8 +38,8 @@ namespace zypp { YUMPatchParser::YUMPatchParser() { } - YUMPatchParser::YUMPatchParser(YUMPatchDataPtr& entry) - : XMLNodeIterator(entry) + YUMPatchParser::YUMPatchParser(YUMPatchData_Ptr& entry) + : XMLNodeIterator(entry) { } @@ -51,11 +51,11 @@ namespace zypp { } // do the actual processing - YUMPatchDataPtr + YUMPatchData_Ptr YUMPatchParser::process(const xmlTextReaderPtr reader) { assert(reader); - YUMPatchDataPtr patchPtr = new YUMPatchData; + YUMPatchData_Ptr patchPtr = new YUMPatchData; xmlNodePtr dataNode = xmlTextReaderExpand(reader); assert(dataNode); patchPtr->timestamp = _helper.attribute(dataNode,"timestamp"); @@ -133,7 +133,7 @@ namespace zypp { void - YUMPatchParser::parseAtomsNode(YUMPatchDataPtr dataPtr, + YUMPatchParser::parseAtomsNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode) { assert(formatNode); @@ -368,7 +368,7 @@ namespace zypp { void - YUMPatchParser::parsePackageNode(YUMPatchDataPtr dataPtr, + YUMPatchParser::parsePackageNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode) { shared_ptr package(new YUMPatchPackage); @@ -441,7 +441,7 @@ namespace zypp { } void - YUMPatchParser::parseScriptNode(YUMPatchDataPtr dataPtr, + YUMPatchParser::parseScriptNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode) { shared_ptr script(new YUMPatchScript); @@ -494,7 +494,7 @@ namespace zypp { } void - YUMPatchParser::parseMessageNode(YUMPatchDataPtr dataPtr, + YUMPatchParser::parseMessageNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode) { shared_ptr message(new YUMPatchMessage); diff --git a/zypp/parser/yum/YUMPatchParser.h b/zypp/parser/yum/YUMPatchParser.h index 2030938..40d78c9 100644 --- a/zypp/parser/yum/YUMPatchParser.h +++ b/zypp/parser/yum/YUMPatchParser.h @@ -27,7 +27,7 @@ namespace zypp { /** * @short Parser for YUM primary.xml files (containing package metadata) * Use this class as an iterator that produces, one after one, - * YUMPatchDataPtr(s) for the XML package elements in the input. + * YUMPatchData_Ptr(s) for the XML package elements in the input. * Here's an example: * * for (YUMPatchParser iter(anIstream, baseUrl), @@ -44,21 +44,21 @@ namespace zypp { * continue parsing, XMLNodeIterator will log it and consider the input as finished. * You can query the exit status with errorStatus(). */ - class YUMPatchParser : public XMLNodeIterator + class YUMPatchParser : public XMLNodeIterator { public: YUMPatchParser(std::istream &is, const std::string &baseUrl); YUMPatchParser(); - YUMPatchParser(YUMPatchDataPtr& entry); + YUMPatchParser(YUMPatchData_Ptr& entry); virtual ~YUMPatchParser(); private: virtual bool isInterested(const xmlNodePtr nodePtr); - virtual YUMPatchDataPtr process(const xmlTextReaderPtr reader); - void parseAtomsNode(YUMPatchDataPtr dataPtr, xmlNodePtr formatNode); - void parsePackageNode(YUMPatchDataPtr dataPtr, xmlNodePtr formatNode); - void parseMessageNode(YUMPatchDataPtr dataPtr, xmlNodePtr formatNode); - void parseScriptNode(YUMPatchDataPtr dataPtr, xmlNodePtr formatNode); + virtual YUMPatchData_Ptr process(const xmlTextReaderPtr reader); + void parseAtomsNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode); + void parsePackageNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode); + void parseMessageNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode); + void parseScriptNode(YUMPatchData_Ptr dataPtr, xmlNodePtr formatNode); void parseFormatNode(YUMPatchPackage *dataPtr, xmlNodePtr formatNode); void parsePkgFilesNode(YUMPatchPackage *dataPtr, xmlNodePtr formatNode); void parsePkgPlainRpmNode(YUMPatchPackage *dataPtr, xmlNodePtr formatNode); diff --git a/zypp/parser/yum/YUMPrimaryParser.cc b/zypp/parser/yum/YUMPrimaryParser.cc index 77aa190..1631622 100644 --- a/zypp/parser/yum/YUMPrimaryParser.cc +++ b/zypp/parser/yum/YUMPrimaryParser.cc @@ -29,7 +29,7 @@ namespace zypp { YUMPrimaryParser::YUMPrimaryParser(istream &is, const string& baseUrl) - : XMLNodeIterator(is, baseUrl,PRIMARYSCHEMA) + : XMLNodeIterator(is, baseUrl,PRIMARYSCHEMA) { fetchNext(); } @@ -37,8 +37,8 @@ namespace zypp { YUMPrimaryParser::YUMPrimaryParser() { } - YUMPrimaryParser::YUMPrimaryParser(YUMPrimaryDataPtr& entry) - : XMLNodeIterator(entry) + YUMPrimaryParser::YUMPrimaryParser(YUMPrimaryData_Ptr& entry) + : XMLNodeIterator(entry) { } @@ -60,11 +60,11 @@ namespace zypp { // do the actual processing - YUMPrimaryDataPtr + YUMPrimaryData_Ptr YUMPrimaryParser::process(const xmlTextReaderPtr reader) { assert(reader); - YUMPrimaryDataPtr dataPtr = new YUMPrimaryData; + YUMPrimaryData_Ptr dataPtr = new YUMPrimaryData; xmlNodePtr dataNode = xmlTextReaderExpand(reader); assert(dataNode); @@ -131,7 +131,7 @@ namespace zypp { void - YUMPrimaryParser::parseFormatNode(YUMPrimaryDataPtr dataPtr, + YUMPrimaryParser::parseFormatNode(YUMPrimaryData_Ptr dataPtr, xmlNodePtr formatNode) { assert(formatNode); diff --git a/zypp/parser/yum/YUMPrimaryParser.h b/zypp/parser/yum/YUMPrimaryParser.h index 752c6bd..02c7f68 100644 --- a/zypp/parser/yum/YUMPrimaryParser.h +++ b/zypp/parser/yum/YUMPrimaryParser.h @@ -27,7 +27,7 @@ namespace zypp { /** * @short Parser for YUM primary.xml files (containing package metadata) * Use this class as an iterator that produces, one after one, - * YUMPrimaryDataPtr(s) for the XML package elements in the input. + * YUMPrimaryData_Ptr(s) for the XML package elements in the input. * Here's an example: * * for (YUMPrimaryParser iter(anIstream, baseUrl), @@ -44,20 +44,20 @@ namespace zypp { * continue parsing, XMLNodeIterator will log it and consider the input as finished. * You can query the exit status with errorStatus(). */ - class YUMPrimaryParser : public XMLNodeIterator + class YUMPrimaryParser : public XMLNodeIterator { public: YUMPrimaryParser(std::istream &is, const std::string &baseUrl); YUMPrimaryParser(); - YUMPrimaryParser(YUMPrimaryDataPtr& entry); + YUMPrimaryParser(YUMPrimaryData_Ptr& entry); virtual ~YUMPrimaryParser(); private: // FIXME move needed method to a common class, inherit it friend class YUMPatchParser; virtual bool isInterested(const xmlNodePtr nodePtr); - virtual YUMPrimaryDataPtr process(const xmlTextReaderPtr reader); - void parseFormatNode(YUMPrimaryDataPtr dataPtr, + virtual YUMPrimaryData_Ptr process(const xmlTextReaderPtr reader); + void parseFormatNode(YUMPrimaryData_Ptr dataPtr, xmlNodePtr formatNode); void parseDependencyEntries(std::list *depList, xmlNodePtr depNode); diff --git a/zypp/parser/yum/YUMRepomdParser.cc b/zypp/parser/yum/YUMRepomdParser.cc index 67a7aa9..9f86c6a 100644 --- a/zypp/parser/yum/YUMRepomdParser.cc +++ b/zypp/parser/yum/YUMRepomdParser.cc @@ -31,8 +31,8 @@ namespace zypp { YUMRepomdParser::YUMRepomdParser() { } - YUMRepomdParser::YUMRepomdParser(YUMRepomdDataPtr& entry) - : XMLNodeIterator(entry) + YUMRepomdParser::YUMRepomdParser(YUMRepomdData_Ptr& entry) + : XMLNodeIterator(entry) { } @@ -44,11 +44,11 @@ namespace zypp { } // do the actual processing - YUMRepomdDataPtr + YUMRepomdData_Ptr YUMRepomdParser::process(const xmlTextReaderPtr reader) { assert(reader); - YUMRepomdDataPtr repoPtr = new YUMRepomdData; + YUMRepomdData_Ptr repoPtr = new YUMRepomdData; xmlNodePtr dataNode = xmlTextReaderExpand(reader); assert(dataNode); repoPtr->type = _helper.attribute(dataNode,"type"); @@ -83,7 +83,7 @@ namespace zypp { YUMRepomdParser::YUMRepomdParser(istream &is, const string &baseUrl) - : XMLNodeIterator(is, baseUrl,REPOMDSCHEMA) + : XMLNodeIterator(is, baseUrl,REPOMDSCHEMA) { fetchNext(); } diff --git a/zypp/parser/yum/YUMRepomdParser.h b/zypp/parser/yum/YUMRepomdParser.h index ddaabcb..792cee4 100644 --- a/zypp/parser/yum/YUMRepomdParser.h +++ b/zypp/parser/yum/YUMRepomdParser.h @@ -26,7 +26,7 @@ namespace zypp { /** * @short Parser for YUM repomd.xml files (describing the repository) * Use this class as an iterator that produces, one after one, - * YUMRepomdDataPtr(s) for the XML package elements. + * YUMRepomdData_Ptr(s) for the XML package elements. * Here's an example: * * for (YUMRepomdParser iter(anIstream, baseUrl), @@ -43,17 +43,17 @@ namespace zypp { * continue parsing, XMLNodeIterator will log it and consider the input as finished. * You can query the exit status with errorStatus(). */ - class YUMRepomdParser : public XMLNodeIterator + class YUMRepomdParser : public XMLNodeIterator { public: YUMRepomdParser(std::istream &is, const std::string &baseUrl); YUMRepomdParser(); - YUMRepomdParser(YUMRepomdDataPtr& entry); + YUMRepomdParser(YUMRepomdData_Ptr& entry); virtual ~YUMRepomdParser(); private: virtual bool isInterested(const xmlNodePtr nodePtr); - virtual YUMRepomdDataPtr process(const xmlTextReaderPtr reader); + virtual YUMRepomdData_Ptr process(const xmlTextReaderPtr reader); LibXMLHelper _helper; }; -- 2.7.4