Merge lp:~zorba-coders/zorba/feature-uri_module into lp:zorba
- feature-uri_module
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Matthias Brantner |
Approved revision: | 10663 |
Merged at revision: | 10703 |
Proposed branch: | lp:~zorba-coders/zorba/feature-uri_module |
Merge into: | lp:zorba |
Diff against target: |
811 lines (+586/-0) 25 files modified
ChangeLog (+1/-0) modules/com/zorba-xquery/www/modules/CMakeLists.txt (+2/-0) modules/com/zorba-xquery/www/modules/uri.xq (+108/-0) src/context/static_context.cpp (+7/-0) src/context/static_context.h (+1/-0) src/functions/library.cpp (+2/-0) src/functions/pregenerated/func_uris.cpp (+65/-0) src/functions/pregenerated/func_uris.h (+64/-0) src/functions/pregenerated/function_enum.h (+1/-0) src/runtime/spec/mappings.xml (+4/-0) src/runtime/spec/uris/uris.xml (+40/-0) src/runtime/uris/pregenerated/uris.cpp (+66/-0) src/runtime/uris/pregenerated/uris.h (+80/-0) src/runtime/uris/uris_impl.cpp (+105/-0) src/runtime/visitors/pregenerated/planiter_visitor.h (+5/-0) src/runtime/visitors/pregenerated/printer_visitor.cpp (+15/-0) src/runtime/visitors/pregenerated/printer_visitor.h (+3/-0) test/rbkt/ExpQueryResults/zorba/uris/decode_01.xml.res (+1/-0) test/rbkt/ExpQueryResults/zorba/uris/decode_03.xml.res (+1/-0) test/rbkt/ExpQueryResults/zorba/uris/decode_04.xml.res (+1/-0) test/rbkt/Queries/zorba/uris/decode_01.xq (+3/-0) test/rbkt/Queries/zorba/uris/decode_02.spec (+1/-0) test/rbkt/Queries/zorba/uris/decode_02.xq (+3/-0) test/rbkt/Queries/zorba/uris/decode_03.xq (+4/-0) test/rbkt/Queries/zorba/uris/decode_04.xq (+3/-0) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/feature-uri_module |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+96005@code.launchpad.net |
This proposal supersedes a proposal from 2012-02-24.
Commit message
A new module that provides URL-related functions. Currently, it provides functions to do URL-decoding but other URL-related functions (e.g. to retrieve the scheme or path) will be added later.
Description of the change
A new module that provides URL-related functions. Currently, it provides functions to do URL-decoding but other URL-related functions (e.g. to retrieve the scheme or path) will be added later.
Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal | # |
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal | # |
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal | # |
The attempt to merge lp:~zorba-coders/zorba/feature-uri_module into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job feature-
finished. The final status was:
2 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Chris Hillery (ceejatec) wrote : Posted in a previous version of this proposal | # |
Two corrections:
- The transcode::stream is given an explicit source encoding of ISO-8859-1. Surely it should be passed lCharset?
- The XQDoc for uri:decode() says that '+' will be replaced with ' ' before percent-decoding. It is in fact done afterwards. I think actually it should be done first, as the doc says, otherwise %2B will get converted to a space which is probably not desirable.
One question: Is it guaranteed to be safe to do percent-decoding and plus-substitution regardless of the encoding of the input string? Are we presuming that since it's been percent-encoded, the input string is strictly ASCII? It may be best to note that assumption in the doc as well.
Matthias Brantner (matthias-brantner) wrote : | # |
- fixed the parameter for the transcoding stream
- changed the code such that plus-decoding is done before percent-decoding as stated in the docs
- added a note about the assumptions on the input to be ascii-only
Chris Hillery (ceejatec) wrote : | # |
Typo: "characeters" in the doc of all three uri.xq functions. Other than that, changes look good. I'll approve now so you can merge after correcting the typo.
Zorba Build Bot (zorba-buildbot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/feature-uri_module into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job feature-
finished. The final status was:
2 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/feature-uri_module into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job feature-
finished. The final status was:
2 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Chris Hillery (ceejatec) wrote : | # |
The downside of building this functionality into Zorba: In release mode, the .xq file isn't read, so the implemented-
- 10663. By Matthias Brantner
-
fix for the uri module in release module (it's non-pure virtual)
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job feature-
All tests succeeded!
Preview Diff
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2012-03-06 00:09:14 +0000 | |||
3 | +++ ChangeLog 2012-03-06 01:58:21 +0000 | |||
4 | @@ -13,6 +13,7 @@ | |||
5 | 13 | * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context) | 13 | * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context) |
6 | 14 | * Fixed bug 867509 (Can not handle largest xs:unsignedLong values) | 14 | * Fixed bug 867509 (Can not handle largest xs:unsignedLong values) |
7 | 15 | * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator) | 15 | * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator) |
8 | 16 | * New URI module providing percent-decoding functions. | ||
9 | 16 | * Optimization: change the implementation of the free-vars annotation and got rid | 17 | * Optimization: change the implementation of the free-vars annotation and got rid |
10 | 17 | of the annotations map in expressions. | 18 | of the annotations map in expressions. |
11 | 18 | * Fixed bug 909126 (bug in cloning of var_expr) | 19 | * Fixed bug 909126 (bug in cloning of var_expr) |
12 | 19 | 20 | ||
13 | === modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt' | |||
14 | --- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-16 14:11:02 +0000 | |||
15 | +++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-03-06 01:58:21 +0000 | |||
16 | @@ -63,6 +63,8 @@ | |||
17 | 63 | URI "http://www.zorba-xquery.com/modules/schema") | 63 | URI "http://www.zorba-xquery.com/modules/schema") |
18 | 64 | DECLARE_ZORBA_MODULE(FILE string.xq VERSION 2.1 | 64 | DECLARE_ZORBA_MODULE(FILE string.xq VERSION 2.1 |
19 | 65 | URI "http://www.zorba-xquery.com/modules/string") | 65 | URI "http://www.zorba-xquery.com/modules/string") |
20 | 66 | DECLARE_ZORBA_MODULE(FILE uri.xq VERSION 1.0 | ||
21 | 67 | URI "http://www.zorba-xquery.com/modules/uri") | ||
22 | 66 | DECLARE_ZORBA_MODULE(FILE xml.xq VERSION 2.0 | 68 | DECLARE_ZORBA_MODULE(FILE xml.xq VERSION 2.0 |
23 | 67 | URI "http://www.zorba-xquery.com/modules/xml") | 69 | URI "http://www.zorba-xquery.com/modules/xml") |
24 | 68 | DECLARE_ZORBA_MODULE(FILE xqdoc.xq VERSION 2.0 | 70 | DECLARE_ZORBA_MODULE(FILE xqdoc.xq VERSION 2.0 |
25 | 69 | 71 | ||
26 | === added file 'modules/com/zorba-xquery/www/modules/uri.xq' | |||
27 | --- modules/com/zorba-xquery/www/modules/uri.xq 1970-01-01 00:00:00 +0000 | |||
28 | +++ modules/com/zorba-xquery/www/modules/uri.xq 2012-03-06 01:58:21 +0000 | |||
29 | @@ -0,0 +1,108 @@ | |||
30 | 1 | xquery version "1.0"; | ||
31 | 2 | |||
32 | 3 | (: | ||
33 | 4 | : Copyright 2006-2012 The FLWOR Foundation. | ||
34 | 5 | : | ||
35 | 6 | : Licensed under the Apache License, Version 2.0 (the "License"); | ||
36 | 7 | : you may not use this file except in compliance with the License. | ||
37 | 8 | : You may obtain a copy of the License at | ||
38 | 9 | : | ||
39 | 10 | : http://www.apache.org/licenses/LICENSE-2.0 | ||
40 | 11 | : | ||
41 | 12 | : Unless required by applicable law or agreed to in writing, software | ||
42 | 13 | : distributed under the License is distributed on an "AS IS" BASIS, | ||
43 | 14 | : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
44 | 15 | : See the License for the specific language governing permissions and | ||
45 | 16 | : limitations under the License. | ||
46 | 17 | :) | ||
47 | 18 | |||
48 | 19 | (:~ | ||
49 | 20 | : This module provides string related functions. | ||
50 | 21 | : | ||
51 | 22 | : @author Matthias Brantner | ||
52 | 23 | : @project XDM/atomic | ||
53 | 24 | : | ||
54 | 25 | :) | ||
55 | 26 | module namespace uri = "http://www.zorba-xquery.com/modules/uri"; | ||
56 | 27 | |||
57 | 28 | declare namespace zerr = "http://www.zorba-xquery.com/errors"; | ||
58 | 29 | |||
59 | 30 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; | ||
60 | 31 | declare option ver:module-version "1.0"; | ||
61 | 32 | |||
62 | 33 | (:~ | ||
63 | 34 | : Percent-decodes (aka URL decoding) the given string. | ||
64 | 35 | : | ||
65 | 36 | : All percent encoded octets will be translated into their | ||
66 | 37 | : decoded UTF-8 representation. | ||
67 | 38 | : | ||
68 | 39 | : Please note that the percent encoding guarantees that a string | ||
69 | 40 | : consists of ASCII characters only. Passing a string that contains | ||
70 | 41 | : non-ASCII characters results in undefined behavior. | ||
71 | 42 | : | ||
72 | 43 | : @param $s the string to decode | ||
73 | 44 | : | ||
74 | 45 | : @return the percent decoded string | ||
75 | 46 | :) | ||
76 | 47 | declare function uri:decode($u as xs:string) as xs:string | ||
77 | 48 | { | ||
78 | 49 | uri:decode($u, fn:false()) | ||
79 | 50 | }; | ||
80 | 51 | |||
81 | 52 | (:~ | ||
82 | 53 | : Percent-decodes (aka URL decoding) the given string. | ||
83 | 54 | : | ||
84 | 55 | : All percent encoded octets will be translated into their | ||
85 | 56 | : decoded UTF-8 representation. | ||
86 | 57 | : | ||
87 | 58 | : If $decode-plus is specified all occurrences of the char '+' | ||
88 | 59 | : will be replaced with a space ' ' before the percent decoding | ||
89 | 60 | : happens. | ||
90 | 61 | : | ||
91 | 62 | : Please note that the percent encoding guarantees that a string | ||
92 | 63 | : consists of ASCII characters only. Passing a string that contains | ||
93 | 64 | : non-ASCII characters results in undefined behavior. | ||
94 | 65 | : | ||
95 | 66 | : @param $s the string to decode | ||
96 | 67 | : @param $decode-plus whether '+' chars will be replaced with spaces | ||
97 | 68 | : | ||
98 | 69 | : @return the percent decoded string | ||
99 | 70 | :) | ||
100 | 71 | declare function uri:decode( | ||
101 | 72 | $u as xs:string, | ||
102 | 73 | $decode-plus as xs:boolean) as xs:string | ||
103 | 74 | { | ||
104 | 75 | uri:decode($u, $decode-plus, "UTF-8") | ||
105 | 76 | }; | ||
106 | 77 | |||
107 | 78 | (:~ | ||
108 | 79 | : Percent-decodes (aka URL decoding) the given string. | ||
109 | 80 | : | ||
110 | 81 | : All percent encoded octets will be translated into their | ||
111 | 82 | : decoded UTF-8 representation. | ||
112 | 83 | : | ||
113 | 84 | : If $decode-plus is specified all occurrences of the char '+' | ||
114 | 85 | : will be replaced with a space ' ' before the percent decoding | ||
115 | 86 | : happens. | ||
116 | 87 | : | ||
117 | 88 | : The $charset parameter specifies the source charset after precent | ||
118 | 89 | : decoding. It is used to convert the decoded string into UTF-8. | ||
119 | 90 | : | ||
120 | 91 | : Please note that the percent encoding guarantees that a string | ||
121 | 92 | : consists of ASCII characters only. Passing a string that contains | ||
122 | 93 | : non-ASCII characters results in undefined behavior. | ||
123 | 94 | : | ||
124 | 95 | : @param $s the string to decode | ||
125 | 96 | : @param $decode-plus whether '+' chars will be replaced with spaces | ||
126 | 97 | : @param $charset the source charset of the string after percent decoding | ||
127 | 98 | : | ||
128 | 99 | : @return the percent decoded string | ||
129 | 100 | : | ||
130 | 101 | : @error zerr:ZXQP0006 if the given charset is unknown or not supported | ||
131 | 102 | : | ||
132 | 103 | : @error zerr:ZOSE0006 if there is an error transcoding the string | ||
133 | 104 | :) | ||
134 | 105 | declare function uri:decode( | ||
135 | 106 | $s as xs:string, | ||
136 | 107 | $decode-plus as xs:boolean, | ||
137 | 108 | $charset as xs:string) as xs:string external; | ||
138 | 0 | 109 | ||
139 | === modified file 'src/context/static_context.cpp' | |||
140 | --- src/context/static_context.cpp 2012-02-16 14:11:02 +0000 | |||
141 | +++ src/context/static_context.cpp 2012-03-06 01:58:21 +0000 | |||
142 | @@ -366,6 +366,10 @@ | |||
143 | 366 | "http://www.zorba-xquery.com/modules/string"; | 366 | "http://www.zorba-xquery.com/modules/string"; |
144 | 367 | 367 | ||
145 | 368 | const char* | 368 | const char* |
146 | 369 | static_context::ZORBA_URI_FN_NS = | ||
147 | 370 | "http://www.zorba-xquery.com/modules/uri"; | ||
148 | 371 | |||
149 | 372 | const char* | ||
150 | 369 | static_context::ZORBA_FETCH_FN_NS = | 373 | static_context::ZORBA_FETCH_FN_NS = |
151 | 370 | "http://www.zorba-xquery.com/modules/fetch"; | 374 | "http://www.zorba-xquery.com/modules/fetch"; |
152 | 371 | 375 | ||
153 | @@ -441,6 +445,7 @@ | |||
154 | 441 | ns == ZORBA_REFLECTION_FN_NS || | 445 | ns == ZORBA_REFLECTION_FN_NS || |
155 | 442 | ns == ZORBA_SCRIPTING_FN_NS || | 446 | ns == ZORBA_SCRIPTING_FN_NS || |
156 | 443 | ns == ZORBA_STRING_FN_NS || | 447 | ns == ZORBA_STRING_FN_NS || |
157 | 448 | ns == ZORBA_URI_FN_NS || | ||
158 | 444 | ns == ZORBA_JSON_FN_NS || | 449 | ns == ZORBA_JSON_FN_NS || |
159 | 445 | ns == ZORBA_FETCH_FN_NS || | 450 | ns == ZORBA_FETCH_FN_NS || |
160 | 446 | ns == ZORBA_NODE_FN_NS || | 451 | ns == ZORBA_NODE_FN_NS || |
161 | @@ -488,7 +493,9 @@ | |||
162 | 488 | { | 493 | { |
163 | 489 | return (ns == ZORBA_MATH_FN_NS || | 494 | return (ns == ZORBA_MATH_FN_NS || |
164 | 490 | ns == ZORBA_INTROSP_SCTX_FN_NS || | 495 | ns == ZORBA_INTROSP_SCTX_FN_NS || |
165 | 496 | ns == ZORBA_STRING_FN_NS || | ||
166 | 491 | ns == ZORBA_JSON_FN_NS || | 497 | ns == ZORBA_JSON_FN_NS || |
167 | 498 | ns == ZORBA_URI_FN_NS || | ||
168 | 492 | ns == ZORBA_RANDOM_FN_NS); | 499 | ns == ZORBA_RANDOM_FN_NS); |
169 | 493 | } | 500 | } |
170 | 494 | 501 | ||
171 | 495 | 502 | ||
172 | === modified file 'src/context/static_context.h' | |||
173 | --- src/context/static_context.h 2012-02-16 14:11:02 +0000 | |||
174 | +++ src/context/static_context.h 2012-03-06 01:58:21 +0000 | |||
175 | @@ -465,6 +465,7 @@ | |||
176 | 465 | static const char* ZORBA_INTROSP_SCTX_FN_NS; | 465 | static const char* ZORBA_INTROSP_SCTX_FN_NS; |
177 | 466 | static const char* ZORBA_REFLECTION_FN_NS; | 466 | static const char* ZORBA_REFLECTION_FN_NS; |
178 | 467 | static const char* ZORBA_STRING_FN_NS; | 467 | static const char* ZORBA_STRING_FN_NS; |
179 | 468 | static const char* ZORBA_URI_FN_NS; | ||
180 | 468 | static const char* ZORBA_FETCH_FN_NS; | 469 | static const char* ZORBA_FETCH_FN_NS; |
181 | 469 | static const char* ZORBA_NODE_FN_NS; | 470 | static const char* ZORBA_NODE_FN_NS; |
182 | 470 | static const char* ZORBA_XML_FN_NS; | 471 | static const char* ZORBA_XML_FN_NS; |
183 | 471 | 472 | ||
184 | === modified file 'src/functions/library.cpp' | |||
185 | --- src/functions/library.cpp 2012-02-16 14:11:02 +0000 | |||
186 | +++ src/functions/library.cpp 2012-03-06 01:58:21 +0000 | |||
187 | @@ -57,6 +57,7 @@ | |||
188 | 57 | #include "functions/func_sequences.h" | 57 | #include "functions/func_sequences.h" |
189 | 58 | #include "functions/func_sequences_impl.h" | 58 | #include "functions/func_sequences_impl.h" |
190 | 59 | #include "functions/func_strings.h" | 59 | #include "functions/func_strings.h" |
191 | 60 | #include "functions/func_uris.h" | ||
192 | 60 | #include "functions/func_json.h" | 61 | #include "functions/func_json.h" |
193 | 61 | #include "functions/func_var_decl.h" | 62 | #include "functions/func_var_decl.h" |
194 | 62 | #include "functions/func_xqdoc.h" | 63 | #include "functions/func_xqdoc.h" |
195 | @@ -121,6 +122,7 @@ | |||
196 | 121 | populate_context_schema(sctx); | 122 | populate_context_schema(sctx); |
197 | 122 | populate_context_sctx(sctx); | 123 | populate_context_sctx(sctx); |
198 | 123 | populate_context_strings(sctx); | 124 | populate_context_strings(sctx); |
199 | 125 | populate_context_uris(sctx); | ||
200 | 124 | populate_context_sequences(sctx); | 126 | populate_context_sequences(sctx); |
201 | 125 | populate_context_sequences_impl(sctx); | 127 | populate_context_sequences_impl(sctx); |
202 | 126 | populate_context_xqdoc(sctx); | 128 | populate_context_xqdoc(sctx); |
203 | 127 | 129 | ||
204 | === added file 'src/functions/pregenerated/func_uris.cpp' | |||
205 | --- src/functions/pregenerated/func_uris.cpp 1970-01-01 00:00:00 +0000 | |||
206 | +++ src/functions/pregenerated/func_uris.cpp 2012-03-06 01:58:21 +0000 | |||
207 | @@ -0,0 +1,65 @@ | |||
208 | 1 | /* | ||
209 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
210 | 3 | * | ||
211 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
212 | 5 | * you may not use this file except in compliance with the License. | ||
213 | 6 | * You may obtain a copy of the License at | ||
214 | 7 | * | ||
215 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
216 | 9 | * | ||
217 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
218 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
219 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
220 | 13 | * See the License for the specific language governing permissions and | ||
221 | 14 | * limitations under the License. | ||
222 | 15 | */ | ||
223 | 16 | |||
224 | 17 | // ****************************************** | ||
225 | 18 | // * * | ||
226 | 19 | // * THIS IS A GENERATED FILE. DO NOT EDIT! * | ||
227 | 20 | // * SEE .xml FILE WITH SAME NAME * | ||
228 | 21 | // * * | ||
229 | 22 | // ****************************************** | ||
230 | 23 | |||
231 | 24 | |||
232 | 25 | #include "stdafx.h" | ||
233 | 26 | #include "runtime/uris/uris.h" | ||
234 | 27 | #include "functions/func_uris.h" | ||
235 | 28 | |||
236 | 29 | |||
237 | 30 | namespace zorba{ | ||
238 | 31 | |||
239 | 32 | |||
240 | 33 | |||
241 | 34 | PlanIter_t fn_zorba_uri_decode::codegen( | ||
242 | 35 | CompilerCB*, | ||
243 | 36 | static_context* sctx, | ||
244 | 37 | const QueryLoc& loc, | ||
245 | 38 | std::vector<PlanIter_t>& argv, | ||
246 | 39 | expr& ann) const | ||
247 | 40 | { | ||
248 | 41 | return new DecodeURIIterator(sctx, loc, argv); | ||
249 | 42 | } | ||
250 | 43 | |||
251 | 44 | void populate_context_uris(static_context* sctx) | ||
252 | 45 | { | ||
253 | 46 | { | ||
254 | 47 | |||
255 | 48 | |||
256 | 49 | DECL_WITH_KIND(sctx, fn_zorba_uri_decode, | ||
257 | 50 | (createQName("http://www.zorba-xquery.com/modules/uri","","decode"), | ||
258 | 51 | GENV_TYPESYSTEM.STRING_TYPE_ONE, | ||
259 | 52 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE, | ||
260 | 53 | GENV_TYPESYSTEM.STRING_TYPE_ONE, | ||
261 | 54 | GENV_TYPESYSTEM.STRING_TYPE_ONE), | ||
262 | 55 | FunctionConsts::FN_ZORBA_URI_DECODE_3); | ||
263 | 56 | |||
264 | 57 | } | ||
265 | 58 | |||
266 | 59 | } | ||
267 | 60 | |||
268 | 61 | |||
269 | 62 | } | ||
270 | 63 | |||
271 | 64 | |||
272 | 65 | |||
273 | 0 | 66 | ||
274 | === added file 'src/functions/pregenerated/func_uris.h' | |||
275 | --- src/functions/pregenerated/func_uris.h 1970-01-01 00:00:00 +0000 | |||
276 | +++ src/functions/pregenerated/func_uris.h 2012-03-06 01:58:21 +0000 | |||
277 | @@ -0,0 +1,64 @@ | |||
278 | 1 | /* | ||
279 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
280 | 3 | * | ||
281 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
282 | 5 | * you may not use this file except in compliance with the License. | ||
283 | 6 | * You may obtain a copy of the License at | ||
284 | 7 | * | ||
285 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
286 | 9 | * | ||
287 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
288 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
289 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
290 | 13 | * See the License for the specific language governing permissions and | ||
291 | 14 | * limitations under the License. | ||
292 | 15 | */ | ||
293 | 16 | |||
294 | 17 | // ****************************************** | ||
295 | 18 | // * * | ||
296 | 19 | // * THIS IS A GENERATED FILE. DO NOT EDIT! * | ||
297 | 20 | // * SEE .xml FILE WITH SAME NAME * | ||
298 | 21 | // * * | ||
299 | 22 | // ****************************************** | ||
300 | 23 | |||
301 | 24 | |||
302 | 25 | #ifndef ZORBA_FUNCTIONS_URIS_H | ||
303 | 26 | #define ZORBA_FUNCTIONS_URIS_H | ||
304 | 27 | |||
305 | 28 | |||
306 | 29 | #include "common/shared_types.h" | ||
307 | 30 | #include "functions/function_impl.h" | ||
308 | 31 | |||
309 | 32 | |||
310 | 33 | namespace zorba { | ||
311 | 34 | |||
312 | 35 | |||
313 | 36 | void populate_context_uris(static_context* sctx); | ||
314 | 37 | |||
315 | 38 | |||
316 | 39 | |||
317 | 40 | |||
318 | 41 | //fn-zorba-uri:decode | ||
319 | 42 | class fn_zorba_uri_decode : public function | ||
320 | 43 | { | ||
321 | 44 | public: | ||
322 | 45 | fn_zorba_uri_decode(const signature& sig, FunctionConsts::FunctionKind kind) | ||
323 | 46 | : | ||
324 | 47 | function(sig, kind) | ||
325 | 48 | { | ||
326 | 49 | |||
327 | 50 | } | ||
328 | 51 | |||
329 | 52 | CODEGEN_DECL(); | ||
330 | 53 | }; | ||
331 | 54 | |||
332 | 55 | |||
333 | 56 | } //namespace zorba | ||
334 | 57 | |||
335 | 58 | |||
336 | 59 | #endif | ||
337 | 60 | /* | ||
338 | 61 | * Local variables: | ||
339 | 62 | * mode: c++ | ||
340 | 63 | * End: | ||
341 | 64 | */ | ||
342 | 0 | 65 | ||
343 | === modified file 'src/functions/pregenerated/function_enum.h' | |||
344 | --- src/functions/pregenerated/function_enum.h 2012-02-16 14:11:02 +0000 | |||
345 | +++ src/functions/pregenerated/function_enum.h 2012-03-06 01:58:21 +0000 | |||
346 | @@ -374,6 +374,7 @@ | |||
347 | 374 | FN_ZORBA_STRING_MATERIALIZE_1, | 374 | FN_ZORBA_STRING_MATERIALIZE_1, |
348 | 375 | FN_ZORBA_STRING_IS_STREAMABLE_1, | 375 | FN_ZORBA_STRING_IS_STREAMABLE_1, |
349 | 376 | FN_ZORBA_STRING_SPLIT_2, | 376 | FN_ZORBA_STRING_SPLIT_2, |
350 | 377 | FN_ZORBA_URI_DECODE_3, | ||
351 | 377 | FN_ZORBA_XQDOC_XQDOC_1, | 378 | FN_ZORBA_XQDOC_XQDOC_1, |
352 | 378 | FN_ZORBA_XQDOC_XQDOC_CONTENT_1, | 379 | FN_ZORBA_XQDOC_XQDOC_CONTENT_1, |
353 | 379 | 380 | ||
354 | 380 | 381 | ||
355 | === modified file 'src/runtime/spec/mappings.xml' | |||
356 | --- src/runtime/spec/mappings.xml 2012-02-16 14:11:02 +0000 | |||
357 | +++ src/runtime/spec/mappings.xml 2012-03-06 01:58:21 +0000 | |||
358 | @@ -106,6 +106,10 @@ | |||
359 | 106 | define="ZORBA_STRING_FN_NS" | 106 | define="ZORBA_STRING_FN_NS" |
360 | 107 | prefix="fn-zorba-string"/> | 107 | prefix="fn-zorba-string"/> |
361 | 108 | 108 | ||
362 | 109 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/uri" | ||
363 | 110 | define="ZORBA_URI_FN_NS" | ||
364 | 111 | prefix="fn-zorba-uri"/> | ||
365 | 112 | |||
366 | 109 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/converters/json" | 113 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/converters/json" |
367 | 110 | define="ZORBA_JSON_FN_NS" | 114 | define="ZORBA_JSON_FN_NS" |
368 | 111 | prefix="fn-zorba-json"/> | 115 | prefix="fn-zorba-json"/> |
369 | 112 | 116 | ||
370 | === added directory 'src/runtime/spec/uris' | |||
371 | === added file 'src/runtime/spec/uris/uris.xml' | |||
372 | --- src/runtime/spec/uris/uris.xml 1970-01-01 00:00:00 +0000 | |||
373 | +++ src/runtime/spec/uris/uris.xml 2012-03-06 01:58:21 +0000 | |||
374 | @@ -0,0 +1,40 @@ | |||
375 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
376 | 2 | |||
377 | 3 | <!-- | ||
378 | 4 | ///////////////////////////////////////////////////////////////////////////////// | ||
379 | 5 | // // | ||
380 | 6 | // 7.2 Functions to Assemble and Disassemble Strings | ||
381 | 7 | // // | ||
382 | 8 | ///////////////////////////////////////////////////////////////////////////////// | ||
383 | 9 | --> | ||
384 | 10 | <zorba:iterators | ||
385 | 11 | xmlns:zorba="http://www.zorba-xquery.com" | ||
386 | 12 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
387 | 13 | xsi:schemaLocation="http://www.zorba-xquery.com ../runtime.xsd"> | ||
388 | 14 | |||
389 | 15 | <zorba:header> | ||
390 | 16 | <zorba:include form="Quoted">zorbautils/checked_vector.h</zorba:include> | ||
391 | 17 | <zorba:include form="Quoted">zorbatypes/schema_types.h</zorba:include> | ||
392 | 18 | </zorba:header> | ||
393 | 19 | |||
394 | 20 | <!-- | ||
395 | 21 | /******************************************************************************* | ||
396 | 22 | ********************************************************************************/ | ||
397 | 23 | --> | ||
398 | 24 | <zorba:iterator name="DecodeURIIterator"> | ||
399 | 25 | |||
400 | 26 | <zorba:description author="Zorba Team"> | ||
401 | 27 | uri:decode | ||
402 | 28 | </zorba:description> | ||
403 | 29 | |||
404 | 30 | <zorba:function> | ||
405 | 31 | <zorba:signature localname="decode" prefix="fn-zorba-uri"> | ||
406 | 32 | <zorba:param>xs:string</zorba:param> | ||
407 | 33 | <zorba:param>xs:boolean</zorba:param> | ||
408 | 34 | <zorba:param>xs:string</zorba:param> | ||
409 | 35 | <zorba:output>xs:string</zorba:output> | ||
410 | 36 | </zorba:signature> | ||
411 | 37 | </zorba:function> | ||
412 | 38 | </zorba:iterator> | ||
413 | 39 | |||
414 | 40 | </zorba:iterators> | ||
415 | 0 | 41 | ||
416 | === added directory 'src/runtime/uris' | |||
417 | === added directory 'src/runtime/uris/pregenerated' | |||
418 | === added file 'src/runtime/uris/pregenerated/uris.cpp' | |||
419 | --- src/runtime/uris/pregenerated/uris.cpp 1970-01-01 00:00:00 +0000 | |||
420 | +++ src/runtime/uris/pregenerated/uris.cpp 2012-03-06 01:58:21 +0000 | |||
421 | @@ -0,0 +1,66 @@ | |||
422 | 1 | /* | ||
423 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
424 | 3 | * | ||
425 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
426 | 5 | * you may not use this file except in compliance with the License. | ||
427 | 6 | * You may obtain a copy of the License at | ||
428 | 7 | * | ||
429 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
430 | 9 | * | ||
431 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
432 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
433 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
434 | 13 | * See the License for the specific language governing permissions and | ||
435 | 14 | * limitations under the License. | ||
436 | 15 | */ | ||
437 | 16 | |||
438 | 17 | // ****************************************** | ||
439 | 18 | // * * | ||
440 | 19 | // * THIS IS A GENERATED FILE. DO NOT EDIT! * | ||
441 | 20 | // * SEE .xml FILE WITH SAME NAME * | ||
442 | 21 | // * * | ||
443 | 22 | // ****************************************** | ||
444 | 23 | |||
445 | 24 | #include "stdafx.h" | ||
446 | 25 | #include "zorbatypes/rchandle.h" | ||
447 | 26 | #include "zorbatypes/zstring.h" | ||
448 | 27 | #include "runtime/visitors/planiter_visitor.h" | ||
449 | 28 | #include "runtime/uris/uris.h" | ||
450 | 29 | #include "system/globalenv.h" | ||
451 | 30 | |||
452 | 31 | |||
453 | 32 | |||
454 | 33 | namespace zorba { | ||
455 | 34 | |||
456 | 35 | // <DecodeURIIterator> | ||
457 | 36 | const char* DecodeURIIterator::class_name_str = "DecodeURIIterator"; | ||
458 | 37 | DecodeURIIterator::class_factory<DecodeURIIterator> | ||
459 | 38 | DecodeURIIterator::g_class_factory; | ||
460 | 39 | |||
461 | 40 | const serialization::ClassVersion | ||
462 | 41 | DecodeURIIterator::class_versions[] ={{ 1, 0x000905, false}}; | ||
463 | 42 | |||
464 | 43 | const int DecodeURIIterator::class_versions_count = | ||
465 | 44 | sizeof(DecodeURIIterator::class_versions)/sizeof(struct serialization::ClassVersion); | ||
466 | 45 | |||
467 | 46 | void DecodeURIIterator::accept(PlanIterVisitor& v) const { | ||
468 | 47 | v.beginVisit(*this); | ||
469 | 48 | |||
470 | 49 | std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); | ||
471 | 50 | std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); | ||
472 | 51 | for ( ; lIter != lEnd; ++lIter ){ | ||
473 | 52 | (*lIter)->accept(v); | ||
474 | 53 | } | ||
475 | 54 | |||
476 | 55 | v.endVisit(*this); | ||
477 | 56 | } | ||
478 | 57 | |||
479 | 58 | DecodeURIIterator::~DecodeURIIterator() {} | ||
480 | 59 | |||
481 | 60 | // </DecodeURIIterator> | ||
482 | 61 | |||
483 | 62 | |||
484 | 63 | |||
485 | 64 | } | ||
486 | 65 | |||
487 | 66 | |||
488 | 0 | 67 | ||
489 | === added file 'src/runtime/uris/pregenerated/uris.h' | |||
490 | --- src/runtime/uris/pregenerated/uris.h 1970-01-01 00:00:00 +0000 | |||
491 | +++ src/runtime/uris/pregenerated/uris.h 2012-03-06 01:58:21 +0000 | |||
492 | @@ -0,0 +1,80 @@ | |||
493 | 1 | /* | ||
494 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
495 | 3 | * | ||
496 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
497 | 5 | * you may not use this file except in compliance with the License. | ||
498 | 6 | * You may obtain a copy of the License at | ||
499 | 7 | * | ||
500 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
501 | 9 | * | ||
502 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
503 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
504 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
505 | 13 | * See the License for the specific language governing permissions and | ||
506 | 14 | * limitations under the License. | ||
507 | 15 | */ | ||
508 | 16 | |||
509 | 17 | // ****************************************** | ||
510 | 18 | // * * | ||
511 | 19 | // * THIS IS A GENERATED FILE. DO NOT EDIT! * | ||
512 | 20 | // * SEE .xml FILE WITH SAME NAME * | ||
513 | 21 | // * * | ||
514 | 22 | // ****************************************** | ||
515 | 23 | #ifndef ZORBA_RUNTIME_URIS_URIS_H | ||
516 | 24 | #define ZORBA_RUNTIME_URIS_URIS_H | ||
517 | 25 | |||
518 | 26 | |||
519 | 27 | #include "common/shared_types.h" | ||
520 | 28 | |||
521 | 29 | |||
522 | 30 | |||
523 | 31 | #include "runtime/base/narybase.h" | ||
524 | 32 | #include "zorbautils/checked_vector.h" | ||
525 | 33 | #include "zorbatypes/schema_types.h" | ||
526 | 34 | |||
527 | 35 | |||
528 | 36 | namespace zorba { | ||
529 | 37 | |||
530 | 38 | /** | ||
531 | 39 | * | ||
532 | 40 | * uri:decode | ||
533 | 41 | * | ||
534 | 42 | * Author: Zorba Team | ||
535 | 43 | */ | ||
536 | 44 | class DecodeURIIterator : public NaryBaseIterator<DecodeURIIterator, PlanIteratorState> | ||
537 | 45 | { | ||
538 | 46 | public: | ||
539 | 47 | SERIALIZABLE_CLASS(DecodeURIIterator); | ||
540 | 48 | |||
541 | 49 | SERIALIZABLE_CLASS_CONSTRUCTOR2T(DecodeURIIterator, | ||
542 | 50 | NaryBaseIterator<DecodeURIIterator, PlanIteratorState>); | ||
543 | 51 | |||
544 | 52 | void serialize( ::zorba::serialization::Archiver& ar) | ||
545 | 53 | { | ||
546 | 54 | serialize_baseclass(ar, | ||
547 | 55 | (NaryBaseIterator<DecodeURIIterator, PlanIteratorState>*)this); | ||
548 | 56 | } | ||
549 | 57 | |||
550 | 58 | DecodeURIIterator( | ||
551 | 59 | static_context* sctx, | ||
552 | 60 | const QueryLoc& loc, | ||
553 | 61 | std::vector<PlanIter_t>& children) | ||
554 | 62 | : | ||
555 | 63 | NaryBaseIterator<DecodeURIIterator, PlanIteratorState>(sctx, loc, children) | ||
556 | 64 | {} | ||
557 | 65 | |||
558 | 66 | virtual ~DecodeURIIterator(); | ||
559 | 67 | |||
560 | 68 | void accept(PlanIterVisitor& v) const; | ||
561 | 69 | |||
562 | 70 | bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; | ||
563 | 71 | }; | ||
564 | 72 | |||
565 | 73 | |||
566 | 74 | } | ||
567 | 75 | #endif | ||
568 | 76 | /* | ||
569 | 77 | * Local variables: | ||
570 | 78 | * mode: c++ | ||
571 | 79 | * End: | ||
572 | 80 | */ | ||
573 | 0 | 81 | ||
574 | === added file 'src/runtime/uris/uris_impl.cpp' | |||
575 | --- src/runtime/uris/uris_impl.cpp 1970-01-01 00:00:00 +0000 | |||
576 | +++ src/runtime/uris/uris_impl.cpp 2012-03-06 01:58:21 +0000 | |||
577 | @@ -0,0 +1,105 @@ | |||
578 | 1 | /* | ||
579 | 2 | * Copyright 2006-2012 The FLWOR Foundation. | ||
580 | 3 | * | ||
581 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
582 | 5 | * you may not use this file except in compliance with the License. | ||
583 | 6 | * You may obtain a copy of the License at | ||
584 | 7 | * | ||
585 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
586 | 9 | * | ||
587 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
588 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
589 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
590 | 13 | * See the License for the specific language governing permissions and | ||
591 | 14 | * limitations under the License. | ||
592 | 15 | */ | ||
593 | 16 | #include "stdafx.h" | ||
594 | 17 | |||
595 | 18 | #include <algorithm> | ||
596 | 19 | |||
597 | 20 | #include "common/common.h" | ||
598 | 21 | |||
599 | 22 | #include "diagnostics/assert.h" | ||
600 | 23 | #include "diagnostics/xquery_diagnostics.h" | ||
601 | 24 | #include "diagnostics/util_macros.h" | ||
602 | 25 | |||
603 | 26 | #include "runtime/uris/uris.h" | ||
604 | 27 | |||
605 | 28 | #include "system/globalenv.h" | ||
606 | 29 | #include "store/api/item_factory.h" | ||
607 | 30 | |||
608 | 31 | #include "zorba/transcode_stream.h" | ||
609 | 32 | |||
610 | 33 | #include "util/uri_util.h" | ||
611 | 34 | |||
612 | 35 | using namespace std; | ||
613 | 36 | |||
614 | 37 | namespace zorba { | ||
615 | 38 | |||
616 | 39 | /****************************************************************************** | ||
617 | 40 | *******************************************************************************/ | ||
618 | 41 | bool | ||
619 | 42 | DecodeURIIterator::nextImpl(store::Item_t& result, PlanState& planState) const | ||
620 | 43 | { | ||
621 | 44 | store::Item_t lString, lDecodePlus, lEncoding; | ||
622 | 45 | zstring lDecodedString, lCharset; | ||
623 | 46 | |||
624 | 47 | PlanIteratorState* state; | ||
625 | 48 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); | ||
626 | 49 | |||
627 | 50 | consumeNext(lString, theChildren[0].getp(), planState); | ||
628 | 51 | consumeNext(lDecodePlus, theChildren[1].getp(), planState); | ||
629 | 52 | consumeNext(lEncoding, theChildren[2].getp(), planState); | ||
630 | 53 | |||
631 | 54 | lString->getStringValue2(lDecodedString); | ||
632 | 55 | lEncoding->getStringValue2(lCharset); | ||
633 | 56 | |||
634 | 57 | if (lDecodePlus->getBooleanValue()) | ||
635 | 58 | { | ||
636 | 59 | std::replace( lDecodedString.begin(), lDecodedString.end(), '+', ' ' ); | ||
637 | 60 | } | ||
638 | 61 | |||
639 | 62 | uri::decode(lDecodedString); | ||
640 | 63 | |||
641 | 64 | if (transcode::is_necessary(lCharset.c_str())) | ||
642 | 65 | { | ||
643 | 66 | if (!transcode::is_supported(lCharset.c_str())) | ||
644 | 67 | { | ||
645 | 68 | throw XQUERY_EXCEPTION( | ||
646 | 69 | zerr::ZXQP0006_UNKNOWN_ENCODING, | ||
647 | 70 | ERROR_PARAMS( lCharset ), | ||
648 | 71 | ERROR_LOC( loc ) | ||
649 | 72 | ); | ||
650 | 73 | } | ||
651 | 74 | |||
652 | 75 | try | ||
653 | 76 | { | ||
654 | 77 | transcode::stream<istringstream> lTranscoder( | ||
655 | 78 | lCharset.c_str(), | ||
656 | 79 | lDecodedString.c_str() | ||
657 | 80 | ); | ||
658 | 81 | |||
659 | 82 | lDecodedString.clear(); | ||
660 | 83 | char buf[1024]; | ||
661 | 84 | while (lTranscoder.good()) | ||
662 | 85 | { | ||
663 | 86 | lTranscoder.read(buf, 1024); | ||
664 | 87 | lDecodedString.append(buf, lTranscoder.gcount()); | ||
665 | 88 | } | ||
666 | 89 | } | ||
667 | 90 | catch (ZorbaException& e) | ||
668 | 91 | { | ||
669 | 92 | throw XQUERY_EXCEPTION( | ||
670 | 93 | zerr::ZOSE0006_TRANSCODING_ERROR, | ||
671 | 94 | ERROR_PARAMS( e.what() ), | ||
672 | 95 | ERROR_LOC( loc ) | ||
673 | 96 | ); | ||
674 | 97 | } | ||
675 | 98 | } | ||
676 | 99 | |||
677 | 100 | STACK_PUSH(GENV_ITEMFACTORY->createString(result, lDecodedString), state ); | ||
678 | 101 | |||
679 | 102 | STACK_END (state); | ||
680 | 103 | } | ||
681 | 104 | } // namespace zorba | ||
682 | 105 | /* vim:set et sw=2 ts=2: */ | ||
683 | 0 | 106 | ||
684 | === modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h' | |||
685 | --- src/runtime/visitors/pregenerated/planiter_visitor.h 2012-02-16 14:11:02 +0000 | |||
686 | +++ src/runtime/visitors/pregenerated/planiter_visitor.h 2012-03-06 01:58:21 +0000 | |||
687 | @@ -588,6 +588,8 @@ | |||
688 | 588 | 588 | ||
689 | 589 | class StringSplitIterator; | 589 | class StringSplitIterator; |
690 | 590 | 590 | ||
691 | 591 | class DecodeURIIterator; | ||
692 | 592 | |||
693 | 591 | class XQDocIterator; | 593 | class XQDocIterator; |
694 | 592 | 594 | ||
695 | 593 | class XQDocContentIterator; | 595 | class XQDocContentIterator; |
696 | @@ -1438,6 +1440,9 @@ | |||
697 | 1438 | virtual void beginVisit ( const StringSplitIterator& ) = 0; | 1440 | virtual void beginVisit ( const StringSplitIterator& ) = 0; |
698 | 1439 | virtual void endVisit ( const StringSplitIterator& ) = 0; | 1441 | virtual void endVisit ( const StringSplitIterator& ) = 0; |
699 | 1440 | 1442 | ||
700 | 1443 | virtual void beginVisit ( const DecodeURIIterator& ) = 0; | ||
701 | 1444 | virtual void endVisit ( const DecodeURIIterator& ) = 0; | ||
702 | 1445 | |||
703 | 1441 | virtual void beginVisit ( const XQDocIterator& ) = 0; | 1446 | virtual void beginVisit ( const XQDocIterator& ) = 0; |
704 | 1442 | virtual void endVisit ( const XQDocIterator& ) = 0; | 1447 | virtual void endVisit ( const XQDocIterator& ) = 0; |
705 | 1443 | 1448 | ||
706 | 1444 | 1449 | ||
707 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp' | |||
708 | --- src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-02-16 14:11:02 +0000 | |||
709 | +++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-03-06 01:58:21 +0000 | |||
710 | @@ -64,6 +64,7 @@ | |||
711 | 64 | #include "runtime/store/documents.h" | 64 | #include "runtime/store/documents.h" |
712 | 65 | #include "runtime/store/maps.h" | 65 | #include "runtime/store/maps.h" |
713 | 66 | #include "runtime/strings/strings.h" | 66 | #include "runtime/strings/strings.h" |
714 | 67 | #include "runtime/uris/uris.h" | ||
715 | 67 | #include "runtime/xqdoc/xqdoc.h" | 68 | #include "runtime/xqdoc/xqdoc.h" |
716 | 68 | 69 | ||
717 | 69 | namespace zorba{ | 70 | namespace zorba{ |
718 | @@ -4004,6 +4005,20 @@ | |||
719 | 4004 | // </StringSplitIterator> | 4005 | // </StringSplitIterator> |
720 | 4005 | 4006 | ||
721 | 4006 | 4007 | ||
722 | 4008 | // <DecodeURIIterator> | ||
723 | 4009 | void PrinterVisitor::beginVisit ( const DecodeURIIterator& a) { | ||
724 | 4010 | thePrinter.startBeginVisit("DecodeURIIterator", ++theId); | ||
725 | 4011 | printCommons( &a, theId ); | ||
726 | 4012 | thePrinter.endBeginVisit( theId ); | ||
727 | 4013 | } | ||
728 | 4014 | |||
729 | 4015 | void PrinterVisitor::endVisit ( const DecodeURIIterator& ) { | ||
730 | 4016 | thePrinter.startEndVisit(); | ||
731 | 4017 | thePrinter.endEndVisit(); | ||
732 | 4018 | } | ||
733 | 4019 | // </DecodeURIIterator> | ||
734 | 4020 | |||
735 | 4021 | |||
736 | 4007 | // <XQDocIterator> | 4022 | // <XQDocIterator> |
737 | 4008 | void PrinterVisitor::beginVisit ( const XQDocIterator& a) { | 4023 | void PrinterVisitor::beginVisit ( const XQDocIterator& a) { |
738 | 4009 | thePrinter.startBeginVisit("XQDocIterator", ++theId); | 4024 | thePrinter.startBeginVisit("XQDocIterator", ++theId); |
739 | 4010 | 4025 | ||
740 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.h' | |||
741 | --- src/runtime/visitors/pregenerated/printer_visitor.h 2012-02-16 14:11:02 +0000 | |||
742 | +++ src/runtime/visitors/pregenerated/printer_visitor.h 2012-03-06 01:58:21 +0000 | |||
743 | @@ -885,6 +885,9 @@ | |||
744 | 885 | void beginVisit( const StringSplitIterator& ); | 885 | void beginVisit( const StringSplitIterator& ); |
745 | 886 | void endVisit ( const StringSplitIterator& ); | 886 | void endVisit ( const StringSplitIterator& ); |
746 | 887 | 887 | ||
747 | 888 | void beginVisit( const DecodeURIIterator& ); | ||
748 | 889 | void endVisit ( const DecodeURIIterator& ); | ||
749 | 890 | |||
750 | 888 | void beginVisit( const XQDocIterator& ); | 891 | void beginVisit( const XQDocIterator& ); |
751 | 889 | void endVisit ( const XQDocIterator& ); | 892 | void endVisit ( const XQDocIterator& ); |
752 | 890 | 893 | ||
753 | 891 | 894 | ||
754 | === added directory 'test/rbkt/ExpQueryResults/zorba/uris' | |||
755 | === added file 'test/rbkt/ExpQueryResults/zorba/uris/decode_01.xml.res' | |||
756 | --- test/rbkt/ExpQueryResults/zorba/uris/decode_01.xml.res 1970-01-01 00:00:00 +0000 | |||
757 | +++ test/rbkt/ExpQueryResults/zorba/uris/decode_01.xml.res 2012-03-06 01:58:21 +0000 | |||
758 | @@ -0,0 +1,1 @@ | |||
759 | 1 | foo=ä¥FÅõ | ||
760 | 0 | 2 | ||
761 | === added file 'test/rbkt/ExpQueryResults/zorba/uris/decode_03.xml.res' | |||
762 | --- test/rbkt/ExpQueryResults/zorba/uris/decode_03.xml.res 1970-01-01 00:00:00 +0000 | |||
763 | +++ test/rbkt/ExpQueryResults/zorba/uris/decode_03.xml.res 2012-03-06 01:58:21 +0000 | |||
764 | @@ -0,0 +1,1 @@ | |||
765 | 1 | ä¨bcö | ||
766 | 0 | 2 | ||
767 | === added file 'test/rbkt/ExpQueryResults/zorba/uris/decode_04.xml.res' | |||
768 | --- test/rbkt/ExpQueryResults/zorba/uris/decode_04.xml.res 1970-01-01 00:00:00 +0000 | |||
769 | +++ test/rbkt/ExpQueryResults/zorba/uris/decode_04.xml.res 2012-03-06 01:58:21 +0000 | |||
770 | @@ -0,0 +1,1 @@ | |||
771 | 1 | äö ü | ||
772 | 0 | 2 | ||
773 | === added directory 'test/rbkt/Queries/zorba/uris' | |||
774 | === added file 'test/rbkt/Queries/zorba/uris/decode_01.xq' | |||
775 | --- test/rbkt/Queries/zorba/uris/decode_01.xq 1970-01-01 00:00:00 +0000 | |||
776 | +++ test/rbkt/Queries/zorba/uris/decode_01.xq 2012-03-06 01:58:21 +0000 | |||
777 | @@ -0,0 +1,3 @@ | |||
778 | 1 | import module namespace u = "http://www.zorba-xquery.com/modules/uri"; | ||
779 | 2 | |||
780 | 3 | u:decode("foo=%E4%A5F%C5%F5", fn:false(), "ISO-8859-1") | ||
781 | 0 | 4 | ||
782 | === added file 'test/rbkt/Queries/zorba/uris/decode_02.spec' | |||
783 | --- test/rbkt/Queries/zorba/uris/decode_02.spec 1970-01-01 00:00:00 +0000 | |||
784 | +++ test/rbkt/Queries/zorba/uris/decode_02.spec 2012-03-06 01:58:21 +0000 | |||
785 | @@ -0,0 +1,1 @@ | |||
786 | 1 | Error: http://www.zorba-xquery.com/errors:ZXQP0006 | ||
787 | 0 | 2 | ||
788 | === added file 'test/rbkt/Queries/zorba/uris/decode_02.xq' | |||
789 | --- test/rbkt/Queries/zorba/uris/decode_02.xq 1970-01-01 00:00:00 +0000 | |||
790 | +++ test/rbkt/Queries/zorba/uris/decode_02.xq 2012-03-06 01:58:21 +0000 | |||
791 | @@ -0,0 +1,3 @@ | |||
792 | 1 | import module namespace u = "http://www.zorba-xquery.com/modules/uri"; | ||
793 | 2 | |||
794 | 3 | u:decode("foo=%E4%A5F%C5%F5", fn:false(), "foo") | ||
795 | 0 | 4 | ||
796 | === added file 'test/rbkt/Queries/zorba/uris/decode_03.xq' | |||
797 | --- test/rbkt/Queries/zorba/uris/decode_03.xq 1970-01-01 00:00:00 +0000 | |||
798 | +++ test/rbkt/Queries/zorba/uris/decode_03.xq 2012-03-06 01:58:21 +0000 | |||
799 | @@ -0,0 +1,4 @@ | |||
800 | 1 | import module namespace u = "http://www.zorba-xquery.com/modules/uri"; | ||
801 | 2 | |||
802 | 3 | u:decode("%C3%A4%C2%A8bc%C3%B6", fn:false()) | ||
803 | 4 | |||
804 | 0 | 5 | ||
805 | === added file 'test/rbkt/Queries/zorba/uris/decode_04.xq' | |||
806 | --- test/rbkt/Queries/zorba/uris/decode_04.xq 1970-01-01 00:00:00 +0000 | |||
807 | +++ test/rbkt/Queries/zorba/uris/decode_04.xq 2012-03-06 01:58:21 +0000 | |||
808 | @@ -0,0 +1,3 @@ | |||
809 | 1 | import module namespace u = "http://www.zorba-xquery.com/modules/uri"; | ||
810 | 2 | |||
811 | 3 | u:decode("%C3%A4%C3%B6+%C3%BC", fn:true()) |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ feature- uri_module- 2012-02- 24T03-31- 06.652Z/ log.html
Log at: http://