yast2-storage

ProcMounts.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) [2004-2010] 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 PROC_MOUNTS_H
00024 #define PROC_MOUNTS_H
00025 
00026 #include <string>
00027 #include <list>
00028 #include <map>
00029 
00030 #include "storage/EtcFstab.h"
00031 
00032 namespace storage
00033 {
00034     using std::list;
00035     using std::map;
00036     using std::multimap;
00037 
00038     class SystemCmd;
00039 
00040     class ProcMounts
00041     {
00042     public:
00043 
00044         ProcMounts();
00045 
00046         void reload();
00047 
00048         string getMount(const string& device) const;
00049         string getMount(const list<string>& devices) const;
00050 
00051         list<string> getAllMounts(const string& device) const;
00052         list<string> getAllMounts(const list<string>& devices) const;
00053 
00054         map<string, string> allMounts() const;
00055 
00056         list<FstabEntry> getEntries() const;
00057 
00058     protected:
00059 
00060         bool isBind(SystemCmd& mt, const string& dir) const;
00061 
00062         typedef multimap<string, FstabEntry>::const_iterator const_iterator;
00063 
00064         multimap<string, FstabEntry> data;
00065 
00066     };
00067 
00068 }
00069 
00070 #endif