-rw-r--r-- | include/opkele/types.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/opkele/types.h b/include/opkele/types.h index 5d39a5c..6ab51ef 100644 --- a/include/opkele/types.h +++ b/include/opkele/types.h | |||
@@ -1,16 +1,17 @@ | |||
1 | #ifndef __OPKELE_TYPES_H | 1 | #ifndef __OPKELE_TYPES_H |
2 | #define __OPKELE_TYPES_H | 2 | #define __OPKELE_TYPES_H |
3 | 3 | ||
4 | /** | 4 | /** |
5 | * @file | 5 | * @file |
6 | * @brief various types declarations | 6 | * @brief various types declarations |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <cstring> | ||
9 | #include <ostream> | 10 | #include <ostream> |
10 | #include <vector> | 11 | #include <vector> |
11 | #include <string> | 12 | #include <string> |
12 | #include <map> | 13 | #include <map> |
13 | #include <set> | 14 | #include <set> |
14 | #include <list> | 15 | #include <list> |
15 | #include <opkele/iterator.h> | 16 | #include <opkele/iterator.h> |
16 | #include <opkele/tr1-mem.h> | 17 | #include <opkele/tr1-mem.h> |
@@ -201,11 +202,28 @@ namespace opkele { | |||
201 | */ | 202 | */ |
202 | void parse_keyvalues(const string& kv) { | 203 | void parse_keyvalues(const string& kv) { |
203 | from_keyvalues(kv); } | 204 | from_keyvalues(kv); } |
204 | 205 | ||
205 | string append_query(const string& url,const char *prefix="openid.") const; | 206 | string append_query(const string& url,const char *prefix="openid.") const; |
206 | 207 | ||
207 | }; | 208 | }; |
208 | 209 | ||
210 | struct openid_endpoint_t { | ||
211 | string uri; | ||
212 | string claimed_id; | ||
213 | string local_id; | ||
214 | |||
215 | openid_endpoint_t() { } | ||
216 | openid_endpoint_t(const string& u,const string& cid,const string& lid) | ||
217 | : uri(u), claimed_id(cid), local_id(lid) { } | ||
218 | |||
219 | bool operator==(const openid_endpoint_t& x) const { | ||
220 | return uri==x.uri && local_id==x.local_id; } | ||
221 | bool operator<(const openid_endpoint_t& x) const { | ||
222 | int c; | ||
223 | return (c=strcmp(uri.c_str(),x.uri.c_str())) | ||
224 | ? (c<0) : (strcmp(local_id.c_str(),x.local_id.c_str())<0); } | ||
225 | }; | ||
226 | |||
209 | } | 227 | } |
210 | 228 | ||
211 | #endif /* __OPKELE_TYPES_H */ | 229 | #endif /* __OPKELE_TYPES_H */ |