#include <fstream>
#include <string>
-#include "zypp/base/ExternalDataSource.h"
-#include "zypp/base/Logger.h"
-#include "zypp/media/Mount.h"
-#include "zypp/media/MediaException.h"
+#include <zypp/base/ExternalDataSource.h>
+#include <zypp/base/Logger.h>
+#include <zypp/media/Mount.h>
+#include <zypp/media/MediaException.h>
-#include "zypp/PathInfo.h"
+#include <zypp/PathInfo.h>
+
+using std::endl;
#ifndef N_
#define N_(STR) STR
#endif
-using namespace std;
namespace zypp {
namespace media {
ZYPP_THROW(MediaMountException("Mounting media failed", source, target));
}
- string value;
- string output = process->receiveLine();
+ std::string value;
+ std::string output = process->receiveLine();
// parse error messages
while ( output.length() > 0)
{
- string::size_type ret;
+ std::string::size_type ret;
// extract \n
ret = output.find_first_of ( "\n" );
- if ( ret != string::npos )
+ if ( ret != std::string::npos )
{
value.assign ( output, 0, ret );
}
DBG << "stdout: " << value << endl;
- if ( value.find ( "is already mounted on" ) != string::npos )
+ if ( value.find ( "is already mounted on" ) != std::string::npos )
{
err = "Media already mounted";
}
- else if ( value.find ( "ermission denied" ) != string::npos )
+ else if ( value.find ( "ermission denied" ) != std::string::npos )
{
err = "Permission denied";
}
- else if ( value.find ( "wrong fs type" ) != string::npos )
+ else if ( value.find ( "wrong fs type" ) != std::string::npos )
{
err = "Invalid filesystem on media";
}
- else if ( value.find ( "No medium found" ) != string::npos )
+ else if ( value.find ( "No medium found" ) != std::string::npos )
{
err = "No medium found";
}
- else if ( value.find ( "Not a directory" ) != string::npos )
+ else if ( value.find ( "Not a directory" ) != std::string::npos )
{
if( filesystem == "nfs" || filesystem == "nfs4" )
{
ZYPP_THROW(MediaUnmountException("E_mount_failed", path));
}
- string value;
- string output = process->receiveLine();
+ std::string value;
+ std::string output = process->receiveLine();
// parse error messages
while ( output.length() > 0)
{
- string::size_type ret;
+ std::string::size_type ret;
// extract \n
ret = output.find_first_of ( "\n" );
- if ( ret != string::npos )
+ if ( ret != std::string::npos )
{
value.assign ( output, 0, ret );
}
DBG << "stdout: " << value << endl;
- // if ( value.find ( "not mounted" ) != string::npos )
+ // if ( value.find ( "not mounted" ) != std::string::npos )
// {
// err = Error::E_already_mounted;
// }
- if ( value.find ( "device is busy" ) != string::npos )
+ if ( value.find ( "device is busy" ) != std::string::npos )
{
err = "Device is busy";
}