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/lstrings.h"
17 #include <boost/assert.hpp>
19 #include "support/std_istream.h"
30 bool operator==(Author const & l, Author const & r)
32 return l.name() == r.name() && l.email() == r.email();
36 std::ostream & operator<<(std::ostream & os, Author const & a)
38 os << "\"" << a.name() << "\" " << a.email();
42 std::istream & operator>>(std::istream & is, Author & a)
46 a.name_ = trim(token(s, '\"', 1));
47 a.email_ = trim(token(s, '\"', 2));
52 AuthorList::AuthorList()
58 int AuthorList::record(Author const & a)
60 Authors::const_iterator it(authors_.begin());
61 Authors::const_iterator itend(authors_.end());
63 for (; it != itend; ++it) {
68 authors_[last_id_++] = a;
73 void AuthorList::record(int id, Author const & a)
75 BOOST_ASSERT(unsigned(id) < authors_.size());
81 Author const & AuthorList::get(int id)
83 Authors::const_iterator it(authors_.find(id));
84 BOOST_ASSERT(it != authors_.end());
89 AuthorList::Authors::const_iterator AuthorList::begin() const
91 return authors_.begin();
95 AuthorList::Authors::const_iterator AuthorList::end() const
97 return authors_.end();