rawCachePath -> metadataPath
[platform/upstream/libzypp.git] / zypp / ZConfig.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/ZConfig.cc
10  *
11 */
12 #include <iostream>
13 #include "zypp/base/Logger.h"
14
15 #include "zypp/ZConfig.h"
16 #include "zypp/ZYppFactory.h"
17
18 using std::endl;
19
20 ///////////////////////////////////////////////////////////////////
21 namespace zypp
22 { /////////////////////////////////////////////////////////////////
23
24   ///////////////////////////////////////////////////////////////////
25   //
26   //    CLASS NAME : ZConfig::Impl
27   //
28   /** ZConfig implementation.
29   */
30   class ZConfig::Impl
31   {
32     public:
33       Impl()
34       {}
35
36       ~Impl()
37       {}
38
39     public:
40
41   };
42   ///////////////////////////////////////////////////////////////////
43
44   ///////////////////////////////////////////////////////////////////
45   //
46   //    METHOD NAME : ZConfig::instance
47   //    METHOD TYPE : ZConfig &
48   //
49   ZConfig & ZConfig::instance()
50   {
51     static ZConfig _instance; // The singleton
52     return _instance;
53   }
54
55   ///////////////////////////////////////////////////////////////////
56   //
57   //    METHOD NAME : ZConfig::ZConfig
58   //    METHOD TYPE : Ctor
59   //
60   ZConfig::ZConfig()
61   : _pimpl( new Impl )
62   {
63     MIL << "ZConfig singleton created." << endl;
64   }
65
66   ///////////////////////////////////////////////////////////////////
67   //
68   //    METHOD NAME : ZConfig::~ZConfig
69   //    METHOD TYPE : Dtor
70   //
71   ZConfig::~ZConfig( )
72   {}
73
74   ///////////////////////////////////////////////////////////////////
75 #warning change methods to use the singleton
76
77   ///////////////////////////////////////////////////////////////////
78   //
79   //    METHOD NAME : ZConfig::systemArchitecture
80   //    METHOD TYPE : Arch
81   //
82   Arch ZConfig::systemArchitecture() const
83   {
84     return getZYpp()->architecture();
85   }
86
87   ///////////////////////////////////////////////////////////////////
88   //
89   //    METHOD NAME : ZConfig::defaultTextLocale
90   //    METHOD TYPE : Locale
91   //
92   Locale ZConfig::defaultTextLocale() const
93   {
94     return getZYpp()->getTextLocale();
95   }
96
97   Pathname ZConfig::defaultRepoMetadataPath() const
98   {
99     return Pathname("/var/lib/zypp/cache/raw");
100   }
101
102   Pathname ZConfig::defaultRepoCachePath() const
103   {
104     return Pathname("/var/lib/zypp/cache");
105   }
106
107   Pathname ZConfig::defaultKnownReposPath() const
108   {
109     return Pathname("/etc/zypp/repos.d");
110   }
111
112   const std::string & ZConfig::cacheDBSplitJoinSeparator() const
113   {
114     static std::string s("!@$");
115     return s;
116   }
117
118   /////////////////////////////////////////////////////////////////
119 } // namespace zypp
120 ///////////////////////////////////////////////////////////////////