Added Locale
[platform/upstream/libzypp.git] / zypp / NeedAType.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/NeedAType.h
10  *
11 */
12 #ifndef ZYPP_NEEDATYPE_H
13 #define ZYPP_NEEDATYPE_H
14
15 #include <iosfwd>
16 #include <map>
17 #include <list>
18 #include <string>
19 #include "zypp/Locale.h"
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24   /** \defgroup NEEDATYPE Wishlist of types
25
26    Whenever you find something that might be worth being a
27    type, and not just an \c unsigned or \c string. Keep it here.
28
29    Start with a resonable \c typedef or \c class draft, so you
30    can start using the type within the implementation. If you're
31    in need for interface methods, add them to the draft. Think about
32    the interface and expected behaviour, but implement \b here just
33    as much as you actually need.
34
35    Goal is to provide a real class for it, or to find out that a
36    typedef is sufficient, ot the type is not needed anyway.
37
38    If you already implemented something which would fit into this
39    group, but don't want to move it here, put doxygens
40    \code \ingroup NEEDATYPE \endcode tag in it's comment. So it will
41    at least appear in the doc.
42
43    \note Don't put stuff here, that's (almost) ready to use. This is
44    not meant to be a convenience include. Goal is to have this file empty.
45   */
46   //@{
47
48
49   /** Single line of (human readable) text.
50   probabely sufficient as typedef. we may use it to classify the
51   various strings and string lists within resolvable and other classes.
52   More a hint to the UI describing the purpose of the string. */
53   typedef std::string Label;
54
55   /** Single line of (human readable) text. See Label. A description would
56    Text, while a a packages file list would be list<string> */
57   typedef std::list<std::string> Text;
58
59   /** Offer a License text and methods to remember confirmation. */
60   typedef std::list<std::string> License;
61
62   /** An rpm package group value. Also provide acces to a
63    * (singleton) tree like group hierarchy which contains
64    * all existing groups. No more need to fiddle with YStringTreeItem
65    * classes and forgetting to add parsed groups there for use in the UI.
66    * PackageGroup can be selforganizing.
67   */
68   typedef std::string PackageGroup;
69
70   /** Candidate for string unification? */
71   typedef std::list<std::string> PackageKeywords;
72
73   /** Vendor. Worth a typedef. Maybe a class unifying the strings. */
74   typedef std::string Vendor;
75
76   /** Handle data depending on a locale. Translated strings, maybe
77    other too. */
78   template<class _Val>
79     struct MultiLocale : public std::map<Locale,_Val>
80     {};
81
82   /** stream reading compessed or uncompress files */
83   typedef std::ifstream ifgzstream;
84
85   /** stream writing compessed or uncompress files */
86   typedef std::ofstream ofgzstream;
87
88   //@}
89   /////////////////////////////////////////////////////////////////
90 } // namespace zypp
91 ///////////////////////////////////////////////////////////////////
92 #endif // ZYPP_NEEDATYPE_H