ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Buddy.hpp
Revision: 31
Committed: 2004-07-20T00:11:56-07:00 (20 years, 11 months ago) by douglas
File size: 1462 byte(s)
Log Message:
Ooh, pretty colors, and hourly updates, maybe.

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;
16 ext::Uuid id;
17 public:
18 Buddy(const ext::String& login, const ext::String& rss = "") :
19 login(net::Oscar::collapse(login)), rss(rss.IsEmpty() ? login + ".rss" :
20 rss) {}
21 Buddy(const net::Oscar::UserInfo& user) :
22 login(net::Oscar::collapse(user.screenname)) {}
23 const ext::String& getRss() const { return rss; }
24 const ext::Uuid& getId() const { return id; }
25 void setId(const ext::Uuid& id) { this->id = id; }
26 bool operator==(const Buddy& buddy) const { return login == buddy.login; }
27 bool operator<(const Buddy& buddy) const { return login < buddy.login; }
28 operator const ext::String&() const { return login; }
29 };
30
31 inline ext::String operator+(const Buddy& buddy, const ext::String& string)
32 {
33 return ext::String(buddy) + string;
34 }
35
36 inline ext::String operator+(const ext::String& string, const Buddy& buddy)
37 {
38 return string + ext::String(buddy);
39 }
40
41 inline ext::String operator+(const ext::Uuid& uuid, const ext::String& string)
42 {
43 return lexical_cast<ext::String>(uuid) + string;
44 }
45
46 inline ext::String operator+(const ext::String& string, const ext::Uuid& uuid)
47 {
48 return string + lexical_cast<ext::String>(uuid);
49 }
50
51 inline std::ostream& operator<<(std::ostream& sout, const Buddy& buddy)
52 {
53 return sout << ext::String(buddy);
54 }
55
56 #endif // _Buddy_hpp_

Properties

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