X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fauthor.C;h=ea05ccd83d53dda7c494f6b814a1a1c09945dfb9;hb=52eb91c94fb70d58dceef430659c8781de2eccda;hp=de80ae6b793be77404e9765d2400d9ad08573ea9;hpb=0be0fcfd5907d448cd51addf83ed7032719a0692;p=lyx.git diff --git a/src/author.C b/src/author.C index de80ae6b79..ea05ccd83d 100644 --- a/src/author.C +++ b/src/author.C @@ -12,12 +12,20 @@ #include "author.h" -#include "support/LAssert.h" -#include "support/LOstream.h" -#include "support/LIstream.h" #include "support/lstrings.h" -using namespace lyx::support; +#include + +#include "support/std_istream.h" + + +namespace lyx { + +using support::token; +using support::trim; + +using std::string; + bool operator==(Author const & l, Author const & r) { @@ -27,7 +35,8 @@ bool operator==(Author const & l, Author const & r) std::ostream & operator<<(std::ostream & os, Author const & a) { - os << "\"" << a.name() << "\" " << a.email(); + // FIXME UNICODE + os << "\"" << to_utf8(a.name()) << "\" " << to_utf8(a.email()); return os; } @@ -35,8 +44,9 @@ std::istream & operator>>(std::istream & is, Author & a) { string s; getline(is, s); - a.name_ = trim(token(s, '\"', 1)); - a.email_ = trim(token(s, '\"', 2)); + // FIXME UNICODE + a.name_ = from_utf8(trim(token(s, '\"', 1))); + a.email_ = from_utf8(trim(token(s, '\"', 2))); return is; } @@ -64,7 +74,7 @@ int AuthorList::record(Author const & a) void AuthorList::record(int id, Author const & a) { - Assert(unsigned(id) < authors_.size()); + BOOST_ASSERT(unsigned(id) < authors_.size()); authors_[id] = a; } @@ -73,7 +83,7 @@ void AuthorList::record(int id, Author const & a) Author const & AuthorList::get(int id) { Authors::const_iterator it(authors_.find(id)); - Assert(it != authors_.end()); + BOOST_ASSERT(it != authors_.end()); return it->second; } @@ -88,3 +98,6 @@ AuthorList::Authors::const_iterator AuthorList::end() const { return authors_.end(); } + + +} // namespace lyx