|
yast2-storage
|
00001 /* 00002 * Copyright (c) [2004-2009] Novell, Inc. 00003 * 00004 * All Rights Reserved. 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of version 2 of the GNU General Public License as published 00008 * by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, but WITHOUT 00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 * more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, contact Novell, Inc. 00017 * 00018 * To contact Novell about this file by physical or electronic mail, you may 00019 * find current contact information at www.novell.com. 00020 */ 00021 00022 00023 #ifndef BLKID_H 00024 #define BLKID_H 00025 00026 #include <string> 00027 #include <map> 00028 #include <vector> 00029 00030 #include "storage/StorageInterface.h" 00031 00032 00033 namespace storage 00034 { 00035 using std::map; 00036 using std::vector; 00037 00038 00039 class Blkid 00040 { 00041 public: 00042 00043 Blkid(); 00044 Blkid(const string& device); 00045 00046 struct Entry 00047 { 00048 Entry() : is_fs(false), fs_type(FSUNKNOWN), fs_uuid(), fs_label(), 00049 is_lvm(false), is_luks(false), luks_uuid() {} 00050 00051 bool is_fs; 00052 FsType fs_type; 00053 string fs_uuid; 00054 string fs_label; 00055 00056 bool is_lvm; 00057 00058 bool is_luks; 00059 string luks_uuid; 00060 }; 00061 00062 friend std::ostream& operator<<(std::ostream& s, const Entry& entry); 00063 00064 bool getEntry(const string& device, Entry& entry) const; 00065 00066 protected: 00067 00068 void parse(const vector<string>& lines); 00069 00070 typedef map<string, Entry>::const_iterator const_iterator; 00071 00072 map<string, Entry> data; 00073 00074 }; 00075 00076 } 00077 00078 00079 #endif
1.7.3