00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00009 00010 #ifndef ZYPP_CacheInitializer_H 00011 #define ZYPP_CacheInitializer_H 00012 00013 #include <iosfwd> 00014 #include <string> 00015 00016 #include "zypp/base/PtrTypes.h" 00017 #include "zypp/base/ReferenceCounted.h" 00018 #include "zypp/base/NonCopyable.h" 00019 #include "zypp/Pathname.h" 00020 #include "zypp/cache/sqlite3x/sqlite3x.hpp" 00021 00022 #define ZYPP_CACHE_SCHEMA_VERSION 1006 00023 00025 namespace zypp 00026 { 00027 00028 namespace cache 00029 { 00030 00032 // 00033 // CLASS NAME : CacheInitializer 00034 // 00035 class CacheInitializer 00036 { 00037 friend std::ostream & operator<<( std::ostream & str, const CacheInitializer & obj ); 00038 00039 public: 00044 CacheInitializer( const Pathname &root_r, const Pathname &db_file ); 00045 virtual ~CacheInitializer(); 00046 00053 bool justInitialized() const; 00054 00062 bool justReinitialized() const; 00063 00064 protected: 00065 bool tablesCreated() const; 00066 void createTables(); 00068 virtual std::ostream & dumpOn( std::ostream & str ) const; 00069 private: 00071 class Impl; 00073 RW_pointer<Impl> _pimpl; 00074 }; 00076 00078 inline std::ostream & operator<<( std::ostream & str, const CacheInitializer & obj ) 00079 { return obj.dumpOn( str ); } 00080 00081 00083 } // namespace cache 00086 } // namespace zypp 00088 #endif // ZYPP_SOURCE_CacheInitializer_H
1.5.3