-rw-r--r-- | include/opkele/types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/opkele/types.h b/include/opkele/types.h index 6ab51ef..a3b657d 100644 --- a/include/opkele/types.h +++ b/include/opkele/types.h | |||
@@ -81,96 +81,97 @@ namespace opkele { | |||
81 | * @return server name | 81 | * @return server name |
82 | */ | 82 | */ |
83 | virtual string server() const = 0; | 83 | virtual string server() const = 0; |
84 | /** | 84 | /** |
85 | * retrieve the association handle. | 85 | * retrieve the association handle. |
86 | * @return handle | 86 | * @return handle |
87 | */ | 87 | */ |
88 | virtual string handle() const = 0; | 88 | virtual string handle() const = 0; |
89 | /** | 89 | /** |
90 | * retrieve the association type. | 90 | * retrieve the association type. |
91 | * @return association type | 91 | * @return association type |
92 | */ | 92 | */ |
93 | virtual string assoc_type() const = 0; | 93 | virtual string assoc_type() const = 0; |
94 | /** | 94 | /** |
95 | * retrieve the association secret. | 95 | * retrieve the association secret. |
96 | * @return association secret | 96 | * @return association secret |
97 | */ | 97 | */ |
98 | virtual secret_t secret() const = 0; | 98 | virtual secret_t secret() const = 0; |
99 | /** | 99 | /** |
100 | * retrieve the number of seconds the association expires in. | 100 | * retrieve the number of seconds the association expires in. |
101 | * @return seconds till expiration | 101 | * @return seconds till expiration |
102 | */ | 102 | */ |
103 | virtual int expires_in() const = 0; | 103 | virtual int expires_in() const = 0; |
104 | /** | 104 | /** |
105 | * check whether the association is stateless. | 105 | * check whether the association is stateless. |
106 | * @return true if stateless | 106 | * @return true if stateless |
107 | */ | 107 | */ |
108 | virtual bool stateless() const = 0; | 108 | virtual bool stateless() const = 0; |
109 | /** | 109 | /** |
110 | * check whether the association is expired. | 110 | * check whether the association is expired. |
111 | * @return true if expired | 111 | * @return true if expired |
112 | */ | 112 | */ |
113 | virtual bool is_expired() const = 0; | 113 | virtual bool is_expired() const = 0; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * the shared_ptr<> for association_t object type | 117 | * the shared_ptr<> for association_t object type |
118 | */ | 118 | */ |
119 | typedef tr1mem::shared_ptr<association_t> assoc_t; | 119 | typedef tr1mem::shared_ptr<association_t> assoc_t; |
120 | 120 | ||
121 | class basic_openid_message { | 121 | class basic_openid_message { |
122 | public: | 122 | public: |
123 | typedef list<string> fields_t; | 123 | typedef list<string> fields_t; |
124 | typedef util::forward_iterator_proxy< | 124 | typedef util::forward_iterator_proxy< |
125 | string,const string&,const string* | 125 | string,const string&,const string* |
126 | > fields_iterator; | 126 | > fields_iterator; |
127 | 127 | ||
128 | basic_openid_message() { } | 128 | basic_openid_message() { } |
129 | virtual ~basic_openid_message() { } | ||
129 | basic_openid_message(const basic_openid_message& x); | 130 | basic_openid_message(const basic_openid_message& x); |
130 | void copy_to(basic_openid_message& x) const; | 131 | void copy_to(basic_openid_message& x) const; |
131 | 132 | ||
132 | virtual bool has_field(const string& n) const = 0; | 133 | virtual bool has_field(const string& n) const = 0; |
133 | virtual const string& get_field(const string& n) const = 0; | 134 | virtual const string& get_field(const string& n) const = 0; |
134 | 135 | ||
135 | virtual bool has_ns(const string& uri) const; | 136 | virtual bool has_ns(const string& uri) const; |
136 | virtual string get_ns(const string& uri) const; | 137 | virtual string get_ns(const string& uri) const; |
137 | 138 | ||
138 | virtual fields_iterator fields_begin() const = 0; | 139 | virtual fields_iterator fields_begin() const = 0; |
139 | virtual fields_iterator fields_end() const = 0; | 140 | virtual fields_iterator fields_end() const = 0; |
140 | 141 | ||
141 | virtual string append_query(const string& url) const; | 142 | virtual string append_query(const string& url) const; |
142 | virtual string query_string() const; | 143 | virtual string query_string() const; |
143 | 144 | ||
144 | 145 | ||
145 | virtual void reset_fields(); | 146 | virtual void reset_fields(); |
146 | virtual void set_field(const string& n,const string& v); | 147 | virtual void set_field(const string& n,const string& v); |
147 | virtual void reset_field(const string& n); | 148 | virtual void reset_field(const string& n); |
148 | 149 | ||
149 | virtual void from_keyvalues(const string& kv); | 150 | virtual void from_keyvalues(const string& kv); |
150 | virtual void to_keyvalues(ostream& o) const; | 151 | virtual void to_keyvalues(ostream& o) const; |
151 | 152 | ||
152 | virtual void to_htmlhiddens(ostream& o) const; | 153 | virtual void to_htmlhiddens(ostream& o) const; |
153 | 154 | ||
154 | void add_to_signed(const string& fields); | 155 | void add_to_signed(const string& fields); |
155 | string find_ns(const string& uri,const char *pfx) const; | 156 | string find_ns(const string& uri,const char *pfx) const; |
156 | string allocate_ns(const string& uri,const char *pfx); | 157 | string allocate_ns(const string& uri,const char *pfx); |
157 | }; | 158 | }; |
158 | 159 | ||
159 | class openid_message_t : public basic_openid_message, public map<string,string> { | 160 | class openid_message_t : public basic_openid_message, public map<string,string> { |
160 | public: | 161 | public: |
161 | openid_message_t() { } | 162 | openid_message_t() { } |
162 | openid_message_t(const basic_openid_message& x) | 163 | openid_message_t(const basic_openid_message& x) |
163 | : basic_openid_message(x) { } | 164 | : basic_openid_message(x) { } |
164 | 165 | ||
165 | void copy_to(basic_openid_message& x) const; | 166 | void copy_to(basic_openid_message& x) const; |
166 | 167 | ||
167 | bool has_field(const string& n) const; | 168 | bool has_field(const string& n) const; |
168 | const string& get_field(const string& n) const; | 169 | const string& get_field(const string& n) const; |
169 | virtual fields_iterator fields_begin() const; | 170 | virtual fields_iterator fields_begin() const; |
170 | virtual fields_iterator fields_end() const; | 171 | virtual fields_iterator fields_end() const; |
171 | 172 | ||
172 | void reset_fields(); | 173 | void reset_fields(); |
173 | void set_field(const string& n,const string& v); | 174 | void set_field(const string& n,const string& v); |
174 | void reset_field(const string& n); | 175 | void reset_field(const string& n); |
175 | }; | 176 | }; |
176 | 177 | ||