3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
15 #include "support/LAssert.h"
16 #include "support/LOstream.h"
17 #include "support/LIstream.h"
18 #include "support/lstrings.h"
20 bool operator==(Author const & l, Author const & r)
22 return l.name() == r.name() && l.email() == r.email();
26 std::ostream & operator<<(std::ostream & os, Author const & a)
28 os << "\"" << a.name() << "\" " << a.email();
32 std::istream & operator>>(std::istream & is, Author & a)
36 a.name_ = trim(token(s, '\"', 1));
37 a.email_ = trim(token(s, '\"', 2));
42 AuthorList::AuthorList()
48 int AuthorList::record(Author const & a)
50 Authors::const_iterator it(authors_.begin());
51 Authors::const_iterator itend(authors_.end());
53 for (; it != itend; ++it) {
58 authors_[last_id_++] = a;
63 void AuthorList::record(int id, Author const & a)
65 lyx::Assert(unsigned(id) < authors_.size());
71 Author const & AuthorList::get(int id)
73 Authors::const_iterator it(authors_.find(id));
74 lyx::Assert(it != authors_.end());
79 AuthorList::Authors::const_iterator AuthorList::begin() const
81 return authors_.begin();
85 AuthorList::Authors::const_iterator AuthorList::end() const
87 return authors_.end();