]> git.lyx.org Git - lyx.git/blob - src/author.h
"Inter-word Space"
[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         AuthorList();
46
47         int record(Author const & a);
48
49         void record(int id, Author const & a);
50
51         Author const & get(int id);
52
53         typedef std::map<int, Author> Authors;
54
55         Authors::const_iterator begin() const;
56
57         Authors::const_iterator end() const;
58
59 private:
60         int last_id_;
61
62         Authors authors_;
63 };
64
65 bool operator==(Author const & l, Author const & r);
66
67 std::ostream & operator<<(std::ostream & os, Author const & a);
68
69 std::istream & operator>>(std::istream & os, Author & a);
70
71 #endif // AUTHOR_H