From 67133db1f33b142561575cdf99fedca8fb6ad79b Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Thu, 31 Jan 2008 22:07:53 +0000 Subject: added util::change_mode_message_proxy class generatlized checkauth_message_proxy and added it to util namespace. To be later used for constructing setup url in 1.0 checkid_immediate reply. Signed-off-by: Michael Krelin --- (limited to 'include') diff --git a/include/opkele/util.h b/include/opkele/util.h index e9176b0..6f3ddf6 100644 --- a/include/opkele/util.h +++ b/include/opkele/util.h @@ -144,6 +144,24 @@ namespace opkele { string base64_signature(const assoc_t& assoc,const basic_openid_message& om); + class change_mode_message_proxy : public basic_openid_message { + public: + const basic_openid_message& x; + const string& mode; + + change_mode_message_proxy(const basic_openid_message& xx,const string& m) : x(xx), mode(m) { } + + bool has_field(const string& n) const { return x.has_field(n); } + const string& get_field(const string& n) const { + return (n=="mode")?mode:x.get_field(n); } + bool has_ns(const string& uri) const {return x.has_ns(uri); } + string get_ns(const string& uri) const { return x.get_ns(uri); } + fields_iterator fields_begin() const { + return x.fields_begin(); } + fields_iterator fields_end() const { + return x.fields_end(); } + }; + } } -- cgit v0.9.0.2