00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef mount_h
00024 #define mount_h
00025 #include <set>
00026 #include <map>
00027 #include <string>
00028
00029 #include <y2util/KVMap.h>
00030 #include <y2util/ExternalProgram.h>
00031
00032 #include <y2pm/MediaError.h>
00033
00038 class Mount
00039 {
00040 public:
00041
00045 typedef MediaError Error;
00046
00051 typedef ExternalProgram::Environment Environment;
00052
00056 typedef KVMap<_KVMap::CharSep<'=',','> > Options;
00057
00058 public:
00059
00063 Mount();
00064
00068 ~Mount();
00069
00080 PMError mount ( const std::string& source,
00081 const std::string& target,
00082 const std::string& filesystem,
00083 const std::string& options,
00084 const Environment& environment = Environment() );
00085
00090 PMError umount (const std::string& path);
00091
00092 private:
00093
00096 ExternalProgram *process;
00097
00104 void run( const char *const *argv, const Environment& environment,
00105 ExternalProgram::Stderr_Disposition stderr_disp =
00106 ExternalProgram::Stderr_To_Stdout);
00107
00108 void run( const char *const *argv,
00109 ExternalProgram::Stderr_Disposition stderr_disp =
00110 ExternalProgram::Stderr_To_Stdout) {
00111 Environment notused;
00112 run( argv, notused, stderr_disp );
00113 }
00114
00118 int Status();
00119
00122 void Kill();
00123
00124
00127 int exit_code;
00128 };
00129
00130 #endif