ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Buddy.hpp
Revision: 46
Committed: 2004-08-16T18:52:59-07:00 (20 years, 10 months ago) by douglas
File size: 1292 byte(s)
Log Message:
Made some drastic changes! Maybe not so drastic.

File Contents

# Content
1 // Zoe AIM Away Message RSS Feed Generator
2 //
3 // Seth King and Douglas Thrift
4 //
5 // $Id$
6
7 #ifndef _Buddy_hpp_
8 #define _Buddy_hpp_
9
10 #include "Zoe.hpp"
11
12 class Buddy
13 {
14 private:
15 ext::String login, rss, atom, link;
16 ext::Uuid id;
17 public:
18 Buddy(const ext::String& login, const ext::String& rss = "",
19 const ext::String& atom = "", const ext::String& link = "") :
20 login(net::Oscar::collapse(login)),
21 rss(rss.IsEmpty() ? login + ".rss" : rss),
22 atom(atom.IsEmpty() ? login + ".atom" : atom), link(link) {}
23 Buddy(const net::Oscar::UserInfo& user) :
24 login(net::Oscar::collapse(user.screenname)) {}
25 const ext::String& getRss() const { return rss; }
26 const ext::String& getAtom() const { return atom; }
27 const ext::String& getLink() const { return link; }
28 const ext::Uuid& getId() const { return id; }
29 ext::String getRssLink() const;
30 ext::String getAtomLink() const;
31 void setId(const ext::Uuid& id) { this->id = id; }
32 bool operator==(const Buddy& buddy) const { return login == buddy.login; }
33 bool operator<(const Buddy& buddy) const { return std::string(login) < std::string(buddy.login); }
34 operator const ext::String&() const { return login; }
35 };
36
37 inline std::ostream& operator<<(std::ostream& sout, const Buddy& buddy)
38 {
39 return sout << ext::String(buddy);
40 }
41
42 #endif // _Buddy_hpp_

Properties

Name Value
svn:eol-style native
svn:keywords Id