put changelog information to packages
[platform/upstream/libzypp.git] / zypp / Changelog.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Changelog.h
10  *
11 */
12 #ifndef ZYPP_CHANGELOG_H
13 #define ZYPP_CHANGELOG_H
14
15 #include <string>
16 #include <list>
17 #include <iostream>
18
19 using namespace std;
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24
25   ///////////////////////////////////////////////////////////////////
26   //
27   //    CLASS NAME : ChangelogEntry
28   //
29   /** Single entry in a change log
30   */
31   class ChangelogEntry
32   {
33   public:
34     /** Default ctor */
35     ChangelogEntry( const Date & d, 
36                     const std::string & a, 
37                     const std::string & t )
38     : _date( d ), _author( a ), _text( t )
39     {};
40     /** Dtor */
41     ~ChangelogEntry()
42     {}
43     Date date() const { return _date; }
44     std::string author() const { return _author; }
45     std::string text() const { return _text; }
46
47   private:
48     Date _date;
49     std::string _author;
50     std::string _text;
51   };
52
53   typedef std::list<ChangelogEntry> Changelog;
54
55   inline std::ostream & operator<<( std::ostream & out,
56                                     const ChangelogEntry & obj )
57   { 
58     out << obj.date() << " " << obj.author() << endl << obj.text() << endl;
59     return out;
60   }
61
62  
63   ///////////////////////////////////////////////////////////////////
64 } // namespace zypp
65 ///////////////////////////////////////////////////////////////////
66
67 #endif // ZYPP_CHANGELOG_H