2003-02-08 19:18:01 +00:00
|
|
|
/**
|
|
|
|
* \file author.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AUTHOR_H
|
|
|
|
#define AUTHOR_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
|
|
#include "LString.h"
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
class Author {
|
|
|
|
public:
|
|
|
|
Author() {}
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-07-21 11:01:29 +00:00
|
|
|
Author(string const & name, string const & email)
|
|
|
|
: name_(name), email_(email) {}
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
|
|
string const name() const {
|
|
|
|
return name_;
|
|
|
|
}
|
|
|
|
|
|
|
|
string const email() const {
|
|
|
|
return email_;
|
|
|
|
}
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
friend std::istream & operator>>(std::istream & os, Author & a);
|
|
|
|
|
|
|
|
private:
|
|
|
|
string name_;
|
|
|
|
|
|
|
|
string email_;
|
|
|
|
};
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
|
|
class AuthorList {
|
|
|
|
public:
|
2003-03-12 23:25:59 +00:00
|
|
|
AuthorList();
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
int record(Author const & a);
|
|
|
|
|
|
|
|
void record(int id, Author const & a);
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
Author const & get(int id);
|
|
|
|
|
|
|
|
typedef std::map<int, Author> Authors;
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
Authors::const_iterator begin() const;
|
|
|
|
|
|
|
|
Authors::const_iterator end() const;
|
|
|
|
|
|
|
|
private:
|
2003-03-12 23:25:59 +00:00
|
|
|
int last_id_;
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
Authors authors_;
|
|
|
|
};
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
bool operator==(Author const & l, Author const & r);
|
2003-03-04 09:27:27 +00:00
|
|
|
|
|
|
|
std::ostream & operator<<(std::ostream & os, Author const & a);
|
|
|
|
|
|
|
|
std::istream & operator>>(std::istream & os, Author & a);
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
#endif // AUTHOR_H
|