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 "support/lassert.h"
22 using namespace lyx::support
;
27 bool operator==(Author
const & l
, Author
const & r
)
29 return l
.name() == r
.name() && l
.email() == r
.email();
33 ostream
& operator<<(ostream
& os
, Author
const & a
)
36 os
<< "\"" << to_utf8(a
.name()) << "\" " << to_utf8(a
.email());
40 istream
& operator>>(istream
& is
, Author
& a
)
45 a
.name_
= from_utf8(trim(token(s
, '\"', 1)));
46 a
.email_
= from_utf8(trim(token(s
, '\"', 2)));
51 AuthorList::AuthorList()
57 int AuthorList::record(Author
const & a
)
59 Authors::const_iterator
it(authors_
.begin());
60 Authors::const_iterator
itend(authors_
.end());
62 for (; it
!= itend
; ++it
) {
67 authors_
[last_id_
++] = a
;
72 void AuthorList::record(int id
, Author
const & a
)
74 LASSERT(unsigned(id
) < authors_
.size(), /**/);
80 Author
const & AuthorList::get(int id
) const
82 Authors::const_iterator
it(authors_
.find(id
));
83 LASSERT(it
!= authors_
.end(), /**/);
88 AuthorList::Authors::const_iterator
AuthorList::begin() const
90 return authors_
.begin();
94 AuthorList::Authors::const_iterator
AuthorList::end() const
96 return authors_
.end();