00001 #ifndef LVM_LV_H
00002 #define LVM_LV_H
00003
00004 #include <map>
00005
00006 #include "y2storage/Dm.h"
00007
00008 namespace storage
00009 {
00010
00011 class LvmVg;
00012
00013 class LvmLv : public Dm
00014 {
00015 public:
00016 LvmLv( const LvmVg& d, const string& name, unsigned long le,
00017 const string& uuid, const string& status, const string& alloc );
00018 LvmLv( const LvmVg& d, const string& name, unsigned long le,
00019 unsigned stripe );
00020 LvmLv( const LvmVg& d, const LvmLv& l );
00021
00022 virtual ~LvmLv();
00023 void setUuid( const string& uuid ) { vol_uuid=uuid; }
00024 void setStatus( const string& s ) { status=s; }
00025 void setAlloc( const string& a ) { allocation=a; }
00026 friend std::ostream& operator<< (std::ostream& s, const LvmLv &p );
00027 virtual void print( std::ostream& s ) const { s << *this; }
00028 string removeText( bool doing ) const;
00029 string createText( bool doing ) const;
00030 string formatText( bool doing ) const;
00031 string resizeText( bool doing ) const;
00032 void getInfo( storage::LvmLvInfo& info ) const;
00033 bool equalContent( const LvmLv& rhs ) const;
00034 void logDifference( const LvmLv& d ) const;
00035
00036 protected:
00037 void init( const string& name );
00038 virtual const string shortPrintedName() const { return( "Lv" ); }
00039 LvmLv& operator=( const LvmLv& );
00040
00041 string vol_uuid;
00042 string status;
00043 string allocation;
00044 mutable storage::LvmLvInfo info;
00045 };
00046
00047 }
00048
00049 #endif