1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaManager.h
12 #ifndef ZYPP_MEDIA_MEDIAMANAGER_H
13 #define ZYPP_MEDIA_MEDIAMANAGER_H
15 #include "zypp/media/MediaAccess.h"
17 #include "zypp/APIConfig.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/Pathname.h"
26 //////////////////////////////////////////////////////////////////////
28 { ////////////////////////////////////////////////////////////////////
30 ////////////////////////////////////////////////////////////////////
32 { //////////////////////////////////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////
36 typedef zypp::RW_pointer<MediaAccess> MediaAccessRef;
39 typedef MediaAccessId MediaId;
40 typedef unsigned int MediaNr;
43 ///////////////////////////////////////////////////////////////////
44 // forward declaration
46 class MediaManager_Impl;
48 ///////////////////////////////////////////////////////////////////
50 // CLASS NAME : MediaVerifierBase
53 * Interface to implement a media verifier.
55 class MediaVerifierBase //: private zypp::NonCopyable
66 * Returns a string with some info about the verifier.
67 * By default, the type info name is returned.
73 ** Check if the specified attached media contains
74 ** the desired media (e.g. SLES10 CD1).
77 isDesiredMedia(const MediaAccessRef &ref) = 0;
81 ///////////////////////////////////////////////////////////////////
83 // CLASS NAME : NoVerifier
86 * Dummy default media verifier, which is always happy.
88 class NoVerifier : public MediaVerifierBase
91 NoVerifier(): MediaVerifierBase()
99 * Returns the "zypp::media::NoVerifier" string.
105 ** Don't check if the specified attached media contains
106 ** the desired media number. Always return true.
109 isDesiredMedia(const MediaAccessRef &ref)
117 ///////////////////////////////////////////////////////////////////
119 // CLASS NAME : MediaVerifierRef
122 * A shared reference to the MediaVerifier implementation.
124 typedef zypp::RW_pointer<MediaVerifierBase> MediaVerifierRef;
127 ///////////////////////////////////////////////////////////////////
129 // CLASS NAME : MediaManager
132 * Manages access to the 'physical' media, e.g CDROM drives,
133 * Disk volumes, directory trees, etc, using \ref MediaAccessUrl's.
135 * \note The MediaManager class is just an envelope around an
136 * inner singleton like implementation.<br>
137 * That is, you can create as many managers as you want,
138 * also temporary in a function call.<br>
139 * But <b>don't</b> declare static MediaManager instances,
140 * unless you want to force (mutex) initialization order
143 * \section MediaAccessUrl Media Access Url
144 * The MediaManager uses several media access handlers (backends),
145 * that can be specified by a Media Access URL in its open() method.
147 * All URL's may contain following query parameters, that are
148 * reserved by the Source classes and unused/ignored by the media
150 * - <tt>alias</tt>: A source specific media alias string.
152 * Currently, following access handlers (backends) are implemented:
154 * - \ref MediaDISK_Url
156 * - \ref MediaISO_Url
157 * - \ref MediaDIR_Url
159 * - \ref MediaNFS_Url
160 * - \ref MediaCIFS_Url
161 * - \ref MediaCurl_Url
163 * \subsection MediaCD_Url MediaCD - CD/DVD drives (cd, dvd)
164 * The access handler for media on CD / DVD drives.
166 * - <b>cd</b>: Requires a drive supporting CD media.
167 * - <b>dvd</b>: Prefers a drive supporting DVD media.
171 * "cd:/?devices=/dev/hda,/dev/hdb"
172 * "cd:/subdir?devices=/dev/hda,/dev/hdb"
175 * "dvd:/?devices=/dev/hda,/dev/hdb"
176 * "dvd:/subdir?devices=/dev/hda,/dev/hdb"
178 * Note: You can use either "dvd:/" (just path, no authority)
179 * or "dvd:///" (path and empty authority).
180 * - Query parameters:
181 * - <tt>devices</tt>:
182 * Optional parameter, containing a comma separated list of
183 * block device names to use, e.g.: "/dev/sr0,/dev/sr1".
185 * The device names will be verified using a HAL query. If one
186 * of the provided devices is not usable (not a block device,
187 * or does not support required media type), an exception is
190 * If the devices parameter is not provided (or empty), all
191 * avaliable CD/DVD drives 'detected' using a HAL query. The
192 * preferred drive (used as first drive) is the drive pointed
193 * to by the symlink "/dev/dvd" ("dvd" scheme only) or
196 * A non-empty authority URL component (e.g. containing a host
197 * name) is not allowed.
199 * Mandatory URL component, that specifies a subdirectory on the
200 * CD/DVD, where the desired files are located.
202 * \subsection MediaDISK_Url MediaDISK - HD disk volumes (hd)
203 * The access handler for media on a disk volume (partition).
208 * "hd:/?device=/dev/hda1"
209 * "hd:/subdir?device=/dev/sda1"
210 * "hd:/subdir?device=/dev/sda1&filesystem=reiserfs"
212 * Note: You can use either "hd:/" (just path, no authority)
213 * or "hd:///" (path and empty authority).
214 * - Query parameters:
216 * Mandatory parameter specifying the name of the block device of
217 * the partition to mount.
218 * - <tt>filesystem</tt>:
219 * The name of the filesystem. Defaults to "auto".
221 * A non-empty authority URL component is not allowed.
223 * Mandatory URL component, that specifies a subdirectory on the disk
224 * partition, where the desired files are located.
226 * \subsection MediaDIR_Url MediaDIR - Local directory tree (dir, file)
227 * The access handler to media stored in a local directory tree.
233 * "dir:/directory/name"
234 * "file:/directory/name"
236 * - Query parameters:
239 * A non-empty authority URL component (e.g. containing
240 * a host name) is not allowed.
242 * Mandatory URL component, that specifies a directory, where
243 * the desired files are located.
245 * \subsection MediaISO_Url MediaISO - Loopback ISO images (iso)
246 * The access handler for media in a ISO image (loopback mount).
251 * "iso:/?iso=/path/to/CD1.iso"
252 * "iso:/?iso=CD1.iso&url=dir:/path/to"
254 * "iso:/?iso=CD1.iso&url=nfs://server/path/to/media"
255 * "iso:/?iso=CD1.iso&url=hd:/?device=/dev/hda"
257 * "iso:/subdir?iso=DVD1.iso&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf"
259 * - Query parameters:
261 * Mandatory parameter specifying the name of the iso file.<br>
262 * If the url parameter is missed, the iso parameter has to contain
263 * an absolute iso file name.
265 * Optional parameter specifying the URL to the directory containing
267 * The supported URL schemes are: <i><b>hd</b>, <b>dir</b>,
268 * <b>file</b>, <b>nfs</b>, <b>nfs4</b>, <b>smb</b>, <b>cifs</b>.</i>
270 * Optional parameter specifying the prefered attach point for the
272 * - <tt>filesystem</tt>:
273 * Optional name of the filesystem used in the iso file. Defaults
276 * A non-empty authority URL component is not allowed.
278 * Mandatory URL component, that specifies a subdirectory inside of
279 * the iso file, where the desired files are located.
281 * \subsection MediaNFS_Url MediaNFS - NFS directory tree (nfs)
282 * The access handler for media on NFS exported directory tree.
288 * "nfs://nfs-server/exported/path"
289 * "nfs://nfs-server/exported/path?mountoptions=ro"
290 * "nfs://nfs-server/exported/path&type=nfs4"
291 * "nfs4://nfs-server/exported/path"
293 * - Query parameters:
294 * - <tt>mountoptions</tt>:
295 * The mount options separated by comma ','.
296 * Default is the "ro" option.
297 * - <tt>type=nfs4</tt>:
298 * Whether to mount as nfs4. This is the default for scheme nfs4.
300 * The authority component has to provide a hostname.
301 * Username, password and port are currently ignored.
303 * Mandatory URL component, that specifies the exported
304 * (sub-)directory on the NFS server, where the desired
307 * \subsection MediaCIFS_Url MediaCIFS - CIFS/SMB directory tree (cifs, smb)
308 * The access handler for media in a CIFS/SMB shared directory tree.
314 * "cifs://servername/share/path/on/the/share"
315 * "cifs://username:passwd@servername/share/path/on/the/share?mountoptions=ro"
316 * "cifs://username:passwd@servername/share/path/on/the/share?mountoptions=noguest"
317 * "smb://servername/share/path/on/the/share"
318 * "smb://username:passwd@servername/share/path/on/the/share?mountoptions=ro"
320 * Note: There is no difference between cifs and smb scheme
321 * (any more). In both cases the 'cifs' filesystem is used.
322 * - Query parameters:
323 * - <tt>mountoptions</tt>:
324 * The mount options separated by a comma ','. Default are the
325 * "ro" and "guest" options. Specify "noguest" to turn off
326 * "guest". This is necessary if Samba is configured to reject
328 * - <tt>workgroup</tt> or <tt>domain</tt>:
329 * The name of the workgroup.
330 * - <tt>username</tt>:
331 * Alternative username to username in URL authority.
332 * - <tt>password</tt>:
333 * Alternative password to password in URL authority.
335 * Alternative username (cifs specific variant)
337 * Alternative password (cifs specific variant)
339 * The authority component has to provide a hostname. Optionally
340 * also a username and password.
342 * Mandatory URL component, that specifies the share name with
343 * optional subdirectory, where the desired files are located.
345 * \subsection MediaCurl_Url MediaCurl - FTP/HTTP directory tree (ftp, tftp, http, https)
346 * The access handler to media directory tree on a ftp/http server.
354 * "ftp://server/relative/path/to/media/dir"
355 * "ftp://server/%2fabsolute/path/to/media/dir"
357 * "ftp://user:pass@server/path/to/media/dir"
358 * "ftp://user:pass@server/%2f/home/user/path/to/media/dir"
360 * "http://server/path/on/server"
361 * "http://user:pass@server/path"
362 * "https://user:pass@server/path?proxy=foo&proxyuser=me&proxypass=pw"
364 * Note: The "ftp" url scheme supports absolute and relative
365 * paths to the default ftp server directory
366 * (<a href="http://rfc.net/rfc1738.html">RFC1738, Section 3.2.2</a>).<br>
367 * To use an absolute path, you have to prepend the path with an
368 * additional slash, what results in a "/%2f" combination
369 * (second "/" encoded to "%2f") at the begin of the URL path.
371 * This is important, especially in user authenticated ftp,
372 * where the users home is usually the default directory of the
373 * server (except when the server chroots into the users home
376 * For example, if the user "user" has a home directory
377 * "/home/user", you can use either an URL with a relative path
378 * to the home directory "ftp://user:pass@server/path/to/media"
379 * or the absolute path
380 * "ftp://user:pass@server/%2fhome/user/path/to/media" -- both
381 * URLs points to the same directory on the server.
382 * - Query parameters:
383 * - <tt>cookies</tt>:
384 * Turn off using cookies by setting it to "0" (or false, no, off).
386 * A proxy hostname or hostname and port separated by ':'.
387 * Setting the hostname to '_none_' explicitly disables the use of a
388 * proxy even if configured in /etc/sysconfig/proxy or the environment.
389 * - <tt>proxyport</tt>:
390 * Alternative way to provide the proxy port.
391 * - <tt>proxyuser</tt>:
392 * The proxy username.
393 * - <tt>proxypass</tt>:
394 * The proxy password.
395 * - <tt>ssl_capath</tt>:
396 * The absolute CA directory to use, default is /etc/ssl/certs.
397 * - <tt>ssl_verify</tt>: Flag to modify the ssl verify behaviour.
398 * Valid values are: 'yes', 'no' and a comma separated list of
399 * 'host' and 'peer' flags.
401 * disables ssl verify
403 * enables ssl verify, this is the default
404 * and is equivalent to 'host,peer'.
405 * - 'host': The server is considered the intended one, when the
406 * 'Common Name' field or a 'Subject Alternate Name' field in
407 * the certificate matches the host name in the URL.
408 * - 'peer': Verifies whether the certificate provided by the
409 * server is authentic against the chain of digital signatures
410 * found in <tt>ssl_capath</tt>.
411 * - <tt>ssl_clientcert</tt>
412 * Path to the ssl client certificate for authentication to a repo (CURLOPT_SSLCERT).
413 * - <tt>ssl_clientkey</tt>
414 * Path to the ssl client key for authentication to a repo (CURLOPT_SSLKEY).
415 * - <tt>timeout</tt>:
416 * Transfer timeout in seconds between 0 and 3600, 0 disables
417 * the timeout, default timeout is 180 seconds.
418 * - <tt>auth</tt>: A comma separated list of http authentication
419 * method names to use: 'basic', 'digest', 'ntlm', 'negotiate',
420 * 'spnego', 'gssnego'.
421 * Note, that this list depends on the list of methods supported
422 * by the curl library.
423 * - <tt>mediahandler</tt>: Set the mediahandler for this url
424 * Valid values are: 'curl', 'multicurl'
426 * The authority component has to provide a hostname. Optionally
427 * also a username and password. In case of the 'ftp' scheme,
428 * username and password defaults to 'anonymous' and 'yast2@'.
430 * Mandatory URL component, that specifies the path name on the
431 * server, where the desired files are located.
433 * Proxy settings: If no proxy settings are present in tha URLs
434 * query parameters, the media handler reads the system wide proxy
435 * settings from the <tt>/etc/sysconfig/proxy</tt> file.
436 * If a proxy setting was present, but the proxy password not,
437 * it attempts to read the <tt>proxy-user</tt> variable from the
438 * <tt>~/.curlrc</tt> (<tt>/root/.curlrc</tt>) file.
440 * If no proxy setting was present, then libzypp does not pass any
441 * proxy settings to curl, but curl fallbacks to use the content of
442 * the <tt>http_proxy</tt>, <tt>ftp_proxy</tt>, etc environment
445 * \subsection MediaPlugin_Url MediaPlugin - custom media handler
446 * Media access is delegated to a script located in the libzypp
447 * media plugin directory. The URLs query options are translated
448 * into commandline arguments passed to the script.
453 * "plugin:script?loptv=lvalue&v=optv&lopt=&o&=foo"
454 * \__________/ \____/ \___/ | \_/
455 * __________/__ ____/_ _|_ \ \___
457 * script --loptv "lvalue" -v "optv" --lopt -o -- foo
459 * - Query parameters:
460 * - The URLs query options are translated into commandline
461 * arguments passed to the script.
462 * - \b Note: No option may appear twice, as the <tt>(option,value)</tt>
463 * pairs are stored in a hash.
464 * - \b Note: The order in which the query options are passes to the
465 * script is arbitrary, except for an option with an empty key, which
466 * is translated into <tt>'-- value'</tt> and passed as final option.
467 * - <tt>'c[=[value]]'</tt> ist passed as <tt>'-c [value]'</tt>
468 * - <tt>'word[=[value]]'</tt> ist passed as <tt>'--word [value]'</tt>
469 * - <tt>'[=value]'</tt> ist passed as last args as <tt>'-- [value]'</tt>
470 * - \c script<->libzypp communication:
471 * - \TODO to be documented.
473 class MediaManager: private zypp::base::NonCopyable
477 * Creates a MediaManager envelope instance.
479 * In the case, that the inner implementation is not already
480 * allocated, and the MediaManager constructor was unable to
481 * allocate it, a std::bad_alloc exception is thrown.
483 * All further instances increase the use counter only.
485 * \throws std::bad_alloc
490 * Destroys MediaManager envelope instance.
491 * Decreases the use counter of the inner implementation.
496 * Opens the media access for specified with the url.
498 * If the \p preferred_attach_point parameter does not
499 * point to a usable attach point directory, the media
500 * manager automatically creates a temporary attach
501 * point in a default directory. This default directory
502 * can be changed using setAttachPrefix() function.
504 * Remember to close() each id you've opened and not
505 * need any more. It is like a new and delete!
507 * \param url The \ref MediaAccessUrl.
508 * \param preferred_attach_point The preferred, already
509 * existing directory, where the media should be
511 * \return a new media access id.
512 * \throws std::bad_alloc
513 * \throws MediaException
516 open(const Url &url, const Pathname & preferred_attach_point = "");
519 * Close the media access with specified id.
520 * \param accessId The media access id to close.
523 close(MediaAccessId accessId);
526 * Query if the media access is open / exists.
528 * \param accessId The media access id to query.
529 * \return true, if access id is known and open.
532 isOpen(MediaAccessId accessId) const;
535 * Query the protocol name used by the media access
536 * handler. Similar to url().getScheme().
538 * \param accessId The media access id to query.
539 * \return The protocol name used by the media access
540 * handler, otherwise 'unknown'.
541 * \throws MediaNotOpenException for invalid access id.
544 protocol(MediaAccessId accessId) const;
547 * Hint if files are downloaded or not.
548 * \param accessId The media access id to query.
549 * \return True, if provideFile downloads files.
552 downloads(MediaAccessId accessId) const;
555 * Returns the \ref MediaAccessUrl of the media access id.
557 * \param accessId The media access id to query.
558 * \return The \ref MediaAccessUrl used by the media access id.
559 * \throws MediaNotOpenException for invalid access id.
562 url(MediaAccessId accessId) const;
566 * Add verifier implementation for the specified media id.
567 * By default, the NoVerifier is used.
569 * \param accessId A media access id.
570 * \param verifier The new verifier.
571 * \throws MediaNotOpenException for invalid access id.
574 addVerifier(MediaAccessId accessId,
575 const MediaVerifierRef &verifier);
578 * Remove verifier for specified media id.
579 * It resets the verifier to NoVerifier.
581 * \param accessId A media access id.
582 * \throws MediaNotOpenException for invalid access id.
585 delVerifier(MediaAccessId accessId);
589 * Set or resets the directory name, where the media manager
590 * handlers create their temporary attach points (see open()
592 * It has effect to newly created temporary attach points only.
594 * \param attach_prefix The new prefix for temporary attach
595 * points, or empty pathname to reset to defaults.
596 * \return True on success, false if the \p attach_prefix
597 * parameters contains a path name, that does not
598 * point to a writable directory.
601 setAttachPrefix(const Pathname &attach_prefix);
604 * Attach the media using the concrete handler (checks all devices).
606 * Remember to release() or close() each id you've attached
607 * and not need any more. Attach is like an open of a file!
609 * \param accessId A media access id.
610 * \throws MediaNotOpenException for invalid access id.
613 attach(MediaAccessId accessId);
616 * Release the attached media and optionally eject.
618 * If the \p ejectDev parameter is not empty all other access
619 * id's are released and the specified drive (CD/DVD drive) is
622 * \param accessId A media access id.
623 * \param ejectDev Device to eject. None if empty.
624 * \throws MediaNotOpenException for invalid access id.
627 release(MediaAccessId accessId, const std::string & ejectDev = "");
630 * Release all attached media.
636 * Disconnect a remote media.
638 * This is useful for media which e.g. holds open a connection
639 * to a server like FTP. After calling disconnect() the media
640 * object (attach point) is still valid and files are present.
642 * But after calling disconnect() it's not possible to call
643 * fetch more data using the provideFile() or provideDir()
646 * \param accessId A media access id.
647 * \throws MediaNotOpenException for invalid access id.
650 disconnect(MediaAccessId accessId);
653 * Check if media is attached or not.
655 * \param accessId A media access id.
656 * \return True if media is attached.
657 * \throws MediaNotOpenException for invalid access id.
660 isAttached(MediaAccessId accessId) const;
663 * Returns information if media is on a shared
664 * physical device or not.
666 * \param accessId A media access id.
667 * \return True if it is shared, false if not.
668 * \throws MediaNotOpenException for invalid access id.
671 isSharedMedia(MediaAccessId accessId) const;
674 * Ask the registered verifier if the attached
675 * media is the desired one or not.
677 * \param accessId A media access id.
678 * \return True if media is attached and desired
679 * according to the actual verifier.
680 * \throws MediaNotOpenException for invalid access id.
683 isDesiredMedia(MediaAccessId accessId) const;
686 * Ask the specified verifier if the attached
687 * media is the desired one or not.
689 * \param accessId A media access id.
690 * \param verifier A verifier to use.
691 * \return True if media is attached and desired
692 * according to the specified verifier.
693 * \throws MediaNotOpenException for invalid access id.
696 isDesiredMedia(MediaAccessId accessId,
697 const MediaVerifierRef &verifier) const;
700 * Simple check, based on media's URL scheme, telling whether the
701 * it is possible to physically change the media inside its drive, like
702 * CDs or DVDs. Useful to decide whether to request media change from
705 * \param accessId The media access id.
706 * \return <tt>false</tt> if the media is not changeable,
707 * <tt>true</tt> otherwise.
708 * \throws MediaNotOpenException for invalid access id.
711 isChangeable(MediaAccessId accessId);
714 * Return the local directory that corresponds to medias url,
715 * no matter if media isAttached or not. Files requested will
716 * be available at 'localRoot() + filename' or even better
717 * 'localPath( filename )'
719 * \param accessId A media access id.
720 * \returns The directory name pointing to the media root
721 * in local filesystem or an empty pathname if the
722 * media is not attached.
723 * \throws MediaNotOpenException for invalid access id.
726 localRoot(MediaAccessId accessId) const;
729 * Shortcut for 'localRoot() + pathname', but returns an empty
730 * pathname if media is not attached.
731 * Files provided will be available at 'localPath(filename)'.
733 * \param accessId A media access id.
734 * \param pathname A path name relative to the localRoot().
735 * \returns The directory name in local filesystem pointing
736 * to the desired relative pathname on the media
737 * or an empty pathname if the media is not attached.
738 * \throws MediaNotOpenException for invalid access id.
741 localPath(MediaAccessId accessId, const Pathname & pathname) const;
745 * Provide provide file denoted by relative path below of the
746 * 'attach point' of the specified media and the path prefix
749 * \param accessId The media access id to use.
750 * \param filename The filename to provide, relative to localRoot().
751 * \param expectedFileSize The expected filesize, download will stop if it is exceeded
753 * \throws MediaNotOpenException in case of invalid access id.
754 * \throws MediaNotAttachedException in case, that the media is not attached.
755 * \throws MediaNotDesiredException in case, that the media verification failed.
756 * \throws MediaNotAFileException in case, that the requested filename is not a file.
757 * \throws MediaFileNotFoundException in case, that the requested filenamedoes not exists.
758 * \throws MediaWriteException in case, that the file can't be copied from from remote source.
759 * \throws MediaSystemException in case a system operation fails.
760 * \throws MediaException derived exception, depending on the url (handler).
764 provideFile(MediaAccessId accessId,
765 const Pathname &filename,
766 const ByteCount &expectedFileSize) const;
769 provideFile(MediaAccessId accessId,
770 const Pathname &filename ) const;
773 * FIXME: see MediaAccess class.
776 provideDir(MediaAccessId accessId,
777 const Pathname &dirname) const;
780 * FIXME: see MediaAccess class.
783 provideDirTree(MediaAccessId accessId,
784 const Pathname &dirname) const;
787 * FIXME: see MediaAccess class.
790 releaseFile(MediaAccessId accessId,
791 const Pathname &filename) const;
794 * FIXME: see MediaAccess class.
797 releaseDir(MediaAccessId accessId,
798 const Pathname &dirname) const;
801 * FIXME: see MediaAccess class.
804 releasePath(MediaAccessId accessId,
805 const Pathname &pathname) const;
808 * FIXME: see MediaAccess class.
811 dirInfo(MediaAccessId accessId,
812 std::list<std::string> &retlist,
813 const Pathname &dirname,
814 bool dots = true) const;
817 * FIXME: see MediaAccess class.
820 dirInfo(MediaAccessId accessId,
821 filesystem::DirContent &retlist,
822 const Pathname &dirname,
823 bool dots = true) const;
826 * FIXME: see MediaAccess class.
828 bool doesFileExist(MediaAccessId accessId,
829 const Pathname & filename ) const;
832 * Fill in a vector of detected ejectable devices and the index of the
833 * currently attached device within the vector. The contents of the vector
834 * are the device names (/dev/cdrom and such).
836 * \param accessId Medium id.
837 * \param devices vector to load with the device names
838 * \param index index of the currently used device in the devices vector
841 getDetectedDevices(MediaAccessId accessId,
842 std::vector<std::string> & devices,
843 unsigned int & index) const;
846 setDeltafile(MediaAccessId accessId,
847 const Pathname &filename ) const;
851 * Get the modification time of the /etc/mtab file.
852 * \return Modification time of the /etc/mtab file.
855 getMountTableMTime();
858 * Get current mount entries from /etc/mtab file.
859 * \return Current mount entries from /etc/mtab file.
861 static std::vector<MountEntry>
865 * Check if the specified \p path is useable as
868 * \param path The attach point to check.
869 * \param mtab Whether to check against the mtab, too.
870 * \return True, if it is a directory and there are
871 * no another attach points bellow of it.
874 isUseableAttachPoint(const Pathname &path,
875 bool mtab=true) const;
878 friend class MediaHandler;
882 * Return the attached media reference of the specified
883 * media access id. Used to resolve nested attachments
884 * as used in the MediaISO (iso-loop) handler.
885 * Causes temporary creation of a shared attachment
886 * (increases reference counters on attachedMedia).
887 * \param media A media access id.
890 getAttachedMedia(MediaAccessId &accessId) const;
894 * Called by media handler in while attach() to retrieve
895 * attached media reference matching the specified media
897 * Causes temporary creation of a shared attachment
898 * (increases reference counters on attachedMedia).
899 * \param media The media source reference to search for.
902 findAttachedMedia(const MediaSourceRef &media) const;
906 * Called by media handler in case of relase(eject=true)
907 * to release all access id's using the specified media.
908 * Causes temporary creation of a shared attachment
909 * (increases reference counters on attachedMedia).
910 * \param media The media source reference to release.
913 forceReleaseShared(const MediaSourceRef &media);
917 * Static reference to the implementation (singleton).
919 static zypp::RW_pointer<MediaManager_Impl> m_impl;
923 //////////////////////////////////////////////////////////////////
925 ////////////////////////////////////////////////////////////////////
927 ////////////////////////////////////////////////////////////////////
929 //////////////////////////////////////////////////////////////////////
931 #endif // ZYPP_MEDIA_MEDIAMANAGER_H
934 ** vim: set ts=2 sts=2 sw=2 ai et: