added a hint to enable all requested repos
[platform/upstream/libzypp.git] / zypp / ZConfig.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/ZConfig.h
10  *
11 */
12 #ifndef ZYPP_ZCONFIG_H
13 #define ZYPP_ZCONFIG_H
14
15 #include <iosfwd>
16
17 #include "zypp/base/Deprecated.h"
18
19 #include "zypp/base/NonCopyable.h"
20 #include "zypp/base/PtrTypes.h"
21
22 #include "zypp/Arch.h"
23 #include "zypp/Locale.h"
24 #include "zypp/Pathname.h"
25
26 ///////////////////////////////////////////////////////////////////
27 namespace zypp
28 { /////////////////////////////////////////////////////////////////
29
30   ///////////////////////////////////////////////////////////////////
31   //
32   //    CLASS NAME : ZConfig
33   //
34   /** Interim helper class to collect global options and settings.
35    * Use it to avoid hardcoded values and calls to getZYpp() just
36    * to retrieve some value like architecture, languages or tmppath.
37    *
38    * It reads /etc/zypp/zypp.conf, the filename can be overridden by
39    * setting the ZYPP_CONF environment variable to a different file.
40    *
41    * \ingroup Singleton
42   */
43   class ZConfig : private base::NonCopyable
44   {
45     public:
46       /** Singleton ctor */
47       static ZConfig & instance();
48
49     public:
50
51       /** The autodetected system architecture. */
52       static Arch defaultSystemArchitecture();
53
54       /** The system architecture zypp uses. */
55       Arch systemArchitecture() const;
56
57       /** Override the zypp system architecture.
58        * This is useful for test scenarious. <b>But be warned</b>, zypp does
59        * not expect the system architecture to change at runtime. So
60        * set it at the verry beginning before you acess any other
61        * zypp component.
62       */
63       void setSystemArchitecture( const Arch & arch_r );
64
65       /** Reset the zypp system architecture to the default. */
66       void resetSystemArchitecture()
67       { setSystemArchitecture( defaultSystemArchitecture() ); }
68
69     public:
70       /** The autodetected prefered locale for translated texts.
71        */
72       static Locale defaultTextLocale();
73
74       /** The locale for translated texts zypp uses.
75        */
76       Locale textLocale() const;
77
78       /** Set the prefered locale for translated texts. */
79       void setTextLocale( const Locale & locale_r );
80
81       /** Reset the locale for translated texts to the default. */
82       void resetTextLocale()
83       { setTextLocale( defaultTextLocale() ); }
84
85     public:
86      /**
87        * Path where the repo metadata is downloaded and kept.
88        */
89       Pathname repoMetadataPath() const;
90
91       /**
92        * Path where the repo packages are downloaded and kept.
93        */
94       Pathname repoPackagesPath() const;
95
96       /**
97        * Path where the processed cache is kept
98        * (this is where zypp.db is located.
99        */
100       Pathname repoCachePath() const;
101
102       /**
103        * Path where the known repositories
104        * .repo files are kept
105        */
106       Pathname knownReposPath() const;
107
108       /**
109        * Separator string for storing/reading sets of strings to/from
110        * metadata cache DB.
111        */
112       const std::string & cacheDBSplitJoinSeparator() const;
113
114       /**
115        * Whether repository urls should be probed.
116        / config option
117        * repo.add.probe
118        */
119       bool repo_add_probe() const;
120
121       /**
122        * Amount of time in minutes that must pass before another refresh.
123        */
124       unsigned repo_refresh_delay() const;
125
126       /** Whether to consider using a patchrpm when downloading a package.
127        * Config option <tt>download.use_patchrpm (true)</tt>
128       */
129       bool download_use_patchrpm() const;
130
131       /** Whether to consider using a deltarpm when downloading a package.
132        * Config option <tt>download.use_deltarpm (true)</tt>
133        */
134       bool download_use_deltarpm() const;
135
136       /**
137        * Directory for equivalent vendor definitions
138        */
139       Pathname vendorPath() const;
140
141       /**
142        * Solver regards required packages,patterns,... only
143        */      
144       bool solver_onlyRequires() const;
145
146       /**
147        * Path where zypp can find or create lock file
148        */
149       Pathname  locksFile() const;
150
151       /**
152        * Whetever locks file should be readed and applied after start
153        */
154       bool apply_locks_file() const;
155
156      /**
157        * Path where update scripts are stored
158        */
159       Pathname updateScriptsPath() const;
160
161     public:
162       class Impl;
163       /** Dtor */
164       ~ZConfig();
165     private:
166       friend class Impl;
167       /** Default ctor. */
168       ZConfig();
169       /** Pointer to implementation */
170       RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
171   };
172   ///////////////////////////////////////////////////////////////////
173
174   /////////////////////////////////////////////////////////////////
175 } // namespace zypp
176 ///////////////////////////////////////////////////////////////////
177 #endif // ZYPP_ZCONFIG_H