author | Michael Krelin <hacker@klever.net> | 2008-03-03 15:57:15 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-03-03 15:57:15 (UTC) |
commit | c28479399ef0fedeb6bf14ec665bb4c427654356 (patch) (unidiff) | |
tree | ff1dfe84a54f717772bdb6233a5cbfedb57788d1 /include | |
parent | 0182b9dee269f1a8f3fc0794bfdf4a143fa1b5be (diff) | |
download | libopkele-c28479399ef0fedeb6bf14ec665bb4c427654356.zip libopkele-c28479399ef0fedeb6bf14ec665bb4c427654356.tar.gz libopkele-c28479399ef0fedeb6bf14ec665bb4c427654356.tar.bz2 |
introduced base_message class as a base for basic_openid_message
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/types.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/include/opkele/types.h b/include/opkele/types.h index ffb9afb..64f165c 100644 --- a/include/opkele/types.h +++ b/include/opkele/types.h | |||
@@ -120,3 +120,3 @@ namespace opkele { | |||
120 | 120 | ||
121 | class basic_openid_message { | 121 | class basic_message { |
122 | public: | 122 | public: |
@@ -127,7 +127,7 @@ namespace opkele { | |||
127 | 127 | ||
128 | basic_openid_message() { } | 128 | basic_message() { } |
129 | virtual ~basic_openid_message() { } | 129 | virtual ~basic_message() { } |
130 | basic_openid_message(const basic_openid_message& x); | 130 | basic_message(const basic_message& x); |
131 | void copy_to(basic_openid_message& x) const; | 131 | void copy_to(basic_message& x) const; |
132 | void append_to(basic_openid_message& x) const; | 132 | void append_to(basic_message& x) const; |
133 | 133 | ||
@@ -136,5 +136,2 @@ namespace opkele { | |||
136 | 136 | ||
137 | virtual bool has_ns(const string& uri) const; | ||
138 | virtual string get_ns(const string& uri) const; | ||
139 | |||
140 | virtual fields_iterator fields_begin() const = 0; | 137 | virtual fields_iterator fields_begin() const = 0; |
@@ -142,5 +139,4 @@ namespace opkele { | |||
142 | 139 | ||
143 | virtual string append_query(const string& url,const char *pfx="openid.") const; | 140 | virtual string append_query(const string& url,const char *pfx=0) const; |
144 | virtual string query_string(const char *pfx="openid.") const; | 141 | virtual string query_string(const char *pfx=0) const; |
145 | |||
146 | 142 | ||
@@ -150,2 +146,22 @@ namespace opkele { | |||
150 | 146 | ||
147 | }; | ||
148 | |||
149 | class basic_openid_message : public basic_message { | ||
150 | public: | ||
151 | typedef list<string> fields_t; | ||
152 | typedef util::forward_iterator_proxy< | ||
153 | string,const string&,const string* | ||
154 | > fields_iterator; | ||
155 | |||
156 | basic_openid_message() { } | ||
157 | basic_openid_message(const basic_openid_message& x); | ||
158 | |||
159 | virtual bool has_ns(const string& uri) const; | ||
160 | virtual string get_ns(const string& uri) const; | ||
161 | |||
162 | virtual string append_query(const string& url,const char *pfx="openid.") const { | ||
163 | return basic_message::append_query(url,pfx); } | ||
164 | virtual string query_string(const char *pfx="openid.") const { | ||
165 | return basic_message::query_string(pfx); } | ||
166 | |||
151 | virtual void from_keyvalues(const string& kv); | 167 | virtual void from_keyvalues(const string& kv); |
@@ -166,4 +182,2 @@ namespace opkele { | |||
166 | 182 | ||
167 | void copy_to(basic_openid_message& x) const; | ||
168 | |||
169 | bool has_field(const string& n) const; | 183 | bool has_field(const string& n) const; |