00001 #ifndef BOOK_H 00002 #define BOOK_H 00003 00004 #include "util.h" 00005 #include <string> 00006 #include <vector> 00007 #include <map> 00008 #include "parsererror.h" 00009 using namespace std; 00010 00011 class book { 00012 public: 00013 book() {} 00014 book(const string &s) { parse(s); } 00015 book(const book& b); 00016 book& operator=(const book &b); 00017 // output ace format 00018 friend ostream& operator<<(ostream &os, const book &b); 00019 00020 // input from a string the (In) may be present or not 00021 // return false if failed the parsing 00022 bool parse(const string &s) throw(parsererror); 00023 00024 void clear() { volume.erase(); publisher.erase(); city.erase();} 00025 00026 // limit the size of the book name 00027 string makeKey(const int limit=20) const; 00028 // load tag information into the digest map in the ref object 00029 void loadMap(map<string,string> &m) const; 00030 00031 private: 00032 vector<string> editors; 00033 string name; 00034 string firstpg, lastpg; 00035 string volume; // may or may not be present 00036 string publisher; 00037 string city; 00038 string year; 00039 }; 00040 00041 #endif
1.5.6