[yast-commit] r56448 - in /trunk/storage/libstorage/src: AsciiFile.cc AsciiFile.h Storage.cc Storage.h

Author: aschnell Date: Fri Mar 27 16:20:12 2009 New Revision: 56448 URL: http://svn.opensuse.org/viewcvs/yast?rev=56448&view=rev Log: - added AsciiFile::logContent Modified: trunk/storage/libstorage/src/AsciiFile.cc trunk/storage/libstorage/src/AsciiFile.h trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/Storage.h Modified: trunk/storage/libstorage/src/AsciiFile.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AsciiFile.... ============================================================================== --- trunk/storage/libstorage/src/AsciiFile.cc (original) +++ trunk/storage/libstorage/src/AsciiFile.cc Fri Mar 27 16:20:12 2009 @@ -21,7 +21,7 @@ : Name_C(Name_Cv), remove_empty(remove_empty) { - load(); + reload(); } @@ -29,7 +29,7 @@ : Name_C(Name_Cv), remove_empty(remove_empty) { - load(); + reload(); } @@ -39,7 +39,7 @@ bool -AsciiFile::load() +AsciiFile::reload() { y2mil("loading file " << Name_C); clear(); @@ -89,6 +89,15 @@ } + void + AsciiFile::logContent() const + { + y2mil("content of " << Name_C); + for (vector<string>::const_iterator it = Lines_C.begin(); it != Lines_C.end(); ++it) + y2mil(*it); + } + + void AsciiFile::append( const string& Line_Cv ) { string::size_type Idx_ii; Modified: trunk/storage/libstorage/src/AsciiFile.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AsciiFile.... ============================================================================== --- trunk/storage/libstorage/src/AsciiFile.h (original) +++ trunk/storage/libstorage/src/AsciiFile.h Fri Mar 27 16:20:12 2009 @@ -23,9 +23,11 @@ string name() const { return Name_C; } - bool load(); + bool reload(); bool save(); + void logContent() const; + void append( const string& Line_Cv ); void append( const vector<string>& Lines_Cv ); void insert( unsigned int Before_iv, const string& Line_Cv ); Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc... ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Fri Mar 27 16:20:12 2009 @@ -110,12 +110,7 @@ void Storage::logSystemInfo() const { - ifstream File( "/proc/version" ); - classic(File); - string line; - getline( File, line ); - File.close(); - y2mil( "kernel version:" << line ); + AsciiFile("/proc/version").logContent(); } @@ -4618,19 +4613,17 @@ } -void -Storage::logProcData( const string& l ) -{ - y2mil( "begin:" << l ); - ProcPart t; - AsciiFile md( "/proc/mdstat" ); - for( unsigned i=0; i<md.numLines(); i++ ) - y2mil( "mdstat:" << i+1 << ". line:" << md[i] ); - AsciiFile mo( "/proc/mounts" ); - for( unsigned i=0; i<mo.numLines(); i++ ) - y2mil( "mounts:" << i+1 << ". line:" << mo[i] ); - y2mil( "end" << l ); -} + void + Storage::logProcData(const string& str) const + { + y2mil("begin:" << str); + + AsciiFile("/proc/partitions").logContent(); + AsciiFile("/proc/mdstat").logContent(); + AsciiFile("/proc/mounts").logContent(); + + y2mil("end" << str); + } bool Storage::findVolume( const string& device, ContIterator& c, Modified: trunk/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?... ============================================================================== --- trunk/storage/libstorage/src/Storage.h (original) +++ trunk/storage/libstorage/src/Storage.h Fri Mar 27 16:20:12 2009 @@ -231,7 +231,7 @@ void printInfo(std::ostream& str, const string& name = ""); void logCo(const Container* c) const; void logCo(const string& device); - void logProcData( const string& l="" ); + void logProcData(const string& str = "") const; storage::UsedByType usedBy( const string& dev ); bool usedBy( const string& dev, storage::usedBy& ub ); bool clearUsedBy(const string& dev); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org