2003-08-23 00:17:00 +00:00
|
|
|
// -*- C++ -*-
|
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
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-02-08 19:18:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AUTHOR_H
|
|
|
|
#define AUTHOR_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <iosfwd>
|
2003-10-06 15:43:21 +00:00
|
|
|
#include <string>
|
2003-02-08 19:18:01 +00:00
|
|
|
|
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-10-06 15:43:21 +00:00
|
|
|
Author(std::string const & name, std::string const & email)
|
2003-07-21 11:01:29 +00:00
|
|
|
: name_(name), email_(email) {}
|
2003-02-08 19:18:01 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const name() const {
|
2003-02-08 19:18:01 +00:00
|
|
|
return name_;
|
|
|
|
}
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const email() const {
|
2003-02-08 19:18:01 +00:00
|
|
|
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:
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string name_;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string email_;
|
2003-02-08 19:18:01 +00:00
|
|
|
};
|
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
|