libzypp  12.16.5
Mount.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 // -*- C++ -*-
14 
15 #ifndef ZYPP_MEDIA_MOUNT_H
16 #define ZYPP_MEDIA_MOUNT_H
17 
18 #include <set>
19 #include <map>
20 #include <string>
21 #include <iosfwd>
22 
23 #include "zypp/ExternalProgram.h"
24 #include "zypp/KVMap.h"
25 
26 namespace zypp {
27  namespace media {
28 
29 
34  struct MountEntry
35  {
36  MountEntry(const std::string &source,
37  const std::string &target,
38  const std::string &fstype,
39  const std::string &options,
40  const int dumpfreq = 0,
41  const int passnum = 0)
42  : src(source)
43  , dir(target)
44  , type(fstype)
45  , opts(options)
46  , freq(dumpfreq)
47  , pass(passnum)
48  {}
49 
50  std::string src;
51  std::string dir;
52  std::string type;
53  std::string opts;
54  int freq;
55  int pass;
56  };
57 
61  typedef std::vector<MountEntry> MountEntries;
62 
64  std::ostream & operator<<( std::ostream & str, const MountEntry & obj );
65 
69  class Mount
70  {
71  public:
72 
78 
83 
84  public:
85 
89  Mount();
90 
94  ~Mount();
95 
109  void mount ( const std::string& source,
110  const std::string& target,
111  const std::string& filesystem,
112  const std::string& options,
113  const Environment& environment = Environment() );
114 
122  void umount (const std::string& path);
123 
124  public:
125 
137  static MountEntries
138  getEntries(const std::string &mtab = "");
139 
140  private:
141 
145 
152  void run( const char *const *argv, const Environment& environment,
155 
156  void run( const char *const *argv,
159  Environment notused;
160  run( argv, notused, stderr_disp );
161  }
162 
166  int Status();
167 
170  void Kill();
171 
172 
176  };
177 
178 
179  } // namespace media
180 } // namespace zypp
181 
182 #endif