PersistentStorage.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_TARGET_PERSISTENTSTORAGE_H
00013 #define ZYPP_TARGET_PERSISTENTSTORAGE_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/base/ReferenceCounted.h"
00018 #include "zypp/base/NonCopyable.h"
00019 #include "zypp/base/PtrTypes.h"
00020 #include <zypp/Pathname.h>
00021 #include <zypp/Url.h>
00022 #include <zypp/Date.h>
00023 #include <zypp/Patch.h>
00024 
00026 namespace zypp
00027 { 
00028 
00029   namespace storage
00030   { 
00031 
00032     //
00033     //  CLASS NAME : PersistentStorage
00034     //
00036     class PersistentStorage : public base::ReferenceCounted, private base::NonCopyable
00037     {
00038       friend std::ostream & operator<<( std::ostream & str, const PersistentStorage & obj );
00039       typedef intrusive_ptr<PersistentStorage> Ptr;
00040       typedef intrusive_ptr<const PersistentStorage> constPtr;
00041     public:
00043       PersistentStorage();
00045       ~PersistentStorage();
00046       void doTest();
00047 
00048     public:
00053        void init(const Pathname &root);
00054 
00058        bool isInitialized() const;
00059 
00063        Date timestamp() const;
00064        
00068       void storeObject( ResObject::constPtr resolvable );
00072       void deleteObject( ResObject::constPtr resolvable );
00076       std::list<ResObject::Ptr> storedObjects() const;
00080       std::list<ResObject::Ptr> storedObjects(const Resolvable::Kind kind) const;
00085       std::list<ResObject::Ptr> storedObjects(const Resolvable::Kind kind, const std::string & name, bool partial_match = false) const;
00087       // Resolvables Flags API
00089       public:
00093       void setObjectFlag( ResObject::constPtr resolvable, const std::string &flag );
00097       void removeObjectFlag( ResObject::constPtr resolvable, const std::string &flag );
00101       std::set<std::string> objectFlags( ResObject::constPtr resolvable ) const;
00105       bool doesObjectHasFlag( ResObject::constPtr resolvable, const std::string &flag ) const;
00106 
00108       // Named Flags API
00110       public:
00111       void setFlag( const std::string &key, const std::string &flag );
00112       void removeFlag( const std::string &key, const std::string &flag );
00113       std::set<std::string> flags( const std::string &key ) const;
00114       bool hasFlag( const std::string &key, const std::string &flag ) const;
00115 
00116     private:
00117       class Private;
00118       shared_ptr<Private> d;
00119     };
00121 
00122     std::ostream & operator<<( std::ostream & str, const PersistentStorage & obj );
00123 
00125   } // namespace storage
00128 } // namespace zypp
00130 #endif // ZYPP_TARGET_PERSISTENTSTORAGE_H

Generated on Tue Sep 25 19:23:09 2007 for libzypp by  doxygen 1.5.3