00001 #ifndef RECEIVED_H 00002 #define RECEIVED_H 00003 00004 #include <abuse/abuse.h> 00005 #include <abuse/received_exception.h> 00006 #include <abuse/Url.h> 00007 #include <list> 00008 #include <ctime> 00009 00010 class Analyzer; 00011 00012 class Received 00013 { 00014 public: 00015 Received(const Received& other); 00016 void operator=(const Received& other); 00017 virtual ~Received(); 00018 const std::string& apparently_from()const; 00019 const Url& from()const; 00020 const std::string& by()const; 00021 const std::string& to()const; 00022 bool isTrusted()const{return m_bTrusted;} 00023 void setTrusted(bool b){m_bTrusted=b;} 00024 time_t time; 00025 static Received getReceived(std::istream& is)throw(std::received_exception); 00026 static std::list<Received> getAllReceived(std::istream& is,std::list<std::string>* errs=NULL); 00027 00028 private: 00029 friend class Analyzer; 00030 Received(); 00031 operator bool(); 00032 Received(const std::string& line)throw(std::received_exception);//create only from static member 00033 Url* m_from; 00034 std::string m_apparently_from; 00035 std::string m_by; 00036 std::string m_to; 00037 bool m_bTrusted; 00038 }; 00039 00040 #endif //RECEIVED_H