--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/media/MediaSource.cc
+*/
+#include <iostream>
+
+#include "zypp/media/MediaSource.h"
+
+namespace zypp {
+ namespace media {
+
+ std::ostream & operator<<( std::ostream & str, const AttachPoint & obj )
+ {
+ return str << (obj.temp ? "*" : "") << obj.path;
+ }
+
+ std::ostream & operator<<( std::ostream & str, const AttachedMedia & obj )
+ {
+ return str << "media(" << obj.mediaSource << ")attached(" << obj.attachPoint << ")";
+ }
+
+ } // namespace media
+} // namespace zypp
#ifndef ZYPP_MEDIA_MEDIASOURCE_H
#define ZYPP_MEDIA_MEDIASOURCE_H
+#include <iosfwd>
+
#include "zypp/Pathname.h"
#include "zypp/base/String.h"
#include "zypp/base/PtrTypes.h"
bool iown; //!< True, if mounted by media manager.
};
+ /** \relates MediaSource Stream output */
+ inline std::ostream & operator<<( std::ostream & str, const MediaSource & obj )
+ { return str << obj.asString(); }
///////////////////////////////////////////////////////////////////
/**
bool temp; //!< If it was created temporary.
};
+ /** \relates AttachPoint Stream output */
+ inline std::ostream & operator<<( std::ostream & str, const AttachPoint & obj );
///////////////////////////////////////////////////////////////////
typedef zypp::RW_pointer<MediaSource> MediaSourceRef;
AttachPointRef attachPoint;
};
+ /** \relates AttachedMedia Stream output */
+ std::ostream & operator<<( std::ostream & str, const AttachedMedia & obj );
} // namespace media
} // namespace zypp
*
*/
-#include <sys/stat.h>
-#include <stdio.h>
#include <mntent.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
+
+#include <cstdio>
+#include <climits>
+#include <cerrno>
+
#include <iostream>
#include <fstream>
#include <string>
namespace zypp {
namespace media {
+ std::ostream & operator<<( std::ostream & str, const MountEntry & obj )
+ {
+ str << obj.src << " on " << obj.dir << " type " << obj.type;
+ if ( ! obj.opts.empty() )
+ str << " (" << obj.opts << ")";
+ return str;
+ }
+
+
Mount::Mount()
{
process = 0;
#ifndef ZYPP_MEDIA_MOUNT_H
#define ZYPP_MEDIA_MOUNT_H
+
#include <set>
#include <map>
#include <string>
+#include <iosfwd>
#include "zypp/ExternalProgram.h"
#include "zypp/KVMap.h"
int pass; //!< pass number on parallel fsck
};
- /**
+ /** \relates MountEntry
* A vector of mount entries.
*/
typedef std::vector<MountEntry> MountEntries;
+ /** \relates MountEntry Stream output */
+ std::ostream & operator<<( std::ostream & str, const MountEntry & obj );
/**
* @short Interface to the mount program