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)
39 os << "\"" << to_utf8(a.name()) << "\" " << to_utf8(a.email());
43 std::istream & operator>>(std::istream & is, Author & a)
48 a.name_ = from_utf8(trim(token(s, '\"', 1)));
49 a.email_ = from_utf8(trim(token(s, '\"', 2)));
54 AuthorList::AuthorList()
60 int AuthorList::record(Author const & a)
62 Authors::const_iterator it(authors_.begin());
63 Authors::const_iterator itend(authors_.end());
65 for (; it != itend; ++it) {
70 authors_[last_id_++] = a;
75 void AuthorList::record(int id, Author const & a)
77 BOOST_ASSERT(unsigned(id) < authors_.size());
83 Author const & AuthorList::get(int id) const
85 Authors::const_iterator it(authors_.find(id));
86 BOOST_ASSERT(it != authors_.end());
91 AuthorList::Authors::const_iterator AuthorList::begin() const
93 return authors_.begin();
97 AuthorList::Authors::const_iterator AuthorList::end() const
99 return authors_.end();