summaryrefslogtreecommitdiffabout
path: root/include/opkele/types.h
Side-by-side diff
Diffstat (limited to 'include/opkele/types.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/types.h18
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,20 +1,21 @@
#ifndef __OPKELE_TYPES_H
#define __OPKELE_TYPES_H
/**
* @file
* @brief various types declarations
*/
+#include <cstring>
#include <ostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <list>
#include <opkele/iterator.h>
#include <opkele/tr1-mem.h>
namespace opkele {
using std::vector;
using std::string;
@@ -197,15 +198,32 @@ namespace opkele {
/**
* parse the OpenID key/value data.
* @param kv the OpenID key/value data
*/
void parse_keyvalues(const string& kv) {
from_keyvalues(kv); }
string append_query(const string& url,const char *prefix="openid.") const;
};
+ struct openid_endpoint_t {
+ string uri;
+ string claimed_id;
+ string local_id;
+
+ openid_endpoint_t() { }
+ openid_endpoint_t(const string& u,const string& cid,const string& lid)
+ : uri(u), claimed_id(cid), local_id(lid) { }
+
+ bool operator==(const openid_endpoint_t& x) const {
+ return uri==x.uri && local_id==x.local_id; }
+ bool operator<(const openid_endpoint_t& x) const {
+ int c;
+ return (c=strcmp(uri.c_str(),x.uri.c_str()))
+ ? (c<0) : (strcmp(local_id.c_str(),x.local_id.c_str())<0); }
+ };
+
}
#endif /* __OPKELE_TYPES_H */