author | Michael Krelin <hacker@klever.net> | 2008-02-08 22:16:15 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-02-08 22:16:15 (UTC) |
commit | 16667a21c3052c89218d3e56098f0fc29dca2f1a (patch) (unidiff) | |
tree | 7154633a771b96da02cc4c980167b7ad92b6d27e /include/opkele | |
parent | f2ba7be73a62d115f293f5d690efabcafd5fcf4f (diff) | |
download | libopkele-16667a21c3052c89218d3e56098f0fc29dca2f1a.zip libopkele-16667a21c3052c89218d3e56098f0fc29dca2f1a.tar.gz libopkele-16667a21c3052c89218d3e56098f0fc29dca2f1a.tar.bz2 |
minor fixes and making compiler a bit happier
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/basic_op.h | 2 | ||||
-rw-r--r-- | include/opkele/expat.h | 16 | ||||
-rw-r--r-- | include/opkele/iterator.h | 19 | ||||
-rw-r--r-- | include/opkele/types.h | 1 |
4 files changed, 20 insertions, 18 deletions
diff --git a/include/opkele/basic_op.h b/include/opkele/basic_op.h index 0326508..12306dd 100644 --- a/include/opkele/basic_op.h +++ b/include/opkele/basic_op.h | |||
@@ -37,24 +37,26 @@ namespace opkele { | |||
37 | * Claimed identifier | 37 | * Claimed identifier |
38 | */ | 38 | */ |
39 | string claimed_id; | 39 | string claimed_id; |
40 | /** | 40 | /** |
41 | * The OP-Local identifier | 41 | * The OP-Local identifier |
42 | */ | 42 | */ |
43 | string identity; | 43 | string identity; |
44 | /** | 44 | /** |
45 | * The invalidate handle for the reply request | 45 | * The invalidate handle for the reply request |
46 | */ | 46 | */ |
47 | string invalidate_handle; | 47 | string invalidate_handle; |
48 | 48 | ||
49 | virtual ~basic_OP() { } | ||
50 | |||
49 | void reset_vars(); | 51 | void reset_vars(); |
50 | 52 | ||
51 | /** | 53 | /** |
52 | * @name Request information access | 54 | * @name Request information access |
53 | * Setting and retrieval of the information pertaining to the request being processed | 55 | * Setting and retrieval of the information pertaining to the request being processed |
54 | * @{ | 56 | * @{ |
55 | */ | 57 | */ |
56 | /** | 58 | /** |
57 | * Check if the RP expects us to get back to them. | 59 | * Check if the RP expects us to get back to them. |
58 | * @return true if RP supplied return_to URL | 60 | * @return true if RP supplied return_to URL |
59 | */ | 61 | */ |
60 | bool has_return_to() const; | 62 | bool has_return_to() const; |
diff --git a/include/opkele/expat.h b/include/opkele/expat.h index 60c41ac..3ab1630 100644 --- a/include/opkele/expat.h +++ b/include/opkele/expat.h | |||
@@ -17,47 +17,47 @@ namespace opkele { | |||
17 | virtual ~expat_t() throw(); | 17 | virtual ~expat_t() throw(); |
18 | 18 | ||
19 | expat_t& operator=(XML_Parser x); | 19 | expat_t& operator=(XML_Parser x); |
20 | 20 | ||
21 | operator const XML_Parser(void) const { return _x; } | 21 | operator const XML_Parser(void) const { return _x; } |
22 | operator XML_Parser(void) { return _x; } | 22 | operator XML_Parser(void) { return _x; } |
23 | 23 | ||
24 | inline bool parse(const char *s,int len,bool final=false) { | 24 | inline bool parse(const char *s,int len,bool final=false) { |
25 | assert(_x); | 25 | assert(_x); |
26 | return XML_Parse(_x,s,len,final); | 26 | return XML_Parse(_x,s,len,final); |
27 | } | 27 | } |
28 | 28 | ||
29 | virtual void start_element(const XML_Char *n,const XML_Char **a) { } | 29 | virtual void start_element(const XML_Char * /* n */,const XML_Char ** /* a */) { } |
30 | virtual void end_element(const XML_Char *n) { } | 30 | virtual void end_element(const XML_Char * /* n */) { } |
31 | void set_element_handler(); | 31 | void set_element_handler(); |
32 | 32 | ||
33 | virtual void character_data(const XML_Char *s,int l) { } | 33 | virtual void character_data(const XML_Char * /* s */,int /* l */) { } |
34 | void set_character_data_handler(); | 34 | void set_character_data_handler(); |
35 | 35 | ||
36 | virtual void processing_instruction(const XML_Char *t,const XML_Char *d) { } | 36 | virtual void processing_instruction(const XML_Char * /* t */,const XML_Char * /* d */) { } |
37 | void set_processing_instruction_handler(); | 37 | void set_processing_instruction_handler(); |
38 | 38 | ||
39 | virtual void comment(const XML_Char *d) { } | 39 | virtual void comment(const XML_Char * /* d */) { } |
40 | void set_comment_handler(); | 40 | void set_comment_handler(); |
41 | 41 | ||
42 | virtual void start_cdata_section() { } | 42 | virtual void start_cdata_section() { } |
43 | virtual void end_cdata_section() { } | 43 | virtual void end_cdata_section() { } |
44 | void set_cdata_section_handler(); | 44 | void set_cdata_section_handler(); |
45 | 45 | ||
46 | virtual void default_handler(const XML_Char *s,int l) { } | 46 | virtual void default_handler(const XML_Char * /* s */,int /* l */) { } |
47 | void set_default_handler(); | 47 | void set_default_handler(); |
48 | void set_default_handler_expand(); | 48 | void set_default_handler_expand(); |
49 | 49 | ||
50 | virtual void start_namespace_decl(const XML_Char *p,const XML_Char *u) { } | 50 | virtual void start_namespace_decl(const XML_Char * /* p */,const XML_Char * /* u */) { } |
51 | virtual void end_namespace_decl(const XML_Char *p) { } | 51 | virtual void end_namespace_decl(const XML_Char * /* p */) { } |
52 | void set_namespace_decl_handler(); | 52 | void set_namespace_decl_handler(); |
53 | 53 | ||
54 | inline enum XML_Error get_error_code() { | 54 | inline enum XML_Error get_error_code() { |
55 | assert(_x); return XML_GetErrorCode(_x); } | 55 | assert(_x); return XML_GetErrorCode(_x); } |
56 | static inline const XML_LChar *error_string(XML_Error c) { | 56 | static inline const XML_LChar *error_string(XML_Error c) { |
57 | return XML_ErrorString(c); } | 57 | return XML_ErrorString(c); } |
58 | 58 | ||
59 | inline long get_current_byte_index() { | 59 | inline long get_current_byte_index() { |
60 | assert(_x); return XML_GetCurrentByteIndex(_x); } | 60 | assert(_x); return XML_GetCurrentByteIndex(_x); } |
61 | inline int get_current_line_number() { | 61 | inline int get_current_line_number() { |
62 | assert(_x); return XML_GetCurrentLineNumber(_x); } | 62 | assert(_x); return XML_GetCurrentLineNumber(_x); } |
63 | inline int get_current_column_number() { | 63 | inline int get_current_column_number() { |
diff --git a/include/opkele/iterator.h b/include/opkele/iterator.h index 812a786..28c1c83 100644 --- a/include/opkele/iterator.h +++ b/include/opkele/iterator.h | |||
@@ -17,50 +17,49 @@ namespace opkele { | |||
17 | 17 | ||
18 | virtual basic_output_iterator_proxy_impl<T>* dup() const = 0; | 18 | virtual basic_output_iterator_proxy_impl<T>* dup() const = 0; |
19 | basic_output_iterator_proxy_impl<T>& operator*() { return *this; }; | 19 | basic_output_iterator_proxy_impl<T>& operator*() { return *this; }; |
20 | virtual basic_output_iterator_proxy_impl<T>& operator=(const T& x) = 0; | 20 | virtual basic_output_iterator_proxy_impl<T>& operator=(const T& x) = 0; |
21 | 21 | ||
22 | }; | 22 | }; |
23 | 23 | ||
24 | template<typename IT,typename T=typename IT::value_type> | 24 | template<typename IT,typename T=typename IT::value_type> |
25 | class output_iterator_proxy_impl : public basic_output_iterator_proxy_impl<T> { | 25 | class output_iterator_proxy_impl : public basic_output_iterator_proxy_impl<T> { |
26 | public: | 26 | public: |
27 | IT i; | 27 | IT i; |
28 | 28 | ||
29 | output_iterator_proxy_impl(const IT& i) : i(i) { } | 29 | output_iterator_proxy_impl(const IT& _i) : i(_i) { } |
30 | basic_output_iterator_proxy_impl<T>* dup() const { | 30 | basic_output_iterator_proxy_impl<T>* dup() const { |
31 | return new output_iterator_proxy_impl<IT,T>(i); } | 31 | return new output_iterator_proxy_impl<IT,T>(i); } |
32 | basic_output_iterator_proxy_impl<T>& operator=(const T& x) { | 32 | basic_output_iterator_proxy_impl<T>& operator=(const T& x) { |
33 | (*i) = x; | 33 | (*i) = x; return *this; } |
34 | } | ||
35 | }; | 34 | }; |
36 | 35 | ||
37 | template<typename T> | 36 | template<typename T> |
38 | class output_iterator_proxy : public iterator<output_iterator_tag,T,void,T*,T&> { | 37 | class output_iterator_proxy : public iterator<output_iterator_tag,T,void,T*,T&> { |
39 | public: | 38 | public: |
40 | basic_output_iterator_proxy_impl<T> *I; | 39 | basic_output_iterator_proxy_impl<T> *I; |
41 | 40 | ||
42 | template<typename IT> | 41 | template<typename IT> |
43 | output_iterator_proxy(const IT& i) | 42 | output_iterator_proxy(const IT& i) |
44 | : I(new output_iterator_proxy_impl<IT,T>(i)) { } | 43 | : I(new output_iterator_proxy_impl<IT,T>(i)) { } |
45 | output_iterator_proxy(const output_iterator_proxy<T>& x) | 44 | output_iterator_proxy(const output_iterator_proxy<T>& x) |
46 | : I(x.I->dup()) { } | 45 | : I(x.I->dup()) { } |
47 | ~output_iterator_proxy() { delete I; } | 46 | ~output_iterator_proxy() { delete I; } |
48 | 47 | ||
49 | output_iterator_proxy& operator=(const output_iterator_proxy<T>& x) { | 48 | output_iterator_proxy& operator=(const output_iterator_proxy<T>& x) { |
50 | delete I; I = x.I->dup(); } | 49 | delete I; I = x.I->dup(); } |
51 | 50 | ||
52 | output_iterator_proxy& operator*() { return *this; } | 51 | output_iterator_proxy& operator*() { return *this; } |
53 | output_iterator_proxy& operator=(const T& x) { | 52 | output_iterator_proxy& operator=(const T& x) { |
54 | (**I) = x; } | 53 | (**I) = x; return *this; } |
55 | 54 | ||
56 | output_iterator_proxy& operator++() { return *this; } | 55 | output_iterator_proxy& operator++() { return *this; } |
57 | output_iterator_proxy& operator++(int) { return *this; } | 56 | output_iterator_proxy& operator++(int) { return *this; } |
58 | }; | 57 | }; |
59 | 58 | ||
60 | template <typename T,typename TR=T&,typename TP=T*> | 59 | template <typename T,typename TR=T&,typename TP=T*> |
61 | class basic_forward_iterator_proxy_impl : public iterator<forward_iterator_tag,T,void,TP,TR> { | 60 | class basic_forward_iterator_proxy_impl : public iterator<forward_iterator_tag,T,void,TP,TR> { |
62 | public: | 61 | public: |
63 | virtual ~basic_forward_iterator_proxy_impl() { } | 62 | virtual ~basic_forward_iterator_proxy_impl() { } |
64 | 63 | ||
65 | virtual basic_forward_iterator_proxy_impl<T,TR,TP>* dup() const = 0; | 64 | virtual basic_forward_iterator_proxy_impl<T,TR,TP>* dup() const = 0; |
66 | 65 | ||
@@ -68,25 +67,25 @@ namespace opkele { | |||
68 | virtual bool operator!=(const basic_forward_iterator_proxy_impl<T,TR,TP>& x) const { | 67 | virtual bool operator!=(const basic_forward_iterator_proxy_impl<T,TR,TP>& x) const { |
69 | return !((*this)==x); } | 68 | return !((*this)==x); } |
70 | virtual TR operator*() const = 0; | 69 | virtual TR operator*() const = 0; |
71 | virtual TP operator->() const = 0; | 70 | virtual TP operator->() const = 0; |
72 | virtual void advance() = 0; | 71 | virtual void advance() = 0; |
73 | }; | 72 | }; |
74 | 73 | ||
75 | template <typename IT> | 74 | template <typename IT> |
76 | class forward_iterator_proxy_impl : public basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer> { | 75 | class forward_iterator_proxy_impl : public basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer> { |
77 | public: | 76 | public: |
78 | IT i; | 77 | IT i; |
79 | 78 | ||
80 | forward_iterator_proxy_impl(const IT& i) : i(i) { } | 79 | forward_iterator_proxy_impl(const IT& _i) : i(_i) { } |
81 | 80 | ||
82 | virtual basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer>* dup() const { | 81 | virtual basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer>* dup() const { |
83 | return new forward_iterator_proxy_impl<IT>(i); } | 82 | return new forward_iterator_proxy_impl<IT>(i); } |
84 | 83 | ||
85 | virtual bool operator==(const basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer>& x) const { | 84 | virtual bool operator==(const basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer>& x) const { |
86 | return i==static_cast<const forward_iterator_proxy_impl<IT>*>(&x)->i; } | 85 | return i==static_cast<const forward_iterator_proxy_impl<IT>*>(&x)->i; } |
87 | virtual bool operator!=(const basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer>& x) const { | 86 | virtual bool operator!=(const basic_forward_iterator_proxy_impl<typename IT::value_type,typename IT::reference,typename IT::pointer>& x) const { |
88 | return i!=static_cast<const forward_iterator_proxy_impl<IT>*>(&x)->i; } | 87 | return i!=static_cast<const forward_iterator_proxy_impl<IT>*>(&x)->i; } |
89 | virtual typename IT::reference operator*() const { return *i; } | 88 | virtual typename IT::reference operator*() const { return *i; } |
90 | virtual typename IT::pointer operator->() const { return i.operator->(); } | 89 | virtual typename IT::pointer operator->() const { return i.operator->(); } |
91 | virtual void advance() { ++i; } | 90 | virtual void advance() { ++i; } |
92 | }; | 91 | }; |
@@ -127,26 +126,26 @@ namespace opkele { | |||
127 | class basic_filterator : public iterator< | 126 | class basic_filterator : public iterator< |
128 | typename IT::iterator_category, | 127 | typename IT::iterator_category, |
129 | typename IT::value_type, | 128 | typename IT::value_type, |
130 | typename IT::difference_type, | 129 | typename IT::difference_type, |
131 | typename IT::pointer, | 130 | typename IT::pointer, |
132 | typename IT::reference> { | 131 | typename IT::reference> { |
133 | public: | 132 | public: |
134 | IT it; | 133 | IT it; |
135 | IT ei; | 134 | IT ei; |
136 | bool empty; | 135 | bool empty; |
137 | 136 | ||
138 | basic_filterator() : empty(true) { } | 137 | basic_filterator() : empty(true) { } |
139 | basic_filterator(const IT& bi,const IT& ei) | 138 | basic_filterator(const IT& _bi,const IT& _ei) |
140 | : it(bi), ei(ei) { empty = (bi==ei); } | 139 | : it(_bi), ei(_ei) { empty = (it==ei); } |
141 | basic_filterator(const basic_filterator<IT>& x) | 140 | basic_filterator(const basic_filterator<IT>& x) |
142 | : it(x.it), ei(x.ei), empty(x.empty) { } | 141 | : it(x.it), ei(x.ei), empty(x.empty) { } |
143 | virtual ~basic_filterator() { } | 142 | virtual ~basic_filterator() { } |
144 | 143 | ||
145 | bool operator==(const basic_filterator<IT>& x) const { | 144 | bool operator==(const basic_filterator<IT>& x) const { |
146 | return empty?x.empty:(it==x.it); } | 145 | return empty?x.empty:(it==x.it); } |
147 | bool operator!=(const basic_filterator<IT>& x) const { | 146 | bool operator!=(const basic_filterator<IT>& x) const { |
148 | return empty!=x.empty || it!=x.it; } | 147 | return empty!=x.empty || it!=x.it; } |
149 | 148 | ||
150 | typename IT::reference operator*() const { | 149 | typename IT::reference operator*() const { |
151 | assert(!empty); | 150 | assert(!empty); |
152 | return *it; } | 151 | return *it; } |
@@ -176,27 +175,27 @@ namespace opkele { | |||
176 | 175 | ||
177 | template<typename IT,typename T=typename IT::value_type::first_type,typename TR=T&,typename TP=T*> | 176 | template<typename IT,typename T=typename IT::value_type::first_type,typename TR=T&,typename TP=T*> |
178 | class map_keys_iterator : public iterator< | 177 | class map_keys_iterator : public iterator< |
179 | typename IT::iterator_category, | 178 | typename IT::iterator_category, |
180 | T,void,TP,TR> { | 179 | T,void,TP,TR> { |
181 | public: | 180 | public: |
182 | typedef map_keys_iterator<IT,T,TR,TP> self_type; | 181 | typedef map_keys_iterator<IT,T,TR,TP> self_type; |
183 | IT it; | 182 | IT it; |
184 | IT ei; | 183 | IT ei; |
185 | bool empty; | 184 | bool empty; |
186 | 185 | ||
187 | map_keys_iterator() : empty(true) { } | 186 | map_keys_iterator() : empty(true) { } |
188 | map_keys_iterator(const IT& bi, | 187 | map_keys_iterator(const IT& _bi, |
189 | const IT& ei) | 188 | const IT& _ei) |
190 | : it(bi), ei(ei) { empty = (bi==ei); } | 189 | : it(_bi), ei(_ei) { empty = (it==ei); } |
191 | map_keys_iterator(const self_type& x) | 190 | map_keys_iterator(const self_type& x) |
192 | : it(x.it), ei(x.ei), empty(x.empty) { } | 191 | : it(x.it), ei(x.ei), empty(x.empty) { } |
193 | 192 | ||
194 | bool operator==(const self_type& x) const { | 193 | bool operator==(const self_type& x) const { |
195 | return empty?x.empty:(it==x.it); } | 194 | return empty?x.empty:(it==x.it); } |
196 | bool operator!=(const self_type& x) const { | 195 | bool operator!=(const self_type& x) const { |
197 | return empty!=x.empty || it!=x.it; } | 196 | return empty!=x.empty || it!=x.it; } |
198 | 197 | ||
199 | TR operator*() const { | 198 | TR operator*() const { |
200 | assert(!empty); | 199 | assert(!empty); |
201 | return it->first; } | 200 | return it->first; } |
202 | TP operator->() const { | 201 | TP operator->() const { |
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 | |||
@@ -117,24 +117,25 @@ namespace opkele { | |||
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 | ||