]> git.lyx.org Git - lyx.git/blob - src/author.h
oops again! hopefully this works now. Time to go to bed
[lyx.git] / src / author.h
1 /**
2  * \file author.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #ifndef AUTHOR_H
12 #define AUTHOR_H
13
14 #include <map>
15 #include <iosfwd>
16
17 #include "LString.h"
18  
19 class Author {
20 public:
21         Author() {}
22  
23         Author(string n, string e)
24                 : name_(n), email_(e) {}
25
26         string const name() const {
27                 return name_;
28         }
29
30         string const email() const {
31                 return email_;
32         }
33  
34         friend  std::istream & operator>>(std::istream & os, Author & a);
35
36 private:
37         string name_;
38
39         string email_;
40 };
41  
42
43 class AuthorList {
44 public:
45         int record(Author const & a);
46
47         void record(int id, Author const & a);
48  
49         Author const & get(int id);
50
51         typedef std::map<int, Author> Authors;
52  
53         Authors::const_iterator begin() const;
54
55         Authors::const_iterator end() const;
56
57 private:
58         Authors authors_;
59 };
60  
61 bool operator==(Author const & l, Author const & r);
62  
63 std::ostream & operator<<(std::ostream & os, Author const & a); 
64  
65 std::istream & operator>>(std::istream & os, Author & a); 
66  
67 #endif // AUTHOR_H