TmpPath.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_TMPPATH_H
00013 #define ZYPP_TMPPATH_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/Pathname.h"
00018 #include "zypp/base/PtrTypes.h"
00019 
00020 namespace zypp {
00021   namespace filesystem {
00022 
00024     //
00025     //  CLASS NAME : TmpPath
00038     class TmpPath
00039     {
00040       public:
00044         TmpPath();
00045 
00049         explicit
00050         TmpPath( const Pathname & tmpPath_r );
00051 
00055         virtual
00056         ~TmpPath();
00057 
00062         operator const void *const() const;
00063 
00067         Pathname
00068         path() const;
00069 
00073         operator Pathname() const
00074         { return path(); }
00075 
00076       public:
00081         static const Pathname &
00082         defaultLocation();
00083 
00084       protected:
00085         class Impl;
00086         RW_pointer<Impl> _impl;
00087 
00088     };
00090 
00094     inline std::ostream &
00095     operator<<( std::ostream & str, const TmpPath & obj )
00096     { return str << static_cast<Pathname>(obj); }
00097 
00099 
00101     //
00102     //  CLASS NAME : TmpFile
00116     class TmpFile : public TmpPath
00117     {
00118       public:
00122         explicit
00123         TmpFile( const Pathname & inParentDir_r = defaultLocation(),
00124                  const std::string & prefix_r = defaultPrefix() );
00125 
00133         static TmpFile makeSibling( const Pathname & sibling_r );
00134 
00135       public:
00139         static const std::string &
00140         defaultPrefix();
00141 
00142     };
00144 
00146     //
00147     //  CLASS NAME : TmpDir
00161     class TmpDir : public TmpPath
00162     {
00163       public:
00167         explicit
00168         TmpDir( const Pathname & inParentDir_r = defaultLocation(),
00169                 const std::string & prefix_r = defaultPrefix() );
00170 
00178         static TmpDir makeSibling( const Pathname & sibling_r );
00179 
00180       public:
00184         static const std::string &
00185         defaultPrefix();
00186     };
00188 
00189   } // namespace filesystem
00190 } // namespace zypp
00191 
00192 #endif // ZYPP_TMPPATH_H

Generated on Tue Sep 25 19:23:10 2007 for libzypp by  doxygen 1.5.3