]> git.lyx.org Git - lyx.git/blobdiff - src/author.C
add config.h
[lyx.git] / src / author.C
index 45b36b4f150e37c64e7657946c1ee06157346c8c..ea05ccd83d53dda7c494f6b814a1a1c09945dfb9 100644 (file)
@@ -5,18 +5,28 @@
  *
  * \author John Levon
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "author.h"
 
-#include "support/LAssert.h"
-#include "support/LOstream.h"
-#include "support/LIstream.h"
 #include "support/lstrings.h"
 
+#include <boost/assert.hpp>
+
+#include "support/std_istream.h"
+
+
+namespace lyx {
+
+using support::token;
+using support::trim;
+
+using std::string;
+
+
 bool operator==(Author const & l, Author const & r)
 {
        return l.name() == r.name() && l.email() == r.email();
@@ -25,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;
 }
 
@@ -33,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;
 }
 
@@ -62,7 +74,7 @@ int AuthorList::record(Author const & a)
 
 void AuthorList::record(int id, Author const & a)
 {
-       lyx::Assert(unsigned(id) < authors_.size());
+       BOOST_ASSERT(unsigned(id) < authors_.size());
 
        authors_[id] = a;
 }
@@ -71,7 +83,7 @@ void AuthorList::record(int id, Author const & a)
 Author const & AuthorList::get(int id)
 {
        Authors::const_iterator it(authors_.find(id));
-       lyx::Assert(it != authors_.end());
+       BOOST_ASSERT(it != authors_.end());
        return it->second;
 }
 
@@ -86,3 +98,6 @@ AuthorList::Authors::const_iterator AuthorList::end() const
 {
        return authors_.end();
 }
+
+
+} // namespace lyx