whitespace.
[lyx.git] / src / Author.h
blob0f1e49e7a7ee8fd209c9c8af6e4e6371a8d88128
1 // -*- C++ -*-
2 /**
3 * \file Author.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author John Levon
9 * Full author contact details are available in file CREDITS.
12 #ifndef AUTHOR_H
13 #define AUTHOR_H
15 #include "support/docstring.h"
17 #include <map>
20 namespace lyx {
22 class Author {
23 public:
24 ///
25 Author() {}
26 ///
27 Author(docstring const & name, docstring const & email)
28 : name_(name), email_(email), used_(true) {}
29 ///
30 docstring name() const { return name_; }
31 ///
32 docstring email() const { return email_; }
33 ///
34 void setUsed(bool u) const { used_ = u; }
35 ///
36 bool used() const { return used_; }
37 ///
38 friend std::istream & operator>>(std::istream & os, Author & a);
40 private:
41 /// The author's name
42 docstring name_;
43 /// The author's email address
44 docstring email_;
45 ///
46 mutable bool used_;
50 class AuthorList {
51 public:
52 ///
53 AuthorList();
54 ///
55 int record(Author const & a);
56 ///
57 void record(int id, Author const & a);
58 ///
59 Author const & get(int id) const;
60 ///
61 typedef std::map<int, Author> Authors;
62 ///
63 Authors::const_iterator begin() const;
64 ///
65 Authors::const_iterator end() const;
66 ///
67 private:
68 ///
69 int last_id_;
70 ///
71 Authors authors_;
74 bool operator==(Author const & l, Author const & r);
76 std::ostream & operator<<(std::ostream & os, Author const & a);
78 std::istream & operator>>(std::istream & os, Author & a);
81 } // namespace lyx
83 #endif // AUTHOR_H