00001 #ifndef LOOP_H 00002 #define LOOP_H 00003 00004 #include "y2storage/Volume.h" 00005 00006 namespace storage 00007 { 00008 class LoopCo; 00009 class ProcPart; 00010 00011 class Loop : public Volume 00012 { 00013 public: 00014 Loop( const LoopCo& d, const string& LoopDev, const string& LoopFile, 00015 ProcPart& ppart ); 00016 Loop( const LoopCo& d, const string& file, bool reuseExisting, 00017 unsigned long long sizeK ); 00018 Loop( const LoopCo& d, const Loop& d ); 00019 virtual ~Loop(); 00020 const string& loopFile() const { return lfile; } 00021 void setLoopFile( const string& file ); 00022 bool getReuse() { return( reuseFile ); } 00023 void setReuse( bool reuseExisting ); 00024 void setDelFile( bool val=true ) { delFile=val; } 00025 bool removeFile(); 00026 bool createFile(); 00027 string lfileRealPath() const; 00028 friend std::ostream& operator<< (std::ostream& s, const Loop& l ); 00029 00030 virtual void print( std::ostream& s ) const { s << *this; } 00031 string removeText( bool doing ) const; 00032 string createText( bool doing ) const; 00033 string formatText( bool doing ) const; 00034 00035 void getInfo( storage::LoopInfo& info ) const; 00036 bool equalContent( const Loop& rhs ) const; 00037 void logDifference( const Loop& d ) const; 00038 static unsigned loopMajor(); 00039 00040 static bool notDeleted( const Loop& l ) { return( !l.deleted() ); } 00041 00042 protected: 00043 void init(); 00044 void checkReuse(); 00045 static void getLoopMajor(); 00046 Loop& operator=( const Loop& ); 00047 00048 string lfile; 00049 bool reuseFile; 00050 bool delFile; 00051 00052 static unsigned loop_major; 00053 mutable storage::LoopInfo info; 00054 }; 00055 00056 } 00057 00058 #endif
1.5.0