1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/repo/ScriptProvider.h
12 #ifndef ZYPP_REPO_SCRIPTPROVIDER_H
13 #define ZYPP_REPO_SCRIPTPROVIDER_H
17 #include "zypp/base/NonCopyable.h"
18 #include "zypp/base/PtrTypes.h"
20 #include "zypp/repo/RepoProvideFile.h"
21 #include "zypp/ManagedFile.h"
22 #include "zypp/ResTraits.h"
24 ///////////////////////////////////////////////////////////////////
26 { /////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////
29 { /////////////////////////////////////////////////////////////////
31 class RepoMediaAccess;
33 ///////////////////////////////////////////////////////////////////
35 // CLASS NAME : ScriptProvider
38 class ScriptProvider : private base::NonCopyable
42 ScriptProvider( repo::RepoMediaAccess & access_r );
47 /** Provide a script in a local file.*/
48 ManagedFile provideScript( const Script_constPtr & script_r, bool do_r ) const
49 { return( do_r ? provideDoScript( script_r ) : provideUndoScript( script_r ) ); }
51 /** Provide the do-script in a local file.
52 * Returns an empty path if no script is available.
54 ManagedFile provideDoScript( const Script_constPtr & script_r ) const;
56 /** Provide the do-script in a local file.
57 * Returns an empty path if no script is available.
59 ManagedFile provideUndoScript( const Script_constPtr & script_r ) const;
62 RepoMediaAccess & _access;
64 ///////////////////////////////////////////////////////////////////
66 /////////////////////////////////////////////////////////////////
68 ///////////////////////////////////////////////////////////////////
69 /////////////////////////////////////////////////////////////////
71 ///////////////////////////////////////////////////////////////////
72 #endif // ZYPP_REPO_SCRIPTPROVIDER_H