1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/store/Backend.h
12 #ifndef ZYPP_STORAGE_BACKEND_H
13 #define ZYPP_STORAGE_BACKEND_H
17 #include "zypp/base/PtrTypes.h"
18 #include <zypp/Pathname.h>
19 #include <zypp/Patch.h>
21 #include <zypp/target/store/PersistentStorage.h>
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
28 { /////////////////////////////////////////////////////////////////
30 ///////////////////////////////////////////////////////////////////
32 // CLASS NAME : Backend
35 * This class represents a storage backend implementation
39 friend std::ostream & operator<<( std::ostream & str, const Backend & obj );
41 /** root is the system root path */
42 Backend(const Pathname &root);
45 virtual void doTest() = 0;
48 * is the storage backend initialized
50 virtual bool isBackendInitialized() const = 0;
52 * initialize the storage backend
54 virtual void initBackend() = 0;
57 * Stores a Resolvable in the active backend.
59 virtual void storeObject( Resolvable::constPtr resolvable ) = 0;
61 * Deletes a Resolvable from the active backend.
63 virtual void deleteObject( Resolvable::Ptr resolvable ) = 0;
66 * Query for installed Resolvables.
68 virtual std::list<Resolvable::Ptr> storedObjects() const = 0;
70 * Query for installed Resolvables of a certain kind
72 virtual std::list<Resolvable::Ptr> storedObjects(const Resolvable::Kind) const = 0;
74 * Query for installed Resolvables of a certain kind by name
75 * \a partial_match allows for text search.
77 virtual std::list<Resolvable::Ptr> storedObjects(const Resolvable::Kind, const std::string & name, bool partial_match = false) const = 0;
80 /////////////////////////////////////////////////////////
82 ////////////////////////////////////////////////////////
84 * Query for installed Sources
86 virtual std::list<PersistentStorage::SourceData> storedSources() const = 0;
88 * Query for installed Sources
90 virtual void storeSource(const PersistentStorage::SourceData &data) = 0;
92 * Query for installed Sources
94 virtual void deleteSource(const std::string &alias) = 0;
97 /** Pointer to implementation */
101 ///////////////////////////////////////////////////////////////////
103 /** \relates Backend Stream output */
104 std::ostream & operator<<( std::ostream & str, const Backend & obj );
106 /////////////////////////////////////////////////////////////////
107 } // namespace storage
108 ///////////////////////////////////////////////////////////////////
109 /////////////////////////////////////////////////////////////////
111 ///////////////////////////////////////////////////////////////////
112 #endif // DEVEL_DEVEL_DMACVICAR_BACKEND_H