EtcRaidtab.h

Go to the documentation of this file.
00001 #ifndef ETC_RAIDTAB_H
00002 #define ETC_RAIDTAB_H
00003 
00004 #include <string>
00005 #include <map>
00006 
00007 namespace storage
00008 {
00009 
00010 class AsciiFile;
00011 
00012 class EtcRaidtab
00013     {
00014     public:
00015         EtcRaidtab( const string& prefix="" );
00016         ~EtcRaidtab();
00017         void updateEntry( unsigned num, const std::list<string>& entries,
00018                           const string&, const std::list<string>& devs );
00019         void removeEntry( unsigned num );
00020     protected:
00021         struct entry
00022             {
00023             entry() { first=last=0; }
00024             entry( unsigned f, unsigned l ) { first=f; last=l; }
00025             unsigned first;
00026             unsigned last;
00027             friend std::ostream& operator<< (std::ostream& s, const entry &v );
00028             };
00029         friend std::ostream& operator<< (std::ostream& s, const entry &v );
00030 
00031         void updateMdadmFile();
00032         void buildMdadmMap();
00033 
00034         Regex *whitespace;
00035         Regex *comment;
00036         string mdadmname;
00037         int mdadm_dev_line;
00038         std::map<unsigned,entry> mtab;
00039         AsciiFile* mdadm;
00040     };
00042 
00043 inline std::ostream& operator<< (std::ostream& s, const EtcRaidtab::entry& v )
00044     {
00045     s << "first=" << v.first << " last=" << v.last;
00046     return( s );
00047     }
00048 
00049 }
00050 
00051 #endif

Generated on Tue Nov 28 17:50:00 2006 for yast2-storage by  doxygen 1.5.0