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
17 #include "support/LAssert.h"
18 #include "support/LOstream.h"
19 #include "support/LIstream.h"
20 #include "support/lstrings.h"
29 bool operator==(Author const & l, Author const & r)
31 return l.name() == r.name() && l.email() == r.email();
35 std::ostream & operator<<(std::ostream & os, Author const & a)
37 os << "\"" << a.name() << "\" " << a.email();
41 std::istream & operator>>(std::istream & is, Author & a)
45 a.name_ = trim(token(s, '\"', 1));
46 a.email_ = trim(token(s, '\"', 2));
47 lyxerr << "Read name " << a.name_ << " email " << a.email_ << endl;
52 int AuthorList::record(Author const & a)
54 Authors::const_iterator it(authors_.begin());
55 Authors::const_iterator itend(authors_.end());
57 for (; it != itend; ++it) {
62 lyxerr[Debug::CHANGES] << "Adding author " << a << endl;
64 authors_[cur_id++] = a;
69 void AuthorList::record(int id, Author const & a)
71 lyx::Assert(id < authors_.size());
77 Author const & AuthorList::get(int id)
79 Authors::const_iterator it(authors_.find(id));
80 lyx::Assert(it != authors_.end());
85 AuthorList::Authors::const_iterator AuthorList::begin() const
87 return authors_.begin();
91 AuthorList::Authors::const_iterator AuthorList::end() const
93 return authors_.end();