repo/cached/PatternImpl.cc
repo/cached/ProductImpl.cc
repo/cached/MessageImpl.cc
+ repo/cached/ScriptImpl.cc
+ repo/cached/AtomImpl.cc
)
SET( zypp_repository_cached_HEADERS
repo/cached/PatternImpl.h
repo/cached/ProductImpl.h
repo/cached/MessageImpl.h
+ repo/cached/ScriptImpl.h
+ repo/cached/AtomImpl.h
)
SET( zypp_repository_data_SRCS
bool ScriptImplIf::undo_available() const
{ return false; }
- ByteCount ScriptImplIf::size() const
- { return ResObjectImplIf::size(); }
-
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
virtual Pathname undo_script() const PURE_VIRTUAL;
/** Check whether script to undo the change is available */
virtual bool undo_available() const PURE_VIRTUAL;
- /** */
- virtual ByteCount size() const;
};
///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#include "zypp/TranslatedText.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Logger.h"
+#include "zypp/repo/RepositoryImpl.h"
+#include "AtomImpl.h"
+
+
+using namespace std;
+using namespace zypp::detail;
+using namespace::zypp::repo;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp { namespace repo { namespace cached {
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : AtomImpl
+//
+///////////////////////////////////////////////////////////////////
+
+/** Default ctor
+*/
+AtomImpl::AtomImpl (const data::RecordId &id, cached::RepoImpl::Ptr repository_r)
+ : _repository (repository_r),
+ _id(id)
+{}
+
+Repository
+AtomImpl::repository() const
+{
+ return _repository->selfRepository();
+}
+
+///////////////////////////////////////////////////
+// ResObject Attributes
+///////////////////////////////////////////////////
+
+TranslatedText AtomImpl::summary() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+}
+
+TranslatedText AtomImpl::description() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+}
+
+TranslatedText AtomImpl::insnotify() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+}
+
+TranslatedText AtomImpl::delnotify() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+}
+
+TranslatedText AtomImpl::licenseToConfirm() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+}
+
+Vendor AtomImpl::vendor() const
+{
+ return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+}
+
+
+ByteCount AtomImpl::size() const
+{
+ return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+}
+
+ByteCount AtomImpl::archivesize() const
+{
+ return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+}
+
+bool AtomImpl::installOnly() const
+{
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+}
+
+Date AtomImpl::buildtime() const
+{
+ return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+}
+
+Date AtomImpl::installtime() const
+{
+ return Date();
+}
+
+//////////////////////////////////////////
+// DEPRECATED
+//////////////////////////////////////////
+
+Source_Ref AtomImpl::source() const
+{
+ return Source_Ref::noSource;
+}
+
+unsigned AtomImpl::sourceMediaNr() const
+{
+ return 1;
+}
+
+/////////////////////////////////////////////////////////////////
+} } } // namespace zypp::repo::cached
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#ifndef zypp_repo_cached_AtomImpl_H
+#define zypp_repo_cached_AtomImpl_H
+
+#include "zypp/detail/AtomImpl.h"
+#include "zypp/repo/cached/RepoImpl.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+namespace repo
+{ /////////////////////////////////////////////////////////////////
+namespace cached
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : AtomImpl
+ //
+ class AtomImpl : public detail::AtomImplIf
+ {
+ public:
+
+ AtomImpl( const data::RecordId &id, repo::cached::RepoImpl::Ptr repository_r );
+
+ virtual TranslatedText summary() const;
+ virtual TranslatedText description() const;
+ virtual TranslatedText insnotify() const;
+ virtual TranslatedText delnotify() const;
+ virtual TranslatedText licenseToConfirm() const;
+ virtual Vendor vendor() const;
+ virtual ByteCount size() const;
+ virtual ByteCount archivesize() const;
+ virtual bool installOnly() const;
+ virtual Date buildtime() const;
+ virtual Date installtime() const;
+
+ virtual Source_Ref source() const;
+ virtual unsigned sourceMediaNr() const;
+
+ virtual Repository repository() const;
+
+ protected:
+ repo::cached::RepoImpl::Ptr _repository;
+ data::RecordId _id;
+ };
+ /////////////////////////////////////////////////////////////////
+} // namespace cached
+} // namespace repository
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#include "zypp/TranslatedText.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Logger.h"
+#include "zypp/repo/RepositoryImpl.h"
+#include "ScriptImpl.h"
+
+
+using namespace std;
+using namespace zypp::detail;
+using namespace::zypp::repo;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp { namespace repo { namespace cached {
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : ScriptImpl
+//
+///////////////////////////////////////////////////////////////////
+
+/** Default ctor
+*/
+ScriptImpl::ScriptImpl (const data::RecordId &id, cached::RepoImpl::Ptr repository_r)
+ : _repository (repository_r),
+ _id(id)
+{}
+
+Repository
+ScriptImpl::repository() const
+{
+ return _repository->selfRepository();
+}
+
+///////////////////////////////////////////////////
+// ResObject Attributes
+///////////////////////////////////////////////////
+
+TranslatedText ScriptImpl::summary() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+}
+
+TranslatedText ScriptImpl::description() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+}
+
+TranslatedText ScriptImpl::insnotify() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+}
+
+TranslatedText ScriptImpl::delnotify() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+}
+
+TranslatedText ScriptImpl::licenseToConfirm() const
+{
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+}
+
+Vendor ScriptImpl::vendor() const
+{
+ return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+}
+
+
+ByteCount ScriptImpl::size() const
+{
+ return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+}
+
+ByteCount ScriptImpl::archivesize() const
+{
+ return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+}
+
+bool ScriptImpl::installOnly() const
+{
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+}
+
+Date ScriptImpl::buildtime() const
+{
+ return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+}
+
+Date ScriptImpl::installtime() const
+{
+ return Date();
+}
+
+//////////////////////////////////////////
+// DEPRECATED
+//////////////////////////////////////////
+
+Source_Ref ScriptImpl::source() const
+{
+ return Source_Ref::noSource;
+}
+
+unsigned ScriptImpl::sourceMediaNr() const
+{
+ return 1;
+}
+
+//////////////////////////////////////////
+// MESSAGE
+/////////////////////////////////////////
+
+Pathname ScriptImpl::do_script() const
+{
+ return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "doScript" );
+}
+
+Pathname ScriptImpl::undo_script() const
+{
+ return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "undoScript" );
+}
+
+bool ScriptImpl::undo_available() const
+{
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, "Script", "undoAvailable", false );
+}
+
+
+/////////////////////////////////////////////////////////////////
+} } } // namespace zypp::repo::cached
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#ifndef zypp_repo_cached_ScriptImpl_H
+#define zypp_repo_cached_ScriptImpl_H
+
+#include "zypp/detail/ScriptImpl.h"
+#include "zypp/repo/cached/RepoImpl.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+namespace repo
+{ /////////////////////////////////////////////////////////////////
+namespace cached
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ScriptImpl
+ //
+ class ScriptImpl : public detail::ScriptImplIf
+ {
+ public:
+
+ ScriptImpl( const data::RecordId &id, repo::cached::RepoImpl::Ptr repository_r );
+
+ virtual TranslatedText summary() const;
+ virtual TranslatedText description() const;
+ virtual TranslatedText insnotify() const;
+ virtual TranslatedText delnotify() const;
+ virtual TranslatedText licenseToConfirm() const;
+ virtual Vendor vendor() const;
+ virtual ByteCount size() const;
+ virtual ByteCount archivesize() const;
+ virtual bool installOnly() const;
+ virtual Date buildtime() const;
+ virtual Date installtime() const;
+
+ virtual Source_Ref source() const;
+ virtual unsigned sourceMediaNr() const;
+
+ // SCRIPT
+ virtual Pathname do_script() const;
+ virtual Pathname undo_script() const;
+ virtual bool undo_available() const;
+
+ virtual Repository repository() const;
+
+ protected:
+ repo::cached::RepoImpl::Ptr _repository;
+ data::RecordId _id;
+ };
+ /////////////////////////////////////////////////////////////////
+} // namespace cached
+} // namespace repository
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H
+