- Create the cache directly from the schema (installed) file.
[platform/upstream/libzypp.git] / zypp / Script.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Script.h
10  *
11 */
12 #ifndef ZYPP_SCRIPT_H
13 #define ZYPP_SCRIPT_H
14
15 #include "zypp/ResObject.h"
16 #include "zypp/detail/ScriptImplIf.h"
17
18 ///////////////////////////////////////////////////////////////////
19 namespace zypp
20 { /////////////////////////////////////////////////////////////////
21
22   ///////////////////////////////////////////////////////////////////
23   //
24   //    CLASS NAME : Script
25   //
26   /** Class representing an update script.
27   */
28   class Script : public ResObject
29   {
30   public:
31     typedef detail::ScriptImplIf     Impl;
32     typedef Script                   Self;
33     typedef ResTraits<Self>          TraitsType;
34     typedef TraitsType::PtrType      Ptr;
35     typedef TraitsType::constPtrType constPtr;
36
37   public:
38     /** Get the script to perform the change */
39     Pathname do_script() const;
40     /** Get the script to undo the change */
41     Pathname undo_script() const ;
42     /** Check whether script to undo the change is available */
43     bool undo_available() const;
44
45   protected:
46     /** Ctor */
47     Script( const NVRAD & nvrad_r );
48     /** Dtor */
49     virtual ~Script();
50
51   private:
52     /** Access implementation */
53     virtual Impl & pimpl() = 0;
54     /** Access implementation */
55     virtual const Impl & pimpl() const = 0;
56   };
57
58   /////////////////////////////////////////////////////////////////
59 } // namespace zypp
60 ///////////////////////////////////////////////////////////////////
61 #endif // ZYPP_SCRIPT_H