Merge lp:~zorba-coders/zorba/bug1132937 into lp:zorba
- bug1132937
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~zorba-coders/zorba/bug1132937 | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
6458 lines (+1674/-3087) 103 files modified
doc/php/examples/CMakeLists.txt (+15/-14) doc/php/examples/php.ini.in (+1/-1) doc/php/examples/simple.php.in (+1/-1) doc/php/examples/test.php.in (+1/-1) doc/php/examples/zorba_api.php (+0/-178) include/zorba/internal/diagnostic.h (+2/-3) include/zorba/xquery_exception.h (+2/-2) src/diagnostics/diagnostic.cpp (+4/-0) src/precompiled/stdafx.h (+0/-1) src/unit_tests/test_mem_sizeof.cpp (+1/-0) swig/Config.h (+0/-1) swig/DiagnosticHandler.i (+2/-2) swig/DynamicContext.h (+5/-5) swig/DynamicContext.i (+2/-2) swig/Exceptions.i (+3/-3) swig/Item.h (+2/-2) swig/Item.i (+2/-2) swig/ItemFactory.h (+112/-66) swig/ItemFactory.i (+132/-78) swig/StaticContext.i (+4/-4) swig/TypeIdentifier.i (+3/-3) swig/ZorbaStreamBuffer.i (+1/-1) swig/csharp/tests/CMakeLists.txt (+2/-0) swig/csharp/tests/satellites.json (+17/-0) swig/csharp/tests/test01.cs (+0/-2) swig/csharp/tests/test09.cs (+95/-0) swig/csharp/tests/test10.cs (+86/-0) swig/java/CMakeLists.txt (+12/-12) swig/php/CMakeLists.txt (+20/-9) swig/php/XQueryProcessor.php (+1/-1) swig/php/postfix.cmake (+8/-0) swig/php/tests/CMakeLists.txt (+24/-64) swig/php/tests/php.ini.in (+1/-1) swig/php/tests/satellites.json (+17/-0) swig/php/tests/test01.php (+1/-1) swig/php/tests/test02.php (+1/-1) swig/php/tests/test03.php (+0/-48) swig/php/tests/test03.php.disabled (+52/-0) swig/php/tests/test04.php (+1/-1) swig/php/tests/test05.php (+1/-1) swig/php/tests/test06.php (+1/-1) swig/php/tests/test07.php (+1/-1) swig/php/tests/test08.php (+1/-1) swig/php/tests/test09.php (+22/-59) swig/php/tests/test10.php (+41/-29) swig/php/tests/test11.php (+25/-14) swig/php/tests/test12.php (+0/-52) swig/php/tests/test13.php (+0/-53) swig/php/tests/test14.php (+0/-53) swig/php/tests/zorba_api.php (+0/-178) swig/php/zorba_api.i (+8/-0) swig/php/zorba_api_wrapper.php (+0/-1215) swig/python/tests/CMakeLists.txt (+26/-25) swig/python/tests/books.xml (+11/-0) swig/python/tests/books.xml.in (+0/-11) swig/python/tests/compilerHints.xq (+4/-0) swig/python/tests/compilerHints.xq.in (+0/-4) swig/python/tests/satellites.json (+17/-0) swig/python/tests/test01.py (+26/-0) swig/python/tests/test01.py.in (+0/-26) swig/python/tests/test02.py (+41/-0) swig/python/tests/test02.py.in (+0/-41) swig/python/tests/test03.py (+43/-0) swig/python/tests/test03.py.in (+0/-43) swig/python/tests/test04.py (+42/-0) swig/python/tests/test04.py.in (+0/-42) swig/python/tests/test04.xq (+4/-0) swig/python/tests/test04.xq.in (+0/-4) swig/python/tests/test05.py (+42/-0) swig/python/tests/test05.py.in (+0/-42) swig/python/tests/test05.xq (+7/-0) swig/python/tests/test05.xq.in (+0/-7) swig/python/tests/test06.py (+42/-0) swig/python/tests/test06.py.in (+0/-42) swig/python/tests/test06.xq (+7/-0) swig/python/tests/test06.xq.in (+0/-7) swig/python/tests/test07.1.py (+54/-0) swig/python/tests/test07.1.py.in (+0/-54) swig/python/tests/test07.2.py (+81/-0) swig/python/tests/test07.2.py.in (+0/-81) swig/python/tests/test08.py (+112/-0) swig/python/tests/test08.py.in (+0/-112) swig/python/tests/test10.py (+51/-0) swig/python/tests/test10.py.in (+0/-51) swig/python/tests/test11.py (+42/-0) swig/python/tests/test11.py.in (+0/-42) swig/python/tests/test12.py (+51/-0) swig/python/tests/test12.py.in (+0/-49) swig/python/tests/test13.py (+43/-0) swig/python/tests/test13.py.in (+0/-50) swig/python/tests/test14.py (+50/-0) swig/python/tests/test14.py.in (+0/-50) swig/ruby/tests/CMakeLists.txt (+7/-6) swig/ruby/tests/satellites.json (+17/-0) swig/ruby/tests/test12.rb (+37/-34) swig/ruby/tests/test13.rb (+25/-34) swig/ruby/tests/test14.rb (+26/-33) swig/ruby/zorba_api.i (+4/-1) swig/xqj/CMakeLists.txt (+2/-2) swig/xqj/ZorbaXQDataSource.java (+2/-2) swig/xqj/ZorbaXQSequenceType.java (+6/-6) swig/xqj/ZorbaXQStaticCollectionManager.java (+3/-3) swig/zorba_api.i (+16/-16) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug1132937 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rodolfo Ochoa | Pending | ||
Review via email: mp+155478@code.launchpad.net |
Commit message
Fixes for API
Description of the change
Fixes for API
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/bug1132937 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug1132937-2013-03-
final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
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/bug1132937 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug1132937-2013-03-
final status was:
14 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
- 11281. By Rodolfo Ochoa
-
Fixes for PHP in linux
- 11282. By Rodolfo Ochoa
-
Merge from trunk
- 11283. By Rodolfo Ochoa
-
Merge from xsDateTimeStamp
- 11284. By Rodolfo Ochoa
-
- Added DateTimeStamp to the API
- Fix for DocumentType in TypeIdentifier class
- Warning Fix - 11285. By Rodolfo Ochoa
-
merge from .../bug924756-xsDateTimeStamp
- 11286. By Rodolfo Ochoa
-
Relocating createDateTimeStamp
- 11287. By Rodolfo Ochoa
-
Fix - typo moving methods
- 11288. By Rodolfo Ochoa
-
Fixes for older versions of PHP
- 11289. By Rodolfo Ochoa
-
More fixes for weird errors
Unmerged revisions
Preview Diff
1 | === modified file 'doc/php/examples/CMakeLists.txt' | |||
2 | --- doc/php/examples/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
3 | +++ doc/php/examples/CMakeLists.txt 2013-03-27 00:40:33 +0000 | |||
4 | @@ -14,30 +14,31 @@ | |||
5 | 14 | 14 | ||
6 | 15 | IF(PHP5_FOUND) | 15 | IF(PHP5_FOUND) |
7 | 16 | 16 | ||
10 | 17 | MESSAGE(STATUS "PHP Found and Active!") | 17 | MESSAGE(STATUS "PHP Found, installing examples...") |
11 | 18 | 18 | ||
12 | 19 | SET(phpPath ${CMAKE_BINARY_DIR}/swig/php) | 19 | SET(phpPath ${CMAKE_BINARY_DIR}/swig/php) |
13 | 20 | MESSAGE(STATUS "PHP Path:" ${phpPath}) | ||
14 | 21 | IF (MSVC_IDE) | 20 | IF (MSVC_IDE) |
15 | 22 | SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php/@CMAKE_BUILD_TYPE@) | 21 | SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php/@CMAKE_BUILD_TYPE@) |
16 | 23 | ELSE (MSVC_IDE) | 22 | ELSE (MSVC_IDE) |
17 | 24 | SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php) | 23 | SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php) |
18 | 25 | ENDIF (MSVC_IDE) | 24 | ENDIF (MSVC_IDE) |
22 | 26 | MESSAGE(STATUS "PHP Extension Path: " ${phpExtensionPath}) | 25 | SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php/Zorba) |
23 | 27 | SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php) | 26 | |
24 | 28 | MESSAGE(STATUS "PHP Include Path: " ${phpExtensionPath}) | 27 | IF (WIN32) |
25 | 28 | STRING(REGEX REPLACE "/" "\\\\" phpExtensionPath "${phpExtensionPath}") | ||
26 | 29 | STRING(REGEX REPLACE "/" "\\\\" phpPath "${phpPath}") | ||
27 | 30 | STRING(REGEX REPLACE "/" "\\\\" phpIncludePath "${phpIncludePath}") | ||
28 | 31 | ENDIF (WIN32) | ||
29 | 32 | |||
30 | 29 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini) | 33 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini) |
31 | 30 | MESSAGE(STATUS "Configuration file: " ${CMAKE_CURRENT_BINARY_DIR}/php.ini) | ||
32 | 31 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simple.php.in ${CMAKE_CURRENT_BINARY_DIR}/simple.php) | 34 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simple.php.in ${CMAKE_CURRENT_BINARY_DIR}/simple.php) |
33 | 32 | MESSAGE(STATUS "Simple configuration file: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php) | ||
34 | 33 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test.php.in ${CMAKE_CURRENT_BINARY_DIR}/test.php) | 35 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test.php.in ${CMAKE_CURRENT_BINARY_DIR}/test.php) |
38 | 34 | MESSAGE(STATUS "PHP test file configured: " ${CMAKE_CURRENT_BINARY_DIR}/test.php) | 36 | |
39 | 35 | ADD_TEST("php1" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/simple.php) | 37 | IF (NOT WIN32) #Disabled, on windows there is a bug in php - Segfault within Try..Catch |
40 | 36 | MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php) | 38 | ADD_TEST("php1" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/simple.php) |
41 | 39 | ENDIF (NOT WIN32) | ||
42 | 40 | |||
43 | 37 | ADD_TEST("php2" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/test.php) | 41 | ADD_TEST("php2" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/test.php) |
44 | 38 | |||
45 | 39 | MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/test.php) | ||
46 | 40 | |||
47 | 41 | 42 | ||
48 | 42 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/simple.php ${CMAKE_CURRENT_BINARY_DIR}/test.php | 43 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/simple.php ${CMAKE_CURRENT_BINARY_DIR}/test.php |
49 | 43 | COMPONENT "php_examples" | 44 | COMPONENT "php_examples" |
50 | 44 | 45 | ||
51 | === modified file 'doc/php/examples/php.ini.in' | |||
52 | --- doc/php/examples/php.ini.in 2013-02-07 17:24:36 +0000 | |||
53 | +++ doc/php/examples/php.ini.in 2013-03-27 00:40:33 +0000 | |||
54 | @@ -1,3 +1,3 @@ | |||
55 | 1 | enable_dl=On | 1 | enable_dl=On |
56 | 2 | extension_dir=@phpExtensionPath@ | 2 | extension_dir=@phpExtensionPath@ |
57 | 3 | include_path=".:@phpIncludePath@" | ||
58 | 4 | \ No newline at end of file | 3 | \ No newline at end of file |
59 | 4 | include_path="@phpIncludePath@" | ||
60 | 5 | \ No newline at end of file | 5 | \ No newline at end of file |
61 | 6 | 6 | ||
62 | === modified file 'doc/php/examples/simple.php.in' | |||
63 | --- doc/php/examples/simple.php.in 2013-02-07 17:24:36 +0000 | |||
64 | +++ doc/php/examples/simple.php.in 2013-03-27 00:40:33 +0000 | |||
65 | @@ -14,7 +14,7 @@ | |||
66 | 14 | * See the License for the specific language governing permissions and | 14 | * See the License for the specific language governing permissions and |
67 | 15 | * limitations under the License. | 15 | * limitations under the License. |
68 | 16 | */ | 16 | */ |
70 | 17 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 17 | require 'zorba_api_wrapper.php'; |
71 | 18 | 18 | ||
72 | 19 | function example_1(Zorba $aZorba) | 19 | function example_1(Zorba $aZorba) |
73 | 20 | { | 20 | { |
74 | 21 | 21 | ||
75 | === modified file 'doc/php/examples/test.php.in' | |||
76 | --- doc/php/examples/test.php.in 2012-01-18 08:31:25 +0000 | |||
77 | +++ doc/php/examples/test.php.in 2013-03-27 00:40:33 +0000 | |||
78 | @@ -14,7 +14,7 @@ | |||
79 | 14 | * See the License for the specific language governing permissions and | 14 | * See the License for the specific language governing permissions and |
80 | 15 | * limitations under the License. | 15 | * limitations under the License. |
81 | 16 | */ | 16 | */ |
83 | 17 | require '@phpPath@/Zorba/XQueryProcessor.php'; | 17 | require 'XQueryProcessor.php'; |
84 | 18 | 18 | ||
85 | 19 | function omitXMLDecl($xml) | 19 | function omitXMLDecl($xml) |
86 | 20 | { | 20 | { |
87 | 21 | 21 | ||
88 | === removed file 'doc/php/examples/zorba_api.php' | |||
89 | --- doc/php/examples/zorba_api.php 2013-02-07 17:24:36 +0000 | |||
90 | +++ doc/php/examples/zorba_api.php 1970-01-01 00:00:00 +0000 | |||
91 | @@ -1,178 +0,0 @@ | |||
92 | 1 | <?php | ||
93 | 2 | /* | ||
94 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | ||
95 | 4 | * | ||
96 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
97 | 6 | * you may not use this file except in compliance with the License. | ||
98 | 7 | * You may obtain a copy of the License at | ||
99 | 8 | * | ||
100 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
101 | 10 | * | ||
102 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
103 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
104 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
105 | 14 | * See the License for the specific language governing permissions and | ||
106 | 15 | * limitations under the License. | ||
107 | 16 | */ | ||
108 | 17 | |||
109 | 18 | // Try to load our extension if it's not already loaded. | ||
110 | 19 | if (!extension_loaded("zorba_api")) { | ||
111 | 20 | if (strtolower(substr(PHP_OS, 0, 3)) === 'win') { | ||
112 | 21 | if (!dl('zorba_api.dll')) return; | ||
113 | 22 | } else { | ||
114 | 23 | // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'. | ||
115 | 24 | // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'. | ||
116 | 25 | if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') { | ||
117 | 26 | if (!dl('zorba_api.so')) return; | ||
118 | 27 | } else { | ||
119 | 28 | if (!dl('zorba_api.'.PHP_SHLIB_SUFFIX)) return; | ||
120 | 29 | } | ||
121 | 30 | } | ||
122 | 31 | } | ||
123 | 32 | |||
124 | 33 | class Item { | ||
125 | 34 | public $_cPtr=null; | ||
126 | 35 | |||
127 | 36 | static function createEmptyItem() { | ||
128 | 37 | $r=Item_createEmptyItem(); | ||
129 | 38 | return is_resource($r) ? new Item($r) : $r; | ||
130 | 39 | } | ||
131 | 40 | |||
132 | 41 | function getStringValue() { | ||
133 | 42 | return Item_getStringValue($this->_cPtr); | ||
134 | 43 | } | ||
135 | 44 | |||
136 | 45 | function __construct() { | ||
137 | 46 | $this->_cPtr=new_Item(); | ||
138 | 47 | } | ||
139 | 48 | } | ||
140 | 49 | |||
141 | 50 | class Iterator { | ||
142 | 51 | public $_cPtr=null; | ||
143 | 52 | |||
144 | 53 | function open() { | ||
145 | 54 | Iterator_open($this->_cPtr); | ||
146 | 55 | } | ||
147 | 56 | |||
148 | 57 | function next($arg1) { | ||
149 | 58 | return Iterator_next($this->_cPtr,$arg1); | ||
150 | 59 | } | ||
151 | 60 | |||
152 | 61 | function close() { | ||
153 | 62 | Iterator_close($this->_cPtr); | ||
154 | 63 | } | ||
155 | 64 | |||
156 | 65 | function destroy() { | ||
157 | 66 | Iterator_destroy($this->_cPtr); | ||
158 | 67 | } | ||
159 | 68 | |||
160 | 69 | function __construct($cPtr) { | ||
161 | 70 | $this->_cPtr=$cPtr; | ||
162 | 71 | } | ||
163 | 72 | |||
164 | 73 | public function __destruct() { | ||
165 | 74 | $this->destroy(); | ||
166 | 75 | } | ||
167 | 76 | } | ||
168 | 77 | |||
169 | 78 | class XQuery { | ||
170 | 79 | public $_cPtr=null; | ||
171 | 80 | |||
172 | 81 | function execute() { | ||
173 | 82 | return XQuery_execute($this->_cPtr); | ||
174 | 83 | } | ||
175 | 84 | |||
176 | 85 | function isUpdateQuery() { | ||
177 | 86 | return XQuery_isUpdateQuery($this->_cPtr); | ||
178 | 87 | } | ||
179 | 88 | |||
180 | 89 | function applyUpdates() { | ||
181 | 90 | XQuery_applyUpdates($this->_cPtr); | ||
182 | 91 | } | ||
183 | 92 | |||
184 | 93 | function destroy() { | ||
185 | 94 | XQuery_destroy($this->_cPtr); | ||
186 | 95 | } | ||
187 | 96 | |||
188 | 97 | function iterator() { | ||
189 | 98 | $r=XQuery_iterator($this->_cPtr); | ||
190 | 99 | return is_resource($r) ? new Iterator($r) : $r; | ||
191 | 100 | } | ||
192 | 101 | |||
193 | 102 | function __construct($cPtr) { | ||
194 | 103 | $this->_cPtr=$cPtr; | ||
195 | 104 | } | ||
196 | 105 | |||
197 | 106 | function __destruct() { | ||
198 | 107 | $this->destroy(); | ||
199 | 108 | } | ||
200 | 109 | } | ||
201 | 110 | |||
202 | 111 | class Store { | ||
203 | 112 | //public $_cPtr=null; | ||
204 | 113 | |||
205 | 114 | //function __construct() { | ||
206 | 115 | // $this->_cPtr=new_Store(); | ||
207 | 116 | //} | ||
208 | 117 | } | ||
209 | 118 | |||
210 | 119 | class InMemoryStore extends Store { | ||
211 | 120 | public $_cPtr=null; | ||
212 | 121 | |||
213 | 122 | static function getInstance() { | ||
214 | 123 | $r=InMemoryStore_getInstance(); | ||
215 | 124 | return is_resource($r) ? new InMemoryStore($r) : $r; | ||
216 | 125 | } | ||
217 | 126 | |||
218 | 127 | static function shutdown($arg1) { | ||
219 | 128 | InMemoryStore_shutdown($arg1); | ||
220 | 129 | } | ||
221 | 130 | |||
222 | 131 | private function __construct($cPtr) { | ||
223 | 132 | $this->_cPtr=$cPtr; | ||
224 | 133 | } | ||
225 | 134 | } | ||
226 | 135 | |||
227 | 136 | class XmlDataManager { | ||
228 | 137 | public $_cPtr=null; | ||
229 | 138 | |||
230 | 139 | function loadDocument($aName,$aContent) { | ||
231 | 140 | XmlDataManager_loadDocument($this->_cPtr,$aName,$aContent); | ||
232 | 141 | } | ||
233 | 142 | |||
234 | 143 | function deleteDocument($aName) { | ||
235 | 144 | return XmlDataManager_deleteDocument($this->_cPtr,$aName); | ||
236 | 145 | } | ||
237 | 146 | |||
238 | 147 | function __construct($cPtr) { | ||
239 | 148 | $this->_cPtr=$cPtr; | ||
240 | 149 | } | ||
241 | 150 | } | ||
242 | 151 | |||
243 | 152 | class Zorba { | ||
244 | 153 | public $_cPtr=null; | ||
245 | 154 | |||
246 | 155 | static function getInstance($arg1) { | ||
247 | 156 | $r=Zorba_getInstance($arg1->_cPtr); | ||
248 | 157 | return is_resource($r) ? new Zorba($r) : $r; | ||
249 | 158 | } | ||
250 | 159 | |||
251 | 160 | function compileQuery($aStr) { | ||
252 | 161 | $r=Zorba_compileQuery($this->_cPtr,$aStr); | ||
253 | 162 | return is_resource($r) ? new XQuery($r) : $r; | ||
254 | 163 | } | ||
255 | 164 | |||
256 | 165 | function getXmlDataManager() { | ||
257 | 166 | $r=Zorba_getXmlDataManager($this->_cPtr); | ||
258 | 167 | return is_resource($r) ? new XmlDataManager($r) : $r; | ||
259 | 168 | } | ||
260 | 169 | |||
261 | 170 | function shutdown() { | ||
262 | 171 | Zorba_shutdown($this->_cPtr); | ||
263 | 172 | } | ||
264 | 173 | |||
265 | 174 | private function __construct($cPtr) { | ||
266 | 175 | $this->_cPtr=$cPtr; | ||
267 | 176 | } | ||
268 | 177 | } | ||
269 | 178 | ?> | ||
270 | 179 | 0 | ||
271 | === modified file 'include/zorba/internal/diagnostic.h' | |||
272 | --- include/zorba/internal/diagnostic.h 2013-02-26 04:12:43 +0000 | |||
273 | +++ include/zorba/internal/diagnostic.h 2013-03-27 00:40:33 +0000 | |||
274 | @@ -201,6 +201,7 @@ | |||
275 | 201 | column_type column_end_; | 201 | column_type column_end_; |
276 | 202 | 202 | ||
277 | 203 | friend bool operator==( location const&, location const& ); | 203 | friend bool operator==( location const&, location const& ); |
278 | 204 | friend bool operator!=( location const&, location const& ); | ||
279 | 204 | 205 | ||
280 | 205 | // for plan serialization | 206 | // for plan serialization |
281 | 206 | friend void serialization::operator&( serialization::Archiver&, location& ); | 207 | friend void serialization::operator&( serialization::Archiver&, location& ); |
282 | @@ -224,9 +225,7 @@ | |||
283 | 224 | * @param j The second location. | 225 | * @param j The second location. |
284 | 225 | * @return Returns \c true only if the two locations are not equal. | 226 | * @return Returns \c true only if the two locations are not equal. |
285 | 226 | */ | 227 | */ |
289 | 227 | inline bool operator!=( location const &i, location const &j ) { | 228 | bool operator!=( location const &i, location const &j ); |
287 | 228 | return !(i == j); | ||
288 | 229 | } | ||
290 | 230 | 229 | ||
291 | 231 | /////////////////////////////////////////////////////////////////////////////// | 230 | /////////////////////////////////////////////////////////////////////////////// |
292 | 232 | 231 | ||
293 | 233 | 232 | ||
294 | === modified file 'include/zorba/xquery_exception.h' | |||
295 | --- include/zorba/xquery_exception.h 2013-02-26 04:12:43 +0000 | |||
296 | +++ include/zorba/xquery_exception.h 2013-03-27 00:40:33 +0000 | |||
297 | @@ -295,7 +295,7 @@ | |||
298 | 295 | * @return Returns \a true only if stack traces will be included. | 295 | * @return Returns \a true only if stack traces will be included. |
299 | 296 | */ | 296 | */ |
300 | 297 | static bool get_print_trace( std::ostream &o ) { | 297 | static bool get_print_trace( std::ostream &o ) { |
302 | 298 | return static_cast<print_trace>( o.iword( get_ios_trace_index() ) ); | 298 | return !!( o.iword( get_ios_trace_index() ) ); |
303 | 299 | } | 299 | } |
304 | 300 | 300 | ||
305 | 301 | /** | 301 | /** |
306 | @@ -404,7 +404,7 @@ | |||
307 | 404 | */ | 404 | */ |
308 | 405 | inline std::ostream& operator<<( std::ostream &o, | 405 | inline std::ostream& operator<<( std::ostream &o, |
309 | 406 | XQueryException::print_trace t ) { | 406 | XQueryException::print_trace t ) { |
311 | 407 | XQueryException::set_print_trace( o, t ); | 407 | XQueryException::set_print_trace( o, !!t ); |
312 | 408 | return o; | 408 | return o; |
313 | 409 | } | 409 | } |
314 | 410 | 410 | ||
315 | 411 | 411 | ||
316 | === modified file 'src/diagnostics/diagnostic.cpp' | |||
317 | --- src/diagnostics/diagnostic.cpp 2013-02-26 04:12:43 +0000 | |||
318 | +++ src/diagnostics/diagnostic.cpp 2013-03-27 00:40:33 +0000 | |||
319 | @@ -177,6 +177,10 @@ | |||
320 | 177 | 177 | ||
321 | 178 | location const location::empty; | 178 | location const location::empty; |
322 | 179 | 179 | ||
323 | 180 | bool operator!=( location const &i, location const &j ) { | ||
324 | 181 | return !(i == j); | ||
325 | 182 | } | ||
326 | 183 | |||
327 | 180 | bool operator==( location const &i, location const &j ) { | 184 | bool operator==( location const &i, location const &j ) { |
328 | 181 | return i.file_ == j.file_ | 185 | return i.file_ == j.file_ |
329 | 182 | && i.line_ == j.line_ | 186 | && i.line_ == j.line_ |
330 | 183 | 187 | ||
331 | === modified file 'src/precompiled/stdafx.h' | |||
332 | --- src/precompiled/stdafx.h 2013-02-07 17:24:36 +0000 | |||
333 | +++ src/precompiled/stdafx.h 2013-03-27 00:40:33 +0000 | |||
334 | @@ -44,7 +44,6 @@ | |||
335 | 44 | #include "compiler/parser/parse_constants.h" | 44 | #include "compiler/parser/parse_constants.h" |
336 | 45 | #include "zorbautils/checked_vector.h" | 45 | #include "zorbautils/checked_vector.h" |
337 | 46 | #include "compiler/parser/xquery_driver.h" | 46 | #include "compiler/parser/xquery_driver.h" |
338 | 47 | #include "util/sorter.h" | ||
339 | 48 | #include "compiler/xqueryx/xqueryx_to_xquery.h" | 47 | #include "compiler/xqueryx/xqueryx_to_xquery.h" |
340 | 49 | #include <zorba/store_manager.h> | 48 | #include <zorba/store_manager.h> |
341 | 50 | #include <zorba/xquery.h> | 49 | #include <zorba/xquery.h> |
342 | 51 | 50 | ||
343 | === modified file 'src/unit_tests/test_mem_sizeof.cpp' | |||
344 | --- src/unit_tests/test_mem_sizeof.cpp 2013-02-05 04:00:09 +0000 | |||
345 | +++ src/unit_tests/test_mem_sizeof.cpp 2013-03-27 00:40:33 +0000 | |||
346 | @@ -14,6 +14,7 @@ | |||
347 | 14 | * limitations under the License. | 14 | * limitations under the License. |
348 | 15 | */ | 15 | */ |
349 | 16 | 16 | ||
350 | 17 | #include "stdafx.h" | ||
351 | 17 | #include <iostream> | 18 | #include <iostream> |
352 | 18 | #include <string> | 19 | #include <string> |
353 | 19 | 20 | ||
354 | 20 | 21 | ||
355 | === modified file 'swig/Config.h' | |||
356 | --- swig/Config.h 2012-08-06 22:08:44 +0000 | |||
357 | +++ swig/Config.h 2013-03-27 00:40:33 +0000 | |||
358 | @@ -18,5 +18,4 @@ | |||
359 | 18 | 18 | ||
360 | 19 | #define ZORBA_STREAM_BUFFER_SIZE @ZORBA_STREAM_BUFFER_SIZE@ | 19 | #define ZORBA_STREAM_BUFFER_SIZE @ZORBA_STREAM_BUFFER_SIZE@ |
361 | 20 | 20 | ||
362 | 21 | |||
363 | 22 | #endif | 21 | #endif |
364 | 23 | \ No newline at end of file | 22 | \ No newline at end of file |
365 | 24 | 23 | ||
366 | === modified file 'swig/DiagnosticHandler.i' | |||
367 | --- swig/DiagnosticHandler.i 2013-02-07 17:24:36 +0000 | |||
368 | +++ swig/DiagnosticHandler.i 2013-03-27 00:40:33 +0000 | |||
369 | @@ -20,11 +20,11 @@ | |||
370 | 20 | 20 | ||
371 | 21 | void DiagnosticHandler::error (const zorba::ZorbaException &ze) | 21 | void DiagnosticHandler::error (const zorba::ZorbaException &ze) |
372 | 22 | { | 22 | { |
374 | 23 | if ( zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze ) ) { | 23 | if (zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze )) { |
375 | 24 | const XQueryException xe2(xe); | 24 | const XQueryException xe2(xe); |
376 | 25 | error(xe2); | 25 | error(xe2); |
377 | 26 | } | 26 | } |
379 | 27 | if ( zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze ) ) { | 27 | if (zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze )) { |
380 | 28 | const UserException ue2(ue); | 28 | const UserException ue2(ue); |
381 | 29 | error(ue2); | 29 | error(ue2); |
382 | 30 | } | 30 | } |
383 | 31 | 31 | ||
384 | === modified file 'swig/DynamicContext.h' | |||
385 | --- swig/DynamicContext.h 2013-02-07 17:24:36 +0000 | |||
386 | +++ swig/DynamicContext.h 2013-03-27 00:40:33 +0000 | |||
387 | @@ -36,14 +36,14 @@ | |||
388 | 36 | DynamicContext(const DynamicContext& aCtx):theContext(aCtx.theContext) {} | 36 | DynamicContext(const DynamicContext& aCtx):theContext(aCtx.theContext) {} |
389 | 37 | DynamicContext(zorba::DynamicContext* aCtx):theContext(aCtx) {} | 37 | DynamicContext(zorba::DynamicContext* aCtx):theContext(aCtx) {} |
390 | 38 | 38 | ||
392 | 39 | bool getContextItem (Item& aItem); | 39 | bool getContextItem (Item& aItem); |
393 | 40 | 40 | ||
394 | 41 | /** \brief Retrieve the dateTime Item used at the time the query is executed | 41 | /** \brief Retrieve the dateTime Item used at the time the query is executed |
395 | 42 | * (see setCurrentDateTime()). | 42 | * (see setCurrentDateTime()). |
396 | 43 | * | 43 | * |
397 | 44 | * @return Item the dateTime Item used at the time the query is executed. | 44 | * @return Item the dateTime Item used at the time the query is executed. |
398 | 45 | */ | 45 | */ |
400 | 46 | Item getCurrentDateTime (); | 46 | Item getCurrentDateTime (); |
401 | 47 | 47 | ||
402 | 48 | /** \brief Return the value of the default collection that is used when calling the | 48 | /** \brief Return the value of the default collection that is used when calling the |
403 | 49 | * fn:collection function without a parameter. | 49 | * fn:collection function without a parameter. |
404 | @@ -51,7 +51,7 @@ | |||
405 | 51 | * @return Item the default collection that is set in this dynamic context. | 51 | * @return Item the default collection that is set in this dynamic context. |
406 | 52 | * @throw ZorbaException if an error occured. | 52 | * @throw ZorbaException if an error occured. |
407 | 53 | */ | 53 | */ |
409 | 54 | Item getDefaultCollection (); | 54 | Item getDefaultCollection (); |
410 | 55 | 55 | ||
411 | 56 | /** \brief Retrieve the implicit timezone used in comparisons or arithmetic operations | 56 | /** \brief Retrieve the implicit timezone used in comparisons or arithmetic operations |
412 | 57 | * of date, time, or dateTime values. | 57 | * of date, time, or dateTime values. |
413 | @@ -60,7 +60,7 @@ | |||
414 | 60 | * and an DiagnosticHandler is used. | 60 | * and an DiagnosticHandler is used. |
415 | 61 | * @throw ZorbaException if an error occured. | 61 | * @throw ZorbaException if an error occured. |
416 | 62 | */ | 62 | */ |
418 | 63 | int getImplicitTimezone (); | 63 | int getImplicitTimezone (); |
419 | 64 | 64 | ||
420 | 65 | /** \brief Returns the current value of an external | 65 | /** \brief Returns the current value of an external |
421 | 66 | * variable. Exactly one of the two return values (aItem or | 66 | * variable. Exactly one of the two return values (aItem or |
422 | @@ -78,7 +78,7 @@ | |||
423 | 78 | * @return true if the variable has been retrieved successfully, false otherwise. | 78 | * @return true if the variable has been retrieved successfully, false otherwise. |
424 | 79 | * @throw ZorbaException if an error occured. | 79 | * @throw ZorbaException if an error occured. |
425 | 80 | */ | 80 | */ |
427 | 81 | bool getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator); | 81 | bool getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator); |
428 | 82 | 82 | ||
429 | 83 | /** \brief Defines the context item. | 83 | /** \brief Defines the context item. |
430 | 84 | * | 84 | * |
431 | 85 | 85 | ||
432 | === modified file 'swig/DynamicContext.i' | |||
433 | --- swig/DynamicContext.i 2013-02-07 17:24:36 +0000 | |||
434 | +++ swig/DynamicContext.i 2013-03-27 00:40:33 +0000 | |||
435 | @@ -25,10 +25,10 @@ | |||
436 | 25 | Item DynamicContext::getDefaultCollection () { | 25 | Item DynamicContext::getDefaultCollection () { |
437 | 26 | return Item(theContext->getDefaultCollection()); | 26 | return Item(theContext->getDefaultCollection()); |
438 | 27 | } | 27 | } |
440 | 28 | int DynamicContext::getImplicitTimezone (){ | 28 | int DynamicContext::getImplicitTimezone (){ |
441 | 29 | return theContext->getImplicitTimezone(); | 29 | return theContext->getImplicitTimezone(); |
442 | 30 | } | 30 | } |
444 | 31 | bool DynamicContext::getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator) { | 31 | bool DynamicContext::getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator) { |
445 | 32 | return theContext->getVariable(aNamespace, aLocalname, aItem.theItem, aIterator.theIterator); | 32 | return theContext->getVariable(aNamespace, aLocalname, aItem.theItem, aIterator.theIterator); |
446 | 33 | } | 33 | } |
447 | 34 | 34 | ||
448 | 35 | 35 | ||
449 | === modified file 'swig/Exceptions.i' | |||
450 | --- swig/Exceptions.i 2013-02-07 17:24:36 +0000 | |||
451 | +++ swig/Exceptions.i 2013-03-27 00:40:33 +0000 | |||
452 | @@ -115,9 +115,9 @@ | |||
453 | 115 | private: | 115 | private: |
454 | 116 | XQueryException(); | 116 | XQueryException(); |
455 | 117 | public: | 117 | public: |
459 | 118 | virtual unsigned int getColumnBegin () const; | 118 | virtual unsigned int getColumnBegin () const; |
460 | 119 | virtual unsigned int getLineBegin () const; | 119 | virtual unsigned int getLineBegin () const; |
461 | 120 | virtual std::string getQueryURI () const; | 120 | virtual std::string getQueryURI () const; |
462 | 121 | }; | 121 | }; |
463 | 122 | 122 | ||
464 | 123 | /* vim:set et sw=2 ts=2: */ | 123 | /* vim:set et sw=2 ts=2: */ |
465 | 124 | 124 | ||
466 | === modified file 'swig/Item.h' | |||
467 | --- swig/Item.h 2013-02-07 17:24:36 +0000 | |||
468 | +++ swig/Item.h 2013-03-27 00:40:33 +0000 | |||
469 | @@ -159,7 +159,7 @@ | |||
470 | 159 | * @return Item the int value of the Item. | 159 | * @return Item the int value of the Item. |
471 | 160 | * @throw ZorbaException if an error occured. | 160 | * @throw ZorbaException if an error occured. |
472 | 161 | */ | 161 | */ |
474 | 162 | double getDoubleValue () const; | 162 | double getDoubleValue () const; |
475 | 163 | 163 | ||
476 | 164 | /** \brief Get the long value of the Item. | 164 | /** \brief Get the long value of the Item. |
477 | 165 | * | 165 | * |
478 | @@ -211,7 +211,7 @@ | |||
479 | 211 | * @return element or document parent node of this node. | 211 | * @return element or document parent node of this node. |
480 | 212 | * @throw ZorbaException if an error occured, e.g. the Item is not of type node. | 212 | * @throw ZorbaException if an error occured, e.g. the Item is not of type node. |
481 | 213 | */ | 213 | */ |
483 | 214 | Item getParent () const; | 214 | Item getParent () const; |
484 | 215 | 215 | ||
485 | 216 | /** \brief Get the (optional) value of a QName's prefix. | 216 | /** \brief Get the (optional) value of a QName's prefix. |
486 | 217 | * | 217 | * |
487 | 218 | 218 | ||
488 | === modified file 'swig/Item.i' | |||
489 | --- swig/Item.i 2013-02-07 17:24:36 +0000 | |||
490 | +++ swig/Item.i 2013-03-27 00:40:33 +0000 | |||
491 | @@ -60,7 +60,7 @@ | |||
492 | 60 | int Item::getIntValue () const | 60 | int Item::getIntValue () const |
493 | 61 | { return theItem.getIntValue(); } | 61 | { return theItem.getIntValue(); } |
494 | 62 | 62 | ||
496 | 63 | double Item::getDoubleValue () const | 63 | double Item::getDoubleValue () const |
497 | 64 | { return theItem.getDoubleValue(); } | 64 | { return theItem.getDoubleValue(); } |
498 | 65 | 65 | ||
499 | 66 | long long Item::getLongValue () const | 66 | long long Item::getLongValue () const |
500 | @@ -89,7 +89,7 @@ | |||
501 | 89 | bool Item::getNodeName (Item &aNodeName) const | 89 | bool Item::getNodeName (Item &aNodeName) const |
502 | 90 | { return theItem.getNodeName( aNodeName.theItem ); } | 90 | { return theItem.getNodeName( aNodeName.theItem ); } |
503 | 91 | 91 | ||
505 | 92 | Item Item::getParent () const | 92 | Item Item::getParent () const |
506 | 93 | { return theItem.getParent(); } | 93 | { return theItem.getParent(); } |
507 | 94 | 94 | ||
508 | 95 | std::string Item::getPrefix () const | 95 | std::string Item::getPrefix () const |
509 | 96 | 96 | ||
510 | === modified file 'swig/ItemFactory.h' | |||
511 | --- swig/ItemFactory.h 2013-02-07 17:24:36 +0000 | |||
512 | +++ swig/ItemFactory.h 2013-03-27 00:40:33 +0000 | |||
513 | @@ -40,7 +40,7 @@ | |||
514 | 40 | * @param aURI String representation of the AnyURI. | 40 | * @param aURI String representation of the AnyURI. |
515 | 41 | * @return The AnyURI Item. | 41 | * @return The AnyURI Item. |
516 | 42 | */ | 42 | */ |
518 | 43 | Item createAnyURI (const std::string &aURI); | 43 | Item createAnyURI (const std::string &aURI); |
519 | 44 | 44 | ||
520 | 45 | /** | 45 | /** |
521 | 46 | * Create a new attribute node N and place it among the | 46 | * Create a new attribute node N and place it among the |
522 | @@ -57,10 +57,9 @@ | |||
523 | 57 | * @param aTypedValue The typed value of the new node. | 57 | * @param aTypedValue The typed value of the new node. |
524 | 58 | * @return The new node N created by this method | 58 | * @return The new node N created by this method |
525 | 59 | */ | 59 | */ |
530 | 60 | Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue); | 60 | Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue); |
531 | 61 | #ifndef SWIGRUBY | 61 | |
532 | 62 | Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue); | 62 | Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue); |
529 | 63 | #endif | ||
533 | 64 | 63 | ||
534 | 65 | /** \brief Creates a Base64Binary Item | 64 | /** \brief Creates a Base64Binary Item |
535 | 66 | * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] | 65 | * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] |
536 | @@ -69,7 +68,7 @@ | |||
537 | 69 | * @param aLength the length of the base64 binary data. | 68 | * @param aLength the length of the base64 binary data. |
538 | 70 | * @return The Base64Binary Item. | 69 | * @return The Base64Binary Item. |
539 | 71 | */ | 70 | */ |
541 | 72 | Item createBase64Binary (const char *aBinData, size_t aLength); | 71 | Item createBase64Binary (const char *aBinData, size_t aLength); |
542 | 73 | 72 | ||
543 | 74 | /** \brief Creates a Base64Binary Item | 73 | /** \brief Creates a Base64Binary Item |
544 | 75 | * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] | 74 | * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] |
545 | @@ -77,7 +76,7 @@ | |||
546 | 77 | * @param aStream A stream containing the Base64 encoded data. | 76 | * @param aStream A stream containing the Base64 encoded data. |
547 | 78 | * @return the Base64Binary Item. | 77 | * @return the Base64Binary Item. |
548 | 79 | */ | 78 | */ |
550 | 80 | Item createBase64Binary (std::istream &aStream); | 79 | Item createBase64Binary (std::istream &aStream); |
551 | 81 | 80 | ||
552 | 82 | /** \brief Creates a Base64Binary Item | 81 | /** \brief Creates a Base64Binary Item |
553 | 83 | * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] | 82 | * see [http://www.w3.org/TR/xmlschema-2/#base64Binary] |
554 | @@ -86,7 +85,7 @@ | |||
555 | 86 | * @param aLength the length of the data | 85 | * @param aLength the length of the data |
556 | 87 | * @return the Base64Binary Item. | 86 | * @return the Base64Binary Item. |
557 | 88 | */ | 87 | */ |
559 | 89 | Item createBase64Binary (const unsigned char *aBinData, size_t aLength); | 88 | Item createBase64Binary (const unsigned char *aBinData, size_t aLength); |
560 | 90 | 89 | ||
561 | 91 | /** \brief Creates a Boolean Item | 90 | /** \brief Creates a Boolean Item |
562 | 92 | * see [http://www.w3.org/TR/xmlschema-2/#bool] | 91 | * see [http://www.w3.org/TR/xmlschema-2/#bool] |
563 | @@ -94,7 +93,7 @@ | |||
564 | 94 | * @param aValue bool representation of the Boolean. | 93 | * @param aValue bool representation of the Boolean. |
565 | 95 | * @return The Boolean Item. | 94 | * @return The Boolean Item. |
566 | 96 | */ | 95 | */ |
568 | 97 | Item createBoolean (bool aValue); | 96 | Item createBoolean (bool aValue); |
569 | 98 | 97 | ||
570 | 99 | /** \brief Creates a Byte Item | 98 | /** \brief Creates a Byte Item |
571 | 100 | * see [http://www.w3.org/TR/xmlschema-2/#byte] | 99 | * see [http://www.w3.org/TR/xmlschema-2/#byte] |
572 | @@ -102,7 +101,7 @@ | |||
573 | 102 | * @param aByte char representation of the Byte. | 101 | * @param aByte char representation of the Byte. |
574 | 103 | * @return The Byte Item. | 102 | * @return The Byte Item. |
575 | 104 | */ | 103 | */ |
577 | 105 | Item createByte (char aByte); | 104 | Item createByte (char aByte); |
578 | 106 | 105 | ||
579 | 107 | /** | 106 | /** |
580 | 108 | * Create a new comment node N and place it as the last child of a given | 107 | * Create a new comment node N and place it as the last child of a given |
581 | @@ -113,7 +112,7 @@ | |||
582 | 113 | * @param aContent The content of the new node. | 112 | * @param aContent The content of the new node. |
583 | 114 | * @return The new node N created by this method | 113 | * @return The new node N created by this method |
584 | 115 | */ | 114 | */ |
586 | 116 | Item createCommentNode (Item &aParent, const std::string &aContent); | 115 | Item createCommentNode (Item &aParent, const std::string &aContent); |
587 | 117 | 116 | ||
588 | 118 | /** \brief Creates a Date Item | 117 | /** \brief Creates a Date Item |
589 | 119 | * see [http://www.w3.org/TR/xmlschema-2/#date] | 118 | * see [http://www.w3.org/TR/xmlschema-2/#date] |
590 | @@ -121,7 +120,7 @@ | |||
591 | 121 | * @param aDate String representation of the Date (e.g. 2002-10-10). | 120 | * @param aDate String representation of the Date (e.g. 2002-10-10). |
592 | 122 | * @return The Date Item. | 121 | * @return The Date Item. |
593 | 123 | */ | 122 | */ |
595 | 124 | Item createDate (const std::string &aDate); | 123 | Item createDate (const std::string &aDate); |
596 | 125 | 124 | ||
597 | 126 | /** \brief Creates a Date Item | 125 | /** \brief Creates a Date Item |
598 | 127 | * see [http://www.w3.org/TR/xmlschema-2/#date] | 126 | * see [http://www.w3.org/TR/xmlschema-2/#date] |
599 | @@ -131,7 +130,7 @@ | |||
600 | 131 | * @param aDay short-valued representation of the day. | 130 | * @param aDay short-valued representation of the day. |
601 | 132 | * @return The Date Item. | 131 | * @return The Date Item. |
602 | 133 | */ | 132 | */ |
604 | 134 | Item createDate (short aYear, short aMonth, short aDay); | 133 | Item createDate (short aYear, short aMonth, short aDay); |
605 | 135 | 134 | ||
606 | 136 | /** \brief Creates a DateTime Item | 135 | /** \brief Creates a DateTime Item |
607 | 137 | * see [http://www.w3.org/TR/xmlschema-2/#dateTime] | 136 | * see [http://www.w3.org/TR/xmlschema-2/#dateTime] |
608 | @@ -140,7 +139,7 @@ | |||
609 | 140 | * (for example, 2002-10-10T12:00:00-05:00). | 139 | * (for example, 2002-10-10T12:00:00-05:00). |
610 | 141 | * @return The DateTime Item. | 140 | * @return The DateTime Item. |
611 | 142 | */ | 141 | */ |
613 | 143 | Item createDateTime (const std::string &aDateTimeValue); | 142 | Item createDateTime (const std::string &aDateTimeValue); |
614 | 144 | 143 | ||
615 | 145 | /** \brief Creates a DateTime Item | 144 | /** \brief Creates a DateTime Item |
616 | 146 | * see [http://www.w3.org/TR/xmlschema-2/#dateTime] | 145 | * see [http://www.w3.org/TR/xmlschema-2/#dateTime] |
617 | @@ -154,7 +153,7 @@ | |||
618 | 154 | * @param aTimeZone_hours short-valued representation of the difference in hours to UTC. | 153 | * @param aTimeZone_hours short-valued representation of the difference in hours to UTC. |
619 | 155 | * @return The DateTime Item. | 154 | * @return The DateTime Item. |
620 | 156 | */ | 155 | */ |
622 | 157 | Item createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours); | 156 | Item createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours); |
623 | 158 | 157 | ||
624 | 159 | /** \brief Creates a Decimal Item | 158 | /** \brief Creates a Decimal Item |
625 | 160 | * see [http://www.w3.org/TR/xmlschema-2/#decimal] | 159 | * see [http://www.w3.org/TR/xmlschema-2/#decimal] |
626 | @@ -162,7 +161,7 @@ | |||
627 | 162 | * @param aValue String representation of the Decimal (e.g. 12678967.543233). | 161 | * @param aValue String representation of the Decimal (e.g. 12678967.543233). |
628 | 163 | * @return The Decimal Item. | 162 | * @return The Decimal Item. |
629 | 164 | */ | 163 | */ |
631 | 165 | Item createDecimal (const std::string &aValue); | 164 | Item createDecimal (const std::string &aValue); |
632 | 166 | 165 | ||
633 | 167 | /** \brief Creates a Decimal Item | 166 | /** \brief Creates a Decimal Item |
634 | 168 | * see [http://www.w3.org/TR/xmlschema-2/#decimal] | 167 | * see [http://www.w3.org/TR/xmlschema-2/#decimal] |
635 | @@ -170,7 +169,7 @@ | |||
636 | 170 | * @param aValue double representation of the Decimal. | 169 | * @param aValue double representation of the Decimal. |
637 | 171 | * @return The Decimal Item. | 170 | * @return The Decimal Item. |
638 | 172 | */ | 171 | */ |
640 | 173 | Item createDecimalFromDouble (double aValue); | 172 | Item createDecimalFromDouble (double aValue); |
641 | 174 | 173 | ||
642 | 175 | /** \brief Creates a Decimal Item | 174 | /** \brief Creates a Decimal Item |
643 | 176 | * see [http://www.w3.org/TR/xmlschema-2/#decimal] | 175 | * see [http://www.w3.org/TR/xmlschema-2/#decimal] |
644 | @@ -178,7 +177,7 @@ | |||
645 | 178 | * @param aValue unsigned long representation of the Decimal. | 177 | * @param aValue unsigned long representation of the Decimal. |
646 | 179 | * @return The Decimal Item. | 178 | * @return The Decimal Item. |
647 | 180 | */ | 179 | */ |
649 | 181 | Item createDecimalFromLong (unsigned long aValue); | 180 | Item createDecimalFromLong (unsigned long aValue); |
650 | 182 | 181 | ||
651 | 183 | /** \brief Creates a Double Item | 182 | /** \brief Creates a Double Item |
652 | 184 | * see [http://www.w3.org/TR/xmlschema-2/#double] | 183 | * see [http://www.w3.org/TR/xmlschema-2/#double] |
653 | @@ -186,7 +185,7 @@ | |||
654 | 186 | * @param aValue String representation of the Double. | 185 | * @param aValue String representation of the Double. |
655 | 187 | * @return The Double Item. | 186 | * @return The Double Item. |
656 | 188 | */ | 187 | */ |
658 | 189 | Item createDouble (const std::string &aValue); | 188 | Item createDouble (const std::string &aValue); |
659 | 190 | 189 | ||
660 | 191 | /** \brief Creates a Double Item | 190 | /** \brief Creates a Double Item |
661 | 192 | * see [http://www.w3.org/TR/xmlschema-2/#double] | 191 | * see [http://www.w3.org/TR/xmlschema-2/#double] |
662 | @@ -194,7 +193,7 @@ | |||
663 | 194 | * @param aValue double representation of the Double. | 193 | * @param aValue double representation of the Double. |
664 | 195 | * @return The Double Item. | 194 | * @return The Double Item. |
665 | 196 | */ | 195 | */ |
667 | 197 | Item createDouble (double aValue); | 196 | Item createDouble (double aValue); |
668 | 198 | 197 | ||
669 | 199 | /** \brief Creates a Duration Item | 198 | /** \brief Creates a Duration Item |
670 | 200 | * see [http://www.w3.org/TR/xmlschema-2/#duration] | 199 | * see [http://www.w3.org/TR/xmlschema-2/#duration] |
671 | @@ -202,7 +201,7 @@ | |||
672 | 202 | * @param aValue String representation of the NCName. | 201 | * @param aValue String representation of the NCName. |
673 | 203 | * @return The Duration Item. | 202 | * @return The Duration Item. |
674 | 204 | */ | 203 | */ |
676 | 205 | Item createDuration (const std::string &aValue); | 204 | Item createDuration (const std::string &aValue); |
677 | 206 | 205 | ||
678 | 207 | /** \brief Creates a Duration Item | 206 | /** \brief Creates a Duration Item |
679 | 208 | * see [http://www.w3.org/TR/xmlschema-2/#duration] | 207 | * see [http://www.w3.org/TR/xmlschema-2/#duration] |
680 | @@ -215,7 +214,7 @@ | |||
681 | 215 | * @param aSeconds double-valued representation of the seconds and fractional seconds. | 214 | * @param aSeconds double-valued representation of the seconds and fractional seconds. |
682 | 216 | * @return The Duration Item. | 215 | * @return The Duration Item. |
683 | 217 | */ | 216 | */ |
685 | 218 | Item createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds); | 217 | Item createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds); |
686 | 219 | 218 | ||
687 | 220 | /** \brief Creates a dayTimeDuration Item | 219 | /** \brief Creates a dayTimeDuration Item |
688 | 221 | * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] | 220 | * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] |
689 | @@ -223,7 +222,7 @@ | |||
690 | 223 | * @param aValue String lexical representation of the duration. | 222 | * @param aValue String lexical representation of the duration. |
691 | 224 | * @return the dayTimeDuration Item. | 223 | * @return the dayTimeDuration Item. |
692 | 225 | */ | 224 | */ |
694 | 226 | Item createDayTimeDuration (const std::string &aValue); | 225 | Item createDayTimeDuration (const std::string &aValue); |
695 | 227 | 226 | ||
696 | 228 | /** \brief Creates a yearMonthDuration Item | 227 | /** \brief Creates a yearMonthDuration Item |
697 | 229 | * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] | 228 | * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] |
698 | @@ -231,7 +230,7 @@ | |||
699 | 231 | * @param aValue String lexical representation of the duration. | 230 | * @param aValue String lexical representation of the duration. |
700 | 232 | * @return the yearMonthDuration Item. | 231 | * @return the yearMonthDuration Item. |
701 | 233 | */ | 232 | */ |
703 | 234 | Item createYearMonthDuration (const std::string &aValue); | 233 | Item createYearMonthDuration (const std::string &aValue); |
704 | 235 | 234 | ||
705 | 236 | /** \brief Creates a documentNode Item | 235 | /** \brief Creates a documentNode Item |
706 | 237 | * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] | 236 | * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes] |
707 | @@ -240,8 +239,8 @@ | |||
708 | 240 | * @param aDocUri String representation of the Document URI. | 239 | * @param aDocUri String representation of the Document URI. |
709 | 241 | * @return the documentNode Item. | 240 | * @return the documentNode Item. |
710 | 242 | */ | 241 | */ |
713 | 243 | Item createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri); | 242 | Item createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri); |
714 | 244 | #ifndef SWIGRUBY | 243 | |
715 | 245 | /** | 244 | /** |
716 | 246 | * @brief Creates a new element node. | 245 | * @brief Creates a new element node. |
717 | 247 | * | 246 | * |
718 | @@ -264,8 +263,7 @@ | |||
719 | 264 | * property of P. | 263 | * property of P. |
720 | 265 | * @return The new node N created by this method | 264 | * @return The new node N created by this method |
721 | 266 | */ | 265 | */ |
724 | 267 | Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings); | 266 | Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings); |
723 | 268 | #endif | ||
725 | 269 | 267 | ||
726 | 270 | /** | 268 | /** |
727 | 271 | * @brief Creates a new element node. | 269 | * @brief Creates a new element node. |
728 | @@ -286,7 +284,7 @@ | |||
729 | 286 | * complex type with empty content. | 284 | * complex type with empty content. |
730 | 287 | * @return The new node N created by this method | 285 | * @return The new node N created by this method |
731 | 288 | */ | 286 | */ |
733 | 289 | Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue); | 287 | Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue); |
734 | 290 | 288 | ||
735 | 291 | /** \brief creates a float item | 289 | /** \brief creates a float item |
736 | 292 | * see [http://www.w3.org/tr/xmlschema-2/#float] | 290 | * see [http://www.w3.org/tr/xmlschema-2/#float] |
737 | @@ -294,7 +292,7 @@ | |||
738 | 294 | * @param aValue string representation of the float. | 292 | * @param aValue string representation of the float. |
739 | 295 | * @return the float item. | 293 | * @return the float item. |
740 | 296 | */ | 294 | */ |
742 | 297 | Item createFloat (const std::string &aValue); | 295 | Item createFloat (const std::string &aValue); |
743 | 298 | 296 | ||
744 | 299 | /** \brief creates a float item | 297 | /** \brief creates a float item |
745 | 300 | * see [http://www.w3.org/tr/xmlschema-2/#float] | 298 | * see [http://www.w3.org/tr/xmlschema-2/#float] |
746 | @@ -302,7 +300,7 @@ | |||
747 | 302 | * @param aValue float representation of the float. | 300 | * @param aValue float representation of the float. |
748 | 303 | * @return the float item. | 301 | * @return the float item. |
749 | 304 | */ | 302 | */ |
751 | 305 | Item createFloat (float aValue); | 303 | Item createFloat (float aValue); |
752 | 306 | 304 | ||
753 | 307 | /** \brief Creates a gDay Item | 305 | /** \brief Creates a gDay Item |
754 | 308 | * see [http://www.w3.org/TR/xmlschema-2/#gDay] | 306 | * see [http://www.w3.org/TR/xmlschema-2/#gDay] |
755 | @@ -310,7 +308,7 @@ | |||
756 | 310 | * @param aValue String representation of the gDay. | 308 | * @param aValue String representation of the gDay. |
757 | 311 | * @return The gDay Item. | 309 | * @return The gDay Item. |
758 | 312 | */ | 310 | */ |
760 | 313 | Item createGDay (const std::string &aValue); | 311 | Item createGDay (const std::string &aValue); |
761 | 314 | 312 | ||
762 | 315 | /** \brief Creates a gDay Item | 313 | /** \brief Creates a gDay Item |
763 | 316 | * see [http://www.w3.org/TR/xmlschema-2/#gDay] | 314 | * see [http://www.w3.org/TR/xmlschema-2/#gDay] |
764 | @@ -318,7 +316,7 @@ | |||
765 | 318 | * @param aDay short representation of the gDay. | 316 | * @param aDay short representation of the gDay. |
766 | 319 | * @return The gDay Item. | 317 | * @return The gDay Item. |
767 | 320 | */ | 318 | */ |
769 | 321 | Item createGDay (short aDay); | 319 | Item createGDay (short aDay); |
770 | 322 | 320 | ||
771 | 323 | /** \brief Creates a gMonth Item | 321 | /** \brief Creates a gMonth Item |
772 | 324 | * see [http://www.w3.org/TR/xmlschema-2/#gMonth] | 322 | * see [http://www.w3.org/TR/xmlschema-2/#gMonth] |
773 | @@ -326,7 +324,7 @@ | |||
774 | 326 | * @param aValue String representation of the gMonth. | 324 | * @param aValue String representation of the gMonth. |
775 | 327 | * @return The gMonth Item. | 325 | * @return The gMonth Item. |
776 | 328 | */ | 326 | */ |
778 | 329 | Item createGMonth (const std::string &aValue); | 327 | Item createGMonth (const std::string &aValue); |
779 | 330 | 328 | ||
780 | 331 | /** \brief Creates a gMonth Item | 329 | /** \brief Creates a gMonth Item |
781 | 332 | * see [http://www.w3.org/TR/xmlschema-2/#gMonth] | 330 | * see [http://www.w3.org/TR/xmlschema-2/#gMonth] |
782 | @@ -334,7 +332,7 @@ | |||
783 | 334 | * @param aMonth short representation of the gMonth. | 332 | * @param aMonth short representation of the gMonth. |
784 | 335 | * @return The gMonth Item. | 333 | * @return The gMonth Item. |
785 | 336 | */ | 334 | */ |
787 | 337 | Item createGMonth (short aMonth); | 335 | Item createGMonth (short aMonth); |
788 | 338 | 336 | ||
789 | 339 | /** \brief Creates a gMonthDay Item | 337 | /** \brief Creates a gMonthDay Item |
790 | 340 | * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay] | 338 | * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay] |
791 | @@ -342,7 +340,7 @@ | |||
792 | 342 | * @param aValue String representation of the gMonthDay. | 340 | * @param aValue String representation of the gMonthDay. |
793 | 343 | * @return The gMonthDay Item. | 341 | * @return The gMonthDay Item. |
794 | 344 | */ | 342 | */ |
796 | 345 | Item createGMonthDay (const std::string &aValue); | 343 | Item createGMonthDay (const std::string &aValue); |
797 | 346 | 344 | ||
798 | 347 | /** \brief Creates a gMonthDay Item | 345 | /** \brief Creates a gMonthDay Item |
799 | 348 | * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay] | 346 | * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay] |
800 | @@ -351,7 +349,7 @@ | |||
801 | 351 | * @param aDay short representation of the day. | 349 | * @param aDay short representation of the day. |
802 | 352 | * @return The gMonthDay Item. | 350 | * @return The gMonthDay Item. |
803 | 353 | */ | 351 | */ |
805 | 354 | Item createGMonthDay (short aMonth, short aDay); | 352 | Item createGMonthDay (short aMonth, short aDay); |
806 | 355 | 353 | ||
807 | 356 | /** \brief Creates a gYear Item | 354 | /** \brief Creates a gYear Item |
808 | 357 | * see [http://www.w3.org/TR/xmlschema-2/#gYear] | 355 | * see [http://www.w3.org/TR/xmlschema-2/#gYear] |
809 | @@ -359,7 +357,7 @@ | |||
810 | 359 | * @param aYear short representation of the gYear. | 357 | * @param aYear short representation of the gYear. |
811 | 360 | * @return The gYear Item. | 358 | * @return The gYear Item. |
812 | 361 | */ | 359 | */ |
814 | 362 | Item createGYear (short aYear); | 360 | Item createGYear (short aYear); |
815 | 363 | 361 | ||
816 | 364 | /** \brief Creates a gYear Item | 362 | /** \brief Creates a gYear Item |
817 | 365 | * see [http://www.w3.org/TR/xmlschema-2/#gYear] | 363 | * see [http://www.w3.org/TR/xmlschema-2/#gYear] |
818 | @@ -367,7 +365,7 @@ | |||
819 | 367 | * @param aValue String representation of the gYear. | 365 | * @param aValue String representation of the gYear. |
820 | 368 | * @return The gYear Item. | 366 | * @return The gYear Item. |
821 | 369 | */ | 367 | */ |
823 | 370 | Item createGYear (const std::string &aValue); | 368 | Item createGYear (const std::string &aValue); |
824 | 371 | 369 | ||
825 | 372 | /** \brief Creates a gYearMonth Item | 370 | /** \brief Creates a gYearMonth Item |
826 | 373 | * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth] | 371 | * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth] |
827 | @@ -375,7 +373,7 @@ | |||
828 | 375 | * @param aValue String representation of the gYearMonth. | 373 | * @param aValue String representation of the gYearMonth. |
829 | 376 | * @return The gYearMonth Item. | 374 | * @return The gYearMonth Item. |
830 | 377 | */ | 375 | */ |
832 | 378 | Item createGYearMonth (const std::string &aValue); | 376 | Item createGYearMonth (const std::string &aValue); |
833 | 379 | 377 | ||
834 | 380 | /** \brief Creates a gYearMonth Item | 378 | /** \brief Creates a gYearMonth Item |
835 | 381 | * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth] | 379 | * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth] |
836 | @@ -384,7 +382,7 @@ | |||
837 | 384 | * @param aMonth short representation of the month. | 382 | * @param aMonth short representation of the month. |
838 | 385 | * @return The gYearMonth Item. | 383 | * @return The gYearMonth Item. |
839 | 386 | */ | 384 | */ |
841 | 387 | Item createGYearMonth (short aYear, short aMonth); | 385 | Item createGYearMonth (short aYear, short aMonth); |
842 | 388 | 386 | ||
843 | 389 | /** \brief Creates a HexBinary Item | 387 | /** \brief Creates a HexBinary Item |
844 | 390 | * see [http://www.w3.org/TR/xmlschema-2/#hexBinary] | 388 | * see [http://www.w3.org/TR/xmlschema-2/#hexBinary] |
845 | @@ -393,7 +391,7 @@ | |||
846 | 393 | * @param aSize size of the hexdata. | 391 | * @param aSize size of the hexdata. |
847 | 394 | * @return The HexBinary Item. | 392 | * @return The HexBinary Item. |
848 | 395 | */ | 393 | */ |
850 | 396 | Item createHexBinary (const char *aHexData, size_t aSize); | 394 | Item createHexBinary (const char *aHexData, size_t aSize); |
851 | 397 | 395 | ||
852 | 398 | /** \brief Creates a Int Item | 396 | /** \brief Creates a Int Item |
853 | 399 | * see [http://www.w3.org/TR/xmlschema-2/#int] | 397 | * see [http://www.w3.org/TR/xmlschema-2/#int] |
854 | @@ -401,7 +399,7 @@ | |||
855 | 401 | * @param aInt int representation of the Int. | 399 | * @param aInt int representation of the Int. |
856 | 402 | * @return The NCName Item. | 400 | * @return The NCName Item. |
857 | 403 | */ | 401 | */ |
859 | 404 | Item createInt (int aInt); | 402 | Item createInt (int aInt); |
860 | 405 | 403 | ||
861 | 406 | /** \brief Creates an Integer Item | 404 | /** \brief Creates an Integer Item |
862 | 407 | * see [http://www.w3.org/TR/xmlschema-2/#integer] | 405 | * see [http://www.w3.org/TR/xmlschema-2/#integer] |
863 | @@ -409,7 +407,7 @@ | |||
864 | 409 | * @param aInteger String representation of the Integer. | 407 | * @param aInteger String representation of the Integer. |
865 | 410 | * @return The Integer Item. | 408 | * @return The Integer Item. |
866 | 411 | */ | 409 | */ |
868 | 412 | Item createInteger (const std::string &aInteger); | 410 | Item createInteger (const std::string &aInteger); |
869 | 413 | 411 | ||
870 | 414 | /** \brief Creates an Integer Item | 412 | /** \brief Creates an Integer Item |
871 | 415 | * see [http://www.w3.org/TR/xmlschema-2/#integer] | 413 | * see [http://www.w3.org/TR/xmlschema-2/#integer] |
872 | @@ -417,7 +415,7 @@ | |||
873 | 417 | * @param aInteger unsigned long representation of the Integer. | 415 | * @param aInteger unsigned long representation of the Integer. |
874 | 418 | * @return The Integer Item. | 416 | * @return The Integer Item. |
875 | 419 | */ | 417 | */ |
877 | 420 | Item createInteger (long long aInteger); | 418 | Item createInteger (long long aInteger); |
878 | 421 | 419 | ||
879 | 422 | /** \brief Creates a Long Item | 420 | /** \brief Creates a Long Item |
880 | 423 | * see [http://www.w3.org/TR/xmlschema-2/#long] | 421 | * see [http://www.w3.org/TR/xmlschema-2/#long] |
881 | @@ -425,7 +423,7 @@ | |||
882 | 425 | * @param aLong long long representation of the Long. | 423 | * @param aLong long long representation of the Long. |
883 | 426 | * @return The Long Item. | 424 | * @return The Long Item. |
884 | 427 | */ | 425 | */ |
886 | 428 | Item createLong (long long aLong); | 426 | Item createLong (long long aLong); |
887 | 429 | 427 | ||
888 | 430 | /** \brief Creates a NCName Item | 428 | /** \brief Creates a NCName Item |
889 | 431 | * see [http://www.w3.org/TR/xmlschema-2/#NCName] | 429 | * see [http://www.w3.org/TR/xmlschema-2/#NCName] |
890 | @@ -433,7 +431,7 @@ | |||
891 | 433 | * @param aValue String representation of the NCName. | 431 | * @param aValue String representation of the NCName. |
892 | 434 | * @return The NCName Item. | 432 | * @return The NCName Item. |
893 | 435 | */ | 433 | */ |
895 | 436 | Item createNCName (const std::string &aValue); | 434 | Item createNCName (const std::string &aValue); |
896 | 437 | 435 | ||
897 | 438 | /** \brief Creates a negativeInteger Item | 436 | /** \brief Creates a negativeInteger Item |
898 | 439 | * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger] | 437 | * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger] |
899 | @@ -441,7 +439,7 @@ | |||
900 | 441 | * @param aValue long long representation of the negativeInteger. | 439 | * @param aValue long long representation of the negativeInteger. |
901 | 442 | * @return The negativeInteger Item. | 440 | * @return The negativeInteger Item. |
902 | 443 | */ | 441 | */ |
904 | 444 | Item createNegativeInteger (long long aValue); | 442 | Item createNegativeInteger (long long aValue); |
905 | 445 | 443 | ||
906 | 446 | /** \brief Creates a nonNegativeInteger Item | 444 | /** \brief Creates a nonNegativeInteger Item |
907 | 447 | * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger] | 445 | * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger] |
908 | @@ -449,7 +447,7 @@ | |||
909 | 449 | * @param aValue unsigned long representation of the nonNegativeInteger. | 447 | * @param aValue unsigned long representation of the nonNegativeInteger. |
910 | 450 | * @return The nonNegativeInteger Item. | 448 | * @return The nonNegativeInteger Item. |
911 | 451 | */ | 449 | */ |
913 | 452 | Item createNonNegativeInteger (unsigned long long aValue); | 450 | Item createNonNegativeInteger (unsigned long long aValue); |
914 | 453 | 451 | ||
915 | 454 | /** \brief Creates a nonPositiveInteger Item | 452 | /** \brief Creates a nonPositiveInteger Item |
916 | 455 | * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger] | 453 | * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger] |
917 | @@ -457,7 +455,7 @@ | |||
918 | 457 | * @param aValue long long representation of the NCName. | 455 | * @param aValue long long representation of the NCName. |
919 | 458 | * @return The nonPositiveInteger Item. | 456 | * @return The nonPositiveInteger Item. |
920 | 459 | */ | 457 | */ |
922 | 460 | Item createNonPositiveInteger (long long aValue); | 458 | Item createNonPositiveInteger (long long aValue); |
923 | 461 | 459 | ||
924 | 462 | /** | 460 | /** |
925 | 463 | * Create a new Processing Instruction node N and place it among the | 461 | * Create a new Processing Instruction node N and place it among the |
926 | @@ -470,7 +468,7 @@ | |||
927 | 470 | * @param aBaseUri The Base URI of the new node, may be NULL. | 468 | * @param aBaseUri The Base URI of the new node, may be NULL. |
928 | 471 | * @return The new node N created by this method | 469 | * @return The new node N created by this method |
929 | 472 | */ | 470 | */ |
931 | 473 | Item createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri); | 471 | Item createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri); |
932 | 474 | 472 | ||
933 | 475 | /** \brief Creates a positiveInteger\ Item | 473 | /** \brief Creates a positiveInteger\ Item |
934 | 476 | * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger] | 474 | * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger] |
935 | @@ -478,7 +476,7 @@ | |||
936 | 478 | * @param aValue unsigned long representation of the positiveInteger. | 476 | * @param aValue unsigned long representation of the positiveInteger. |
937 | 479 | * @return The positiveInteger Item. | 477 | * @return The positiveInteger Item. |
938 | 480 | */ | 478 | */ |
940 | 481 | Item createPositiveInteger (unsigned long long aValue); | 479 | Item createPositiveInteger (unsigned long long aValue); |
941 | 482 | 480 | ||
942 | 483 | /** \brief Creates a QName Item | 481 | /** \brief Creates a QName Item |
943 | 484 | * see [http://www.w3.org/TR/xmlschema-2/#QName] | 482 | * see [http://www.w3.org/TR/xmlschema-2/#QName] |
944 | @@ -489,7 +487,7 @@ | |||
945 | 489 | * | 487 | * |
946 | 490 | * @return The QName Item. | 488 | * @return The QName Item. |
947 | 491 | */ | 489 | */ |
949 | 492 | Item createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname); | 490 | Item createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname); |
950 | 493 | 491 | ||
951 | 494 | /** \brief Creates a QName Item | 492 | /** \brief Creates a QName Item |
952 | 495 | * see [http://www.w3.org/TR/xmlschema-2/#QName] | 493 | * see [http://www.w3.org/TR/xmlschema-2/#QName] |
953 | @@ -498,7 +496,7 @@ | |||
954 | 498 | * @param aLocalname String representation of the localname. * | 496 | * @param aLocalname String representation of the localname. * |
955 | 499 | * @return The QName Item. | 497 | * @return The QName Item. |
956 | 500 | */ | 498 | */ |
958 | 501 | Item createQName (const std::string &aNamespace, const std::string &aLocalname); | 499 | Item createQName (const std::string &aNamespace, const std::string &aLocalname); |
959 | 502 | 500 | ||
960 | 503 | /** \brief Creates a QName Item | 501 | /** \brief Creates a QName Item |
961 | 504 | * see [http://www.w3.org/TR/xmlschema-2/#QName] | 502 | * see [http://www.w3.org/TR/xmlschema-2/#QName] |
962 | @@ -509,7 +507,7 @@ | |||
963 | 509 | * @param aQNameString String in the QName notation by James Clark. | 507 | * @param aQNameString String in the QName notation by James Clark. |
964 | 510 | * @return The QName Item. | 508 | * @return The QName Item. |
965 | 511 | */ | 509 | */ |
967 | 512 | Item createQName (const std::string &aQNameString); | 510 | Item createQName (const std::string &aQNameString); |
968 | 513 | 511 | ||
969 | 514 | /** \brief Creates a Short Item | 512 | /** \brief Creates a Short Item |
970 | 515 | * see [http://www.w3.org/TR/xmlschema-2/#short] | 513 | * see [http://www.w3.org/TR/xmlschema-2/#short] |
971 | @@ -517,8 +515,8 @@ | |||
972 | 517 | * @param aShort short representation of the Short. | 515 | * @param aShort short representation of the Short. |
973 | 518 | * @return The Short Item. | 516 | * @return The Short Item. |
974 | 519 | */ | 517 | */ |
977 | 520 | Item createShort (short aShort); | 518 | Item createShort (short aShort); |
978 | 521 | //Item createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false); | 519 | //Item createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false); |
979 | 522 | 520 | ||
980 | 523 | /** \brief Creates a String Item | 521 | /** \brief Creates a String Item |
981 | 524 | * see [http://www.w3.org/TR/xmlschema-2/#string] | 522 | * see [http://www.w3.org/TR/xmlschema-2/#string] |
982 | @@ -526,7 +524,7 @@ | |||
983 | 526 | * @param aString String representation of the String Item. | 524 | * @param aString String representation of the String Item. |
984 | 527 | * @return The String Item | 525 | * @return The String Item |
985 | 528 | */ | 526 | */ |
987 | 529 | Item createString (const std::string &aString); | 527 | Item createString (const std::string &aString); |
988 | 530 | 528 | ||
989 | 531 | /** | 529 | /** |
990 | 532 | * Create a new text node N and place it among the | 530 | * Create a new text node N and place it among the |
991 | @@ -537,7 +535,7 @@ | |||
992 | 537 | * @param aContent The content of the new node. | 535 | * @param aContent The content of the new node. |
993 | 538 | * @return The new node N created by this method | 536 | * @return The new node N created by this method |
994 | 539 | */ | 537 | */ |
996 | 540 | Item createTextNode (Item &aParent, const std::string &aContent); | 538 | Item createTextNode (Item &aParent, const std::string &aContent); |
997 | 541 | 539 | ||
998 | 542 | /** \brief Creates a Time Item | 540 | /** \brief Creates a Time Item |
999 | 543 | * see [http://www.w3.org/TR/xmlschema-2/#time] | 541 | * see [http://www.w3.org/TR/xmlschema-2/#time] |
1000 | @@ -548,7 +546,7 @@ | |||
1001 | 548 | * @param aTimeZone_hours short representation of the timezone difference in hours to UTC. | 546 | * @param aTimeZone_hours short representation of the timezone difference in hours to UTC. |
1002 | 549 | * @return The Time Item. | 547 | * @return The Time Item. |
1003 | 550 | */ | 548 | */ |
1005 | 551 | Item createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours); | 549 | Item createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours); |
1006 | 552 | 550 | ||
1007 | 553 | /** \brief Creates a Time Item | 551 | /** \brief Creates a Time Item |
1008 | 554 | * see [http://www.w3.org/TR/xmlschema-2/#time] | 552 | * see [http://www.w3.org/TR/xmlschema-2/#time] |
1009 | @@ -558,7 +556,7 @@ | |||
1010 | 558 | * @param aSecond double representation of the seconds and fractional seconds. | 556 | * @param aSecond double representation of the seconds and fractional seconds. |
1011 | 559 | * @return The Time Item. | 557 | * @return The Time Item. |
1012 | 560 | */ | 558 | */ |
1014 | 561 | Item createTime (short aHour, short aMinute, double aSecond); | 559 | Item createTime (short aHour, short aMinute, double aSecond); |
1015 | 562 | 560 | ||
1016 | 563 | /** \brief Creates a Time Item | 561 | /** \brief Creates a Time Item |
1017 | 564 | * see [http://www.w3.org/TR/xmlschema-2/#time] | 562 | * see [http://www.w3.org/TR/xmlschema-2/#time] |
1018 | @@ -566,7 +564,7 @@ | |||
1019 | 566 | * @param aValue String representation of the Time. | 564 | * @param aValue String representation of the Time. |
1020 | 567 | * @return The Time Item | 565 | * @return The Time Item |
1021 | 568 | */ | 566 | */ |
1023 | 569 | Item createTime (const std::string &aValue); | 567 | Item createTime (const std::string &aValue); |
1024 | 570 | 568 | ||
1025 | 571 | /** \brief Creates an Unsigned Byte Item | 569 | /** \brief Creates an Unsigned Byte Item |
1026 | 572 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte] | 570 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte] |
1027 | @@ -574,7 +572,7 @@ | |||
1028 | 574 | * @param aValue unsignedByte unsigned char representation of the unsigned byte. | 572 | * @param aValue unsignedByte unsigned char representation of the unsigned byte. |
1029 | 575 | * @return The Unsigned Byte Item. | 573 | * @return The Unsigned Byte Item. |
1030 | 576 | */ | 574 | */ |
1032 | 577 | Item createUnsignedByte (const unsigned char aValue); | 575 | Item createUnsignedByte (const unsigned char aValue); |
1033 | 578 | 576 | ||
1034 | 579 | /** \brief Creates an unsigned int Item | 577 | /** \brief Creates an unsigned int Item |
1035 | 580 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt] | 578 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt] |
1036 | @@ -582,7 +580,7 @@ | |||
1037 | 582 | * @param aValue unsigned int representation of the unsignedInt. | 580 | * @param aValue unsigned int representation of the unsignedInt. |
1038 | 583 | * @return The unsignedInt Item. | 581 | * @return The unsignedInt Item. |
1039 | 584 | */ | 582 | */ |
1041 | 585 | Item createUnsignedInt (unsigned int aValue); | 583 | Item createUnsignedInt (unsigned int aValue); |
1042 | 586 | 584 | ||
1043 | 587 | /** \brief Creates an unsignedLong Item | 585 | /** \brief Creates an unsignedLong Item |
1044 | 588 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong] | 586 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong] |
1045 | @@ -590,7 +588,7 @@ | |||
1046 | 590 | * @param aValue unsignedLong long long representation of the unsignedLong. | 588 | * @param aValue unsignedLong long long representation of the unsignedLong. |
1047 | 591 | * @return The unsignedLong Item. | 589 | * @return The unsignedLong Item. |
1048 | 592 | */ | 590 | */ |
1050 | 593 | Item createUnsignedLong (unsigned long long aValue); | 591 | Item createUnsignedLong (unsigned long long aValue); |
1051 | 594 | 592 | ||
1052 | 595 | /** \brief Creates a unsignedShort Item | 593 | /** \brief Creates a unsignedShort Item |
1053 | 596 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort] | 594 | * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort] |
1054 | @@ -598,7 +596,55 @@ | |||
1055 | 598 | * @param aValue unsigned short representation of the unsignedShort. | 596 | * @param aValue unsigned short representation of the unsignedShort. |
1056 | 599 | * @return The unsignedShort Item. | 597 | * @return The unsignedShort Item. |
1057 | 600 | */ | 598 | */ |
1059 | 601 | Item createUnsignedShort (unsigned short aValue); | 599 | Item createUnsignedShort (unsigned short aValue); |
1060 | 600 | |||
1061 | 601 | /** | ||
1062 | 602 | * \brief Create a JSON null item. | ||
1063 | 603 | */ | ||
1064 | 604 | Item createJSONNull(); | ||
1065 | 605 | |||
1066 | 606 | /** | ||
1067 | 607 | * \brief Create a JSON Number item from a string. | ||
1068 | 608 | * This will actually be | ||
1069 | 609 | * an xs:integer, xs:double, or xs:decimal, depending on the content | ||
1070 | 610 | * of the string. | ||
1071 | 611 | * | ||
1072 | 612 | * @param aString The input string. | ||
1073 | 613 | */ | ||
1074 | 614 | Item createJSONNumber(std::string aString); | ||
1075 | 615 | |||
1076 | 616 | /** | ||
1077 | 617 | * \brief Create a JSON Object containing the specified JSON Pairs. | ||
1078 | 618 | * | ||
1079 | 619 | * @param aNames A vector containing the name and value of each pair. | ||
1080 | 620 | */ | ||
1081 | 621 | Item createJSONObject(std::vector<std::pair<Item, Item> >& aNames); | ||
1082 | 622 | |||
1083 | 623 | /** | ||
1084 | 624 | * \brief Create a JSON Object containing the specified string Pairs. | ||
1085 | 625 | * | ||
1086 | 626 | * @param aNames A vector containing the name and value of each pair. | ||
1087 | 627 | */ | ||
1088 | 628 | Item createJSONObject(std::vector<std::pair<std::string, std::string> >& aNames); | ||
1089 | 629 | |||
1090 | 630 | /** | ||
1091 | 631 | * \brief Create a JSON Array containing the specified items. | ||
1092 | 632 | * | ||
1093 | 633 | * @param aItems a Vector<Item> containing Items which may | ||
1094 | 634 | * be stored in a JSON Array (namely JSON Arrays, JSON Objects, | ||
1095 | 635 | * JSON nulls, valid JSON numeric types, or xs:strings). | ||
1096 | 636 | */ | ||
1097 | 637 | Item createJSONArray(std::vector<Item>& aItems); | ||
1098 | 638 | |||
1099 | 639 | /** | ||
1100 | 640 | * \brief Create a JSON Array containing the specified items. | ||
1101 | 641 | * | ||
1102 | 642 | * @param aItems a Vector<String> containing strings which may | ||
1103 | 643 | * be stored in a JSON Array. | ||
1104 | 644 | */ | ||
1105 | 645 | Item createJSONArray(std::vector<std::string>& aItems); | ||
1106 | 646 | |||
1107 | 647 | |||
1108 | 602 | }; // class ItemFactory | 648 | }; // class ItemFactory |
1109 | 603 | 649 | ||
1110 | 604 | #endif | 650 | #endif |
1111 | 605 | \ No newline at end of file | 651 | \ No newline at end of file |
1112 | 606 | 652 | ||
1113 | === modified file 'swig/ItemFactory.i' | |||
1114 | --- swig/ItemFactory.i 2013-02-07 17:24:36 +0000 | |||
1115 | +++ swig/ItemFactory.i 2013-03-27 00:40:33 +0000 | |||
1116 | @@ -3,16 +3,15 @@ | |||
1117 | 3 | 3 | ||
1118 | 4 | 4 | ||
1119 | 5 | 5 | ||
1121 | 6 | Item ItemFactory::createAnyURI (const std::string &aURI){ | 6 | Item ItemFactory::createAnyURI (const std::string &aURI){ |
1122 | 7 | return Item(theItemFactory->createAnyURI(aURI)); | 7 | return Item(theItemFactory->createAnyURI(aURI)); |
1123 | 8 | } | 8 | } |
1124 | 9 | 9 | ||
1126 | 10 | Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue){ | 10 | Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue){ |
1127 | 11 | return Item( theItemFactory->createAttributeNode( aParent.theItem, aNodeName.theItem, aTypeName.theItem, aTypedValue.theItem )); | 11 | return Item( theItemFactory->createAttributeNode( aParent.theItem, aNodeName.theItem, aTypeName.theItem, aTypedValue.theItem )); |
1128 | 12 | } | 12 | } |
1129 | 13 | 13 | ||
1132 | 14 | #ifndef SWIGRUBY | 14 | Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue){ |
1131 | 15 | Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue){ | ||
1133 | 16 | 15 | ||
1134 | 17 | std::vector< zorba::Item > typedValue; | 16 | std::vector< zorba::Item > typedValue; |
1135 | 18 | typedValue.reserve(aTypedValue.size()); | 17 | typedValue.reserve(aTypedValue.size()); |
1136 | @@ -22,71 +21,70 @@ | |||
1137 | 22 | } | 21 | } |
1138 | 23 | return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue )); | 22 | return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue )); |
1139 | 24 | } | 23 | } |
1140 | 25 | #endif | ||
1141 | 26 | 24 | ||
1143 | 27 | Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){ | 25 | Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){ |
1144 | 28 | return Item( theItemFactory->createBase64Binary(aBinData, aLength)); | 26 | return Item( theItemFactory->createBase64Binary(aBinData, aLength)); |
1145 | 29 | } | 27 | } |
1147 | 30 | Item ItemFactory::createBase64Binary (std::istream &aStream){ | 28 | Item ItemFactory::createBase64Binary (std::istream &aStream){ |
1148 | 31 | return Item( theItemFactory->createBase64Binary(aStream)); | 29 | return Item( theItemFactory->createBase64Binary(aStream)); |
1149 | 32 | } | 30 | } |
1151 | 33 | Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){ | 31 | Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){ |
1152 | 34 | return Item( theItemFactory->createBase64Binary(aBinData, aLength)); | 32 | return Item( theItemFactory->createBase64Binary(aBinData, aLength)); |
1153 | 35 | } | 33 | } |
1155 | 36 | Item ItemFactory::createBoolean (bool aValue){ | 34 | Item ItemFactory::createBoolean (bool aValue){ |
1156 | 37 | return Item( theItemFactory->createBoolean(aValue)); | 35 | return Item( theItemFactory->createBoolean(aValue)); |
1157 | 38 | } | 36 | } |
1159 | 39 | Item ItemFactory::createByte (char aByte){ | 37 | Item ItemFactory::createByte (char aByte){ |
1160 | 40 | return Item( theItemFactory->createByte(aByte)); | 38 | return Item( theItemFactory->createByte(aByte)); |
1161 | 41 | } | 39 | } |
1163 | 42 | Item ItemFactory::createCommentNode (Item &aParent, const std::string &aContent){ | 40 | Item ItemFactory::createCommentNode (Item &aParent, const std::string &aContent){ |
1164 | 43 | zorba::String lContent = zorba::String(aContent); | 41 | zorba::String lContent = zorba::String(aContent); |
1165 | 44 | return Item( theItemFactory->createCommentNode (aParent.theItem, lContent)); | 42 | return Item( theItemFactory->createCommentNode (aParent.theItem, lContent)); |
1166 | 45 | } | 43 | } |
1168 | 46 | Item ItemFactory::createDate (const std::string &aDate){ | 44 | Item ItemFactory::createDate (const std::string &aDate){ |
1169 | 47 | return Item( theItemFactory->createDate(aDate)); | 45 | return Item( theItemFactory->createDate(aDate)); |
1170 | 48 | } | 46 | } |
1172 | 49 | Item ItemFactory::createDate (short aYear, short aMonth, short aDay){ | 47 | Item ItemFactory::createDate (short aYear, short aMonth, short aDay){ |
1173 | 50 | return Item( theItemFactory->createDate (aYear, aMonth, aDay)); | 48 | return Item( theItemFactory->createDate (aYear, aMonth, aDay)); |
1174 | 51 | } | 49 | } |
1176 | 52 | Item ItemFactory::createDateTime (const std::string &aDateTimeValue){ | 50 | Item ItemFactory::createDateTime (const std::string &aDateTimeValue){ |
1177 | 53 | return Item( theItemFactory->createDateTime (aDateTimeValue)); | 51 | return Item( theItemFactory->createDateTime (aDateTimeValue)); |
1178 | 54 | } | 52 | } |
1180 | 55 | Item ItemFactory::createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours){ | 53 | Item ItemFactory::createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours){ |
1181 | 56 | return Item( theItemFactory->createDateTime (aYear, aMonth, aDay, aHour, aMinute, aSecond, aTimeZone_hours)); | 54 | return Item( theItemFactory->createDateTime (aYear, aMonth, aDay, aHour, aMinute, aSecond, aTimeZone_hours)); |
1182 | 57 | } | 55 | } |
1184 | 58 | Item ItemFactory::createDecimal (const std::string &aValue){ | 56 | Item ItemFactory::createDecimal (const std::string &aValue){ |
1185 | 59 | return Item( theItemFactory->createDecimal (aValue)); | 57 | return Item( theItemFactory->createDecimal (aValue)); |
1186 | 60 | } | 58 | } |
1188 | 61 | Item ItemFactory::createDecimalFromDouble (double aValue){ | 59 | Item ItemFactory::createDecimalFromDouble (double aValue){ |
1189 | 62 | return Item( theItemFactory->createDecimalFromDouble (aValue)); | 60 | return Item( theItemFactory->createDecimalFromDouble (aValue)); |
1190 | 63 | } | 61 | } |
1192 | 64 | Item ItemFactory::createDecimalFromLong (unsigned long aValue){ | 62 | Item ItemFactory::createDecimalFromLong (unsigned long aValue){ |
1193 | 65 | return Item( theItemFactory->createDecimalFromLong (aValue)); | 63 | return Item( theItemFactory->createDecimalFromLong (aValue)); |
1194 | 66 | } | 64 | } |
1202 | 67 | Item ItemFactory::createDouble (const std::string &aValue){ | 65 | Item ItemFactory::createDouble (const std::string &aValue){ |
1203 | 68 | return Item( theItemFactory->createDouble (aValue)); | 66 | return Item( theItemFactory->createDouble (aValue)); |
1204 | 69 | } | 67 | } |
1205 | 70 | Item ItemFactory::createDouble (double aValue){ | 68 | Item ItemFactory::createDouble (double aValue){ |
1206 | 71 | return Item( theItemFactory->createDouble (aValue)); | 69 | return Item( theItemFactory->createDouble (aValue)); |
1207 | 72 | } | 70 | } |
1208 | 73 | Item ItemFactory::createDuration (const std::string &aValue){ | 71 | Item ItemFactory::createDuration (const std::string &aValue){ |
1209 | 74 | return Item( theItemFactory->createDuration (aValue)); | 72 | return Item( theItemFactory->createDuration (aValue)); |
1210 | 75 | } | 73 | } |
1212 | 76 | Item ItemFactory::createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds){ | 74 | Item ItemFactory::createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds){ |
1213 | 77 | return Item( theItemFactory->createDuration (aYear, aMonths, aDays, aHours, aMinutes, aSeconds)); | 75 | return Item( theItemFactory->createDuration (aYear, aMonths, aDays, aHours, aMinutes, aSeconds)); |
1214 | 78 | } | 76 | } |
1216 | 79 | Item ItemFactory::createDayTimeDuration (const std::string &aValue){ | 77 | Item ItemFactory::createDayTimeDuration (const std::string &aValue){ |
1217 | 80 | return Item( theItemFactory->createDayTimeDuration (aValue)); | 78 | return Item( theItemFactory->createDayTimeDuration (aValue)); |
1218 | 81 | } | 79 | } |
1220 | 82 | Item ItemFactory::createYearMonthDuration (const std::string &aValue){ | 80 | Item ItemFactory::createYearMonthDuration (const std::string &aValue){ |
1221 | 83 | return Item( theItemFactory->createYearMonthDuration (aValue)); | 81 | return Item( theItemFactory->createYearMonthDuration (aValue)); |
1222 | 84 | } | 82 | } |
1224 | 85 | Item ItemFactory::createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri){ | 83 | Item ItemFactory::createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri){ |
1225 | 86 | return Item( theItemFactory->createDocumentNode (aBaseUri, aDocUri)); | 84 | return Item( theItemFactory->createDocumentNode (aBaseUri, aDocUri)); |
1226 | 87 | } | 85 | } |
1229 | 88 | #ifndef SWIGRUBY | 86 | |
1230 | 89 | Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings){ | 87 | Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings){ |
1231 | 90 | std::vector< std::pair< zorba::String, zorba::String > > items; | 88 | std::vector< std::pair< zorba::String, zorba::String > > items; |
1232 | 91 | items.reserve(aNsBindings.size()); | 89 | items.reserve(aNsBindings.size()); |
1233 | 92 | std::vector< std::pair< std::string, std::string > >::iterator iter; | 90 | std::vector< std::pair< std::string, std::string > >::iterator iter; |
1234 | @@ -98,128 +96,184 @@ | |||
1235 | 98 | } | 96 | } |
1236 | 99 | return Item( theItemFactory->createElementNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, aHasTypedValue, aHasEmptyValue, items)); | 97 | return Item( theItemFactory->createElementNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, aHasTypedValue, aHasEmptyValue, items)); |
1237 | 100 | } | 98 | } |
1240 | 101 | #endif | 99 | |
1241 | 102 | Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue){ | 100 | Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue){ |
1242 | 103 | return Item( theItemFactory->createElementNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, aHasTypedValue, aHasEmptyValue, std::vector<std::pair<zorba::String, zorba::String> >())); | 101 | return Item( theItemFactory->createElementNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, aHasTypedValue, aHasEmptyValue, std::vector<std::pair<zorba::String, zorba::String> >())); |
1243 | 104 | } | 102 | } |
1251 | 105 | Item ItemFactory::createFloat (const std::string &aValue){ | 103 | Item ItemFactory::createFloat (const std::string &aValue){ |
1252 | 106 | return Item( theItemFactory->createFloat (aValue)); | 104 | return Item( theItemFactory->createFloat (aValue)); |
1253 | 107 | } | 105 | } |
1254 | 108 | Item ItemFactory::createFloat (float aValue){ | 106 | Item ItemFactory::createFloat (float aValue){ |
1255 | 109 | return Item( theItemFactory->createFloat (aValue)); | 107 | return Item( theItemFactory->createFloat (aValue)); |
1256 | 110 | } | 108 | } |
1257 | 111 | Item ItemFactory::createGDay (const std::string &aValue){ | 109 | Item ItemFactory::createGDay (const std::string &aValue){ |
1258 | 112 | return Item( theItemFactory->createGDay (aValue)); | 110 | return Item( theItemFactory->createGDay (aValue)); |
1259 | 113 | } | 111 | } |
1261 | 114 | Item ItemFactory::createGDay (short aDay){ | 112 | Item ItemFactory::createGDay (short aDay){ |
1262 | 115 | return Item( theItemFactory->createGDay (aDay)); | 113 | return Item( theItemFactory->createGDay (aDay)); |
1263 | 116 | } | 114 | } |
1265 | 117 | Item ItemFactory::createGMonth (const std::string &aValue){ | 115 | Item ItemFactory::createGMonth (const std::string &aValue){ |
1266 | 118 | return Item( theItemFactory->createGMonth (aValue)); | 116 | return Item( theItemFactory->createGMonth (aValue)); |
1267 | 119 | } | 117 | } |
1269 | 120 | Item ItemFactory::createGMonth (short aMonth){ | 118 | Item ItemFactory::createGMonth (short aMonth){ |
1270 | 121 | return Item( theItemFactory->createGMonth (aMonth)); | 119 | return Item( theItemFactory->createGMonth (aMonth)); |
1271 | 122 | } | 120 | } |
1273 | 123 | Item ItemFactory::createGMonthDay (const std::string &aValue){ | 121 | Item ItemFactory::createGMonthDay (const std::string &aValue){ |
1274 | 124 | return Item( theItemFactory->createGMonthDay (aValue)); | 122 | return Item( theItemFactory->createGMonthDay (aValue)); |
1275 | 125 | } | 123 | } |
1277 | 126 | Item ItemFactory::createGMonthDay (short aMonth, short aDay){ | 124 | Item ItemFactory::createGMonthDay (short aMonth, short aDay){ |
1278 | 127 | return Item( theItemFactory->createGMonthDay (aMonth, aDay)); | 125 | return Item( theItemFactory->createGMonthDay (aMonth, aDay)); |
1279 | 128 | } | 126 | } |
1281 | 129 | Item ItemFactory::createGYear (short aYear){ | 127 | Item ItemFactory::createGYear (short aYear){ |
1282 | 130 | return Item( theItemFactory->createGYear (aYear)); | 128 | return Item( theItemFactory->createGYear (aYear)); |
1283 | 131 | } | 129 | } |
1285 | 132 | Item ItemFactory::createGYear (const std::string &aValue){ | 130 | Item ItemFactory::createGYear (const std::string &aValue){ |
1286 | 133 | return Item( theItemFactory->createGYear (aValue)); | 131 | return Item( theItemFactory->createGYear (aValue)); |
1287 | 134 | } | 132 | } |
1289 | 135 | Item ItemFactory::createGYearMonth (const std::string &aValue){ | 133 | Item ItemFactory::createGYearMonth (const std::string &aValue){ |
1290 | 136 | return Item( theItemFactory->createGYearMonth (aValue)); | 134 | return Item( theItemFactory->createGYearMonth (aValue)); |
1291 | 137 | } | 135 | } |
1293 | 138 | Item ItemFactory::createGYearMonth (short aYear, short aMonth){ | 136 | Item ItemFactory::createGYearMonth (short aYear, short aMonth){ |
1294 | 139 | return Item( theItemFactory->createGYearMonth (aYear, aMonth)); | 137 | return Item( theItemFactory->createGYearMonth (aYear, aMonth)); |
1295 | 140 | } | 138 | } |
1297 | 141 | Item ItemFactory::createHexBinary (const char *aHexData, size_t aSize){ | 139 | Item ItemFactory::createHexBinary (const char *aHexData, size_t aSize){ |
1298 | 142 | return Item( theItemFactory->createHexBinary (aHexData, aSize)); | 140 | return Item( theItemFactory->createHexBinary (aHexData, aSize)); |
1299 | 143 | } | 141 | } |
1301 | 144 | Item ItemFactory::createInt (int aInt){ | 142 | Item ItemFactory::createInt (int aInt){ |
1302 | 145 | return Item( theItemFactory->createInt (aInt)); | 143 | return Item( theItemFactory->createInt (aInt)); |
1303 | 146 | } | 144 | } |
1311 | 147 | Item ItemFactory::createInteger (const std::string &aInteger){ | 145 | Item ItemFactory::createInteger (const std::string &aInteger){ |
1312 | 148 | return Item( theItemFactory->createInteger (aInteger)); | 146 | return Item( theItemFactory->createInteger (aInteger)); |
1313 | 149 | } | 147 | } |
1314 | 150 | Item ItemFactory::createInteger (long long aInteger){ | 148 | Item ItemFactory::createInteger (long long aInteger){ |
1315 | 151 | return Item( theItemFactory->createInteger (aInteger)); | 149 | return Item( theItemFactory->createInteger (aInteger)); |
1316 | 152 | } | 150 | } |
1317 | 153 | Item ItemFactory::createLong (long long aLong){ | 151 | Item ItemFactory::createLong (long long aLong){ |
1318 | 154 | return Item( theItemFactory->createLong (aLong)); | 152 | return Item( theItemFactory->createLong (aLong)); |
1319 | 155 | } | 153 | } |
1321 | 156 | Item ItemFactory::createNCName (const std::string &aValue){ | 154 | Item ItemFactory::createNCName (const std::string &aValue){ |
1322 | 157 | return Item( theItemFactory->createNCName (aValue)); | 155 | return Item( theItemFactory->createNCName (aValue)); |
1323 | 158 | } | 156 | } |
1325 | 159 | Item ItemFactory::createNegativeInteger (long long aValue){ | 157 | Item ItemFactory::createNegativeInteger (long long aValue){ |
1326 | 160 | return Item( theItemFactory->createNegativeInteger (aValue)); | 158 | return Item( theItemFactory->createNegativeInteger (aValue)); |
1327 | 161 | } | 159 | } |
1329 | 162 | Item ItemFactory::createNonNegativeInteger (unsigned long long aValue){ | 160 | Item ItemFactory::createNonNegativeInteger (unsigned long long aValue){ |
1330 | 163 | return Item( theItemFactory->createNonNegativeInteger (aValue)); | 161 | return Item( theItemFactory->createNonNegativeInteger (aValue)); |
1331 | 164 | } | 162 | } |
1333 | 165 | Item ItemFactory::createNonPositiveInteger (long long aValue){ | 163 | Item ItemFactory::createNonPositiveInteger (long long aValue){ |
1334 | 166 | return Item( theItemFactory->createNonPositiveInteger (aValue)); | 164 | return Item( theItemFactory->createNonPositiveInteger (aValue)); |
1335 | 167 | } | 165 | } |
1337 | 168 | Item ItemFactory::createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri){ | 166 | Item ItemFactory::createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri){ |
1338 | 169 | zorba::String lTarget = zorba::String(aTarget); | 167 | zorba::String lTarget = zorba::String(aTarget); |
1339 | 170 | zorba::String lContent = zorba::String(aContent); | 168 | zorba::String lContent = zorba::String(aContent); |
1340 | 171 | zorba::String lBaseUri = zorba::String(aBaseUri); | 169 | zorba::String lBaseUri = zorba::String(aBaseUri); |
1341 | 172 | return Item( theItemFactory->createPiNode (aParent.theItem, lTarget, lContent, lBaseUri)); | 170 | return Item( theItemFactory->createPiNode (aParent.theItem, lTarget, lContent, lBaseUri)); |
1342 | 173 | } | 171 | } |
1344 | 174 | Item ItemFactory::createPositiveInteger (unsigned long long aValue){ | 172 | Item ItemFactory::createPositiveInteger (unsigned long long aValue){ |
1345 | 175 | return Item( theItemFactory->createPositiveInteger (aValue)); | 173 | return Item( theItemFactory->createPositiveInteger (aValue)); |
1346 | 176 | } | 174 | } |
1348 | 177 | Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname){ | 175 | Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname){ |
1349 | 178 | return Item( theItemFactory->createQName (aNamespace, aPrefix, aLocalname)); | 176 | return Item( theItemFactory->createQName (aNamespace, aPrefix, aLocalname)); |
1350 | 179 | } | 177 | } |
1352 | 180 | Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aLocalname){ | 178 | Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aLocalname){ |
1353 | 181 | return Item( theItemFactory->createQName (aNamespace, aLocalname)); | 179 | return Item( theItemFactory->createQName (aNamespace, aLocalname)); |
1354 | 182 | } | 180 | } |
1356 | 183 | Item ItemFactory::createQName (const std::string &aQNameString){ | 181 | Item ItemFactory::createQName (const std::string &aQNameString){ |
1357 | 184 | return Item( theItemFactory->createQName (aQNameString)); | 182 | return Item( theItemFactory->createQName (aQNameString)); |
1358 | 185 | } | 183 | } |
1360 | 186 | Item ItemFactory::createShort (short aShort){ | 184 | Item ItemFactory::createShort (short aShort){ |
1361 | 187 | return Item( theItemFactory->createShort (aShort)); | 185 | return Item( theItemFactory->createShort (aShort)); |
1362 | 188 | } | 186 | } |
1363 | 189 | /* | 187 | /* |
1365 | 190 | Item ItemFactory::createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false){ | 188 | Item ItemFactory::createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false){ |
1366 | 191 | return Item( theItemFactory->createStreamableString (std::istream &stream, StreamReleaser streamReleaser, seekable)); | 189 | return Item( theItemFactory->createStreamableString (std::istream &stream, StreamReleaser streamReleaser, seekable)); |
1367 | 192 | } | 190 | } |
1368 | 193 | */ | 191 | */ |
1370 | 194 | Item ItemFactory::createString (const std::string &aString){ | 192 | Item ItemFactory::createString (const std::string &aString){ |
1371 | 195 | return Item( theItemFactory->createString (aString)); | 193 | return Item( theItemFactory->createString (aString)); |
1372 | 196 | } | 194 | } |
1374 | 197 | Item ItemFactory::createTextNode (Item &aParent, const std::string &aContent){ | 195 | Item ItemFactory::createTextNode (Item &aParent, const std::string &aContent){ |
1375 | 198 | zorba::String lContent = zorba::String(aContent); | 196 | zorba::String lContent = zorba::String(aContent); |
1376 | 199 | return Item( theItemFactory->createTextNode (aParent.theItem, lContent)); | 197 | return Item( theItemFactory->createTextNode (aParent.theItem, lContent)); |
1377 | 200 | } | 198 | } |
1379 | 201 | Item ItemFactory::createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours){ | 199 | Item ItemFactory::createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours){ |
1380 | 202 | return Item( theItemFactory->createTime (aHour, aMinute, aSecond, aTimeZone_hours)); | 200 | return Item( theItemFactory->createTime (aHour, aMinute, aSecond, aTimeZone_hours)); |
1381 | 203 | } | 201 | } |
1383 | 204 | Item ItemFactory::createTime (short aHour, short aMinute, double aSecond){ | 202 | Item ItemFactory::createTime (short aHour, short aMinute, double aSecond){ |
1384 | 205 | return Item( theItemFactory->createTime (aHour, aMinute, aSecond)); | 203 | return Item( theItemFactory->createTime (aHour, aMinute, aSecond)); |
1385 | 206 | } | 204 | } |
1387 | 207 | Item ItemFactory::createTime (const std::string &aValue){ | 205 | Item ItemFactory::createTime (const std::string &aValue){ |
1388 | 208 | return Item( theItemFactory->createTime (aValue)); | 206 | return Item( theItemFactory->createTime (aValue)); |
1389 | 209 | } | 207 | } |
1391 | 210 | Item ItemFactory::createUnsignedByte (const unsigned char aValue){ | 208 | Item ItemFactory::createUnsignedByte (const unsigned char aValue){ |
1392 | 211 | return Item( theItemFactory->createUnsignedByte (aValue)); | 209 | return Item( theItemFactory->createUnsignedByte (aValue)); |
1393 | 212 | } | 210 | } |
1395 | 213 | Item ItemFactory::createUnsignedInt (unsigned int aValue){ | 211 | Item ItemFactory::createUnsignedInt (unsigned int aValue){ |
1396 | 214 | return Item( theItemFactory->createUnsignedInt (aValue)); | 212 | return Item( theItemFactory->createUnsignedInt (aValue)); |
1397 | 215 | } | 213 | } |
1399 | 216 | Item ItemFactory::createUnsignedLong (unsigned long long aValue){ | 214 | Item ItemFactory::createUnsignedLong (unsigned long long aValue){ |
1400 | 217 | return Item( theItemFactory->createUnsignedLong (aValue)); | 215 | return Item( theItemFactory->createUnsignedLong (aValue)); |
1401 | 218 | } | 216 | } |
1403 | 219 | Item ItemFactory::createUnsignedShort (unsigned short aValue){ | 217 | Item ItemFactory::createUnsignedShort (unsigned short aValue){ |
1404 | 220 | return Item( theItemFactory->createUnsignedShort (aValue)); | 218 | return Item( theItemFactory->createUnsignedShort (aValue)); |
1405 | 221 | } | 219 | } |
1406 | 222 | 220 | ||
1407 | 221 | Item ItemFactory::createJSONNull() { | ||
1408 | 222 | return Item( theItemFactory->createJSONNull() ); | ||
1409 | 223 | } | ||
1410 | 224 | |||
1411 | 225 | Item ItemFactory::createJSONNumber(std::string aString) { | ||
1412 | 226 | return Item( theItemFactory->createJSONNumber(aString)); | ||
1413 | 227 | } | ||
1414 | 228 | |||
1415 | 229 | Item ItemFactory::createJSONObject(std::vector<std::pair<Item, Item> >& aNames) { | ||
1416 | 230 | std::vector< std::pair< zorba::Item, zorba::Item > > names; | ||
1417 | 231 | names.reserve(aNames.size()); | ||
1418 | 232 | |||
1419 | 233 | for(std::vector< std::pair< Item, Item > >::iterator iter = aNames.begin(); iter != aNames.end(); iter++) { | ||
1420 | 234 | std::pair< zorba::Item, zorba::Item > pair; | ||
1421 | 235 | pair.first = (*iter).first.theItem; | ||
1422 | 236 | pair.second = (*iter).second.theItem; | ||
1423 | 237 | names.push_back(pair); | ||
1424 | 238 | } | ||
1425 | 239 | return Item( theItemFactory->createJSONObject (names) ); | ||
1426 | 240 | } | ||
1427 | 241 | |||
1428 | 242 | Item ItemFactory::createJSONObject(std::vector<std::pair<std::string, std::string> >& aNames) { | ||
1429 | 243 | std::vector< std::pair< zorba::Item, zorba::Item > > names; | ||
1430 | 244 | names.reserve(aNames.size()); | ||
1431 | 245 | |||
1432 | 246 | for(std::vector<std::pair<std::string, std::string> >::iterator iter = aNames.begin(); iter != aNames.end(); iter++) { | ||
1433 | 247 | std::pair< zorba::Item, zorba::Item > pair; | ||
1434 | 248 | pair.first = theItemFactory->createString( (*iter).first ); | ||
1435 | 249 | pair.second = theItemFactory->createString( (*iter).second ); | ||
1436 | 250 | names.push_back(pair); | ||
1437 | 251 | } | ||
1438 | 252 | return Item( theItemFactory->createJSONObject (names) ); | ||
1439 | 253 | } | ||
1440 | 254 | |||
1441 | 255 | Item ItemFactory::createJSONArray(std::vector<Item>& aItems) { | ||
1442 | 256 | std::vector< zorba::Item > items; | ||
1443 | 257 | items.reserve(aItems.size()); | ||
1444 | 258 | |||
1445 | 259 | for(std::vector< Item >::iterator iter = aItems.begin(); iter != aItems.end(); iter++) { | ||
1446 | 260 | zorba::Item item = (*iter).theItem; | ||
1447 | 261 | items.push_back(item); | ||
1448 | 262 | } | ||
1449 | 263 | return Item( theItemFactory->createJSONArray (items) ); | ||
1450 | 264 | } | ||
1451 | 265 | |||
1452 | 266 | Item ItemFactory::createJSONArray(std::vector<std::string>& aItems) { | ||
1453 | 267 | std::vector< zorba::Item > items; | ||
1454 | 268 | items.reserve(aItems.size()); | ||
1455 | 269 | |||
1456 | 270 | for(std::vector< std::string >::iterator iter = aItems.begin(); iter != aItems.end(); iter++) { | ||
1457 | 271 | zorba::Item item = theItemFactory->createString(*iter); | ||
1458 | 272 | items.push_back(item); | ||
1459 | 273 | } | ||
1460 | 274 | return Item( theItemFactory->createJSONArray (items) ); | ||
1461 | 275 | } | ||
1462 | 276 | |||
1463 | 223 | 277 | ||
1464 | 224 | %} // end Implementation | 278 | %} // end Implementation |
1465 | 225 | 279 | ||
1466 | 226 | 280 | ||
1467 | === modified file 'swig/StaticContext.i' | |||
1468 | --- swig/StaticContext.i 2013-02-07 17:24:36 +0000 | |||
1469 | +++ swig/StaticContext.i 2013-03-27 00:40:33 +0000 | |||
1470 | @@ -35,13 +35,13 @@ | |||
1471 | 35 | bool StaticContext::containsFunction(const std::string &aFnNameUri, const std::string &aFnNameLocal, int arity) const | 35 | bool StaticContext::containsFunction(const std::string &aFnNameUri, const std::string &aFnNameLocal, int arity) const |
1472 | 36 | { return theStaticContext->containsFunction(aFnNameUri, aFnNameLocal, arity); } | 36 | { return theStaticContext->containsFunction(aFnNameUri, aFnNameLocal, arity); } |
1473 | 37 | 37 | ||
1475 | 38 | StaticContext StaticContext::createChildContext() const | 38 | StaticContext StaticContext::createChildContext() const |
1476 | 39 | { return StaticContext(theStaticContext->createChildContext()); } | 39 | { return StaticContext(theStaticContext->createChildContext()); } |
1477 | 40 | 40 | ||
1479 | 41 | void StaticContext::declareOption (const Item &aQName, const std::string &aOptionVal) | 41 | void StaticContext::declareOption (const Item &aQName, const std::string &aOptionVal) |
1480 | 42 | { return theStaticContext->declareOption(aQName.theItem, aOptionVal); } | 42 | { return theStaticContext->declareOption(aQName.theItem, aOptionVal); } |
1481 | 43 | 43 | ||
1483 | 44 | void StaticContext::disableFunction (const Item &aQName, int arity) | 44 | void StaticContext::disableFunction (const Item &aQName, int arity) |
1484 | 45 | { theStaticContext->disableFunction( aQName.theItem, arity); } | 45 | { theStaticContext->disableFunction( aQName.theItem, arity); } |
1485 | 46 | 46 | ||
1486 | 47 | std::string StaticContext::getBaseURI () const | 47 | std::string StaticContext::getBaseURI () const |
1487 | @@ -65,7 +65,7 @@ | |||
1488 | 65 | result = ZorbaConstants::PRESERVE_CONSTRUCTION; | 65 | result = ZorbaConstants::PRESERVE_CONSTRUCTION; |
1489 | 66 | } | 66 | } |
1490 | 67 | return result; | 67 | return result; |
1492 | 68 | } | 68 | } |
1493 | 69 | 69 | ||
1494 | 70 | ZorbaConstants::PreserveMode StaticContext::getCopyNamespacesModePreserve() | 70 | ZorbaConstants::PreserveMode StaticContext::getCopyNamespacesModePreserve() |
1495 | 71 | { | 71 | { |
1496 | 72 | 72 | ||
1497 | === modified file 'swig/TypeIdentifier.i' | |||
1498 | --- swig/TypeIdentifier.i 2012-03-27 00:56:11 +0000 | |||
1499 | +++ swig/TypeIdentifier.i 2013-03-27 00:40:33 +0000 | |||
1500 | @@ -19,7 +19,7 @@ | |||
1501 | 19 | zorba::IdentTypes::quantifier_t | 19 | zorba::IdentTypes::quantifier_t |
1502 | 20 | TypeIdentifier::convertQuantifier(IdentTypes::Quantifier quantifier) | 20 | TypeIdentifier::convertQuantifier(IdentTypes::Quantifier quantifier) |
1503 | 21 | { | 21 | { |
1505 | 22 | zorba::IdentTypes::quantifier_t result; | 22 | zorba::IdentTypes::quantifier_t result = zorba::IdentTypes::QUANT_ONE; |
1506 | 23 | switch (quantifier) { | 23 | switch (quantifier) { |
1507 | 24 | case IdentTypes::QUANT_ONE: | 24 | case IdentTypes::QUANT_ONE: |
1508 | 25 | result = zorba::IdentTypes::QUANT_ONE; | 25 | result = zorba::IdentTypes::QUANT_ONE; |
1509 | @@ -44,7 +44,7 @@ | |||
1510 | 44 | IdentTypes::Kind TypeIdentifier::getKind() | 44 | IdentTypes::Kind TypeIdentifier::getKind() |
1511 | 45 | { | 45 | { |
1512 | 46 | zorba::IdentTypes::kind_t lKind = theTypeIdentifier->getKind(); | 46 | zorba::IdentTypes::kind_t lKind = theTypeIdentifier->getKind(); |
1514 | 47 | IdentTypes::Kind result; | 47 | IdentTypes::Kind result = IdentTypes::ANY_NODE_TYPE; |
1515 | 48 | switch (lKind) { | 48 | switch (lKind) { |
1516 | 49 | case zorba::IdentTypes::NAMED_TYPE: | 49 | case zorba::IdentTypes::NAMED_TYPE: |
1517 | 50 | result = IdentTypes::NAMED_TYPE; | 50 | result = IdentTypes::NAMED_TYPE; |
1518 | @@ -92,7 +92,7 @@ | |||
1519 | 92 | IdentTypes::Quantifier TypeIdentifier::getQuantifier() | 92 | IdentTypes::Quantifier TypeIdentifier::getQuantifier() |
1520 | 93 | { | 93 | { |
1521 | 94 | zorba::IdentTypes::quantifier_t lQuantifier = theTypeIdentifier->getQuantifier(); | 94 | zorba::IdentTypes::quantifier_t lQuantifier = theTypeIdentifier->getQuantifier(); |
1523 | 95 | IdentTypes::Quantifier result; | 95 | IdentTypes::Quantifier result = IdentTypes::QUANT_ONE; |
1524 | 96 | switch (lQuantifier) { | 96 | switch (lQuantifier) { |
1525 | 97 | case zorba::IdentTypes::QUANT_ONE: | 97 | case zorba::IdentTypes::QUANT_ONE: |
1526 | 98 | result = IdentTypes::QUANT_ONE; | 98 | result = IdentTypes::QUANT_ONE; |
1527 | 99 | 99 | ||
1528 | === modified file 'swig/ZorbaStreamBuffer.i' | |||
1529 | --- swig/ZorbaStreamBuffer.i 2012-09-06 23:54:47 +0000 | |||
1530 | +++ swig/ZorbaStreamBuffer.i 2013-03-27 00:40:33 +0000 | |||
1531 | @@ -82,7 +82,7 @@ | |||
1532 | 82 | 82 | ||
1533 | 83 | std::streamsize ZorbaStreamBuffer::xsputn ( const char * BYTE, std::streamsize len ) { | 83 | std::streamsize ZorbaStreamBuffer::xsputn ( const char * BYTE, std::streamsize len ) { |
1534 | 84 | // Wrapping to virtual function | 84 | // Wrapping to virtual function |
1536 | 85 | streamWrapper->write(BYTE, len); | 85 | streamWrapper->write(BYTE, static_cast<size_t>(len)); |
1537 | 86 | return len; | 86 | return len; |
1538 | 87 | } | 87 | } |
1539 | 88 | 88 | ||
1540 | 89 | 89 | ||
1541 | === modified file 'swig/csharp/tests/CMakeLists.txt' | |||
1542 | --- swig/csharp/tests/CMakeLists.txt 2012-07-27 22:56:27 +0000 | |||
1543 | +++ swig/csharp/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000 | |||
1544 | @@ -21,6 +21,8 @@ | |||
1545 | 21 | STRING(REGEX REPLACE "/" "\\\\" CSharpPath "${CSharpPath}") | 21 | STRING(REGEX REPLACE "/" "\\\\" CSharpPath "${CSharpPath}") |
1546 | 22 | STRING(REGEX REPLACE "/" "\\\\" CSharpBuildPath "${CSharpBuildPath}") | 22 | STRING(REGEX REPLACE "/" "\\\\" CSharpBuildPath "${CSharpBuildPath}") |
1547 | 23 | 23 | ||
1548 | 24 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY) | ||
1549 | 25 | |||
1550 | 24 | FILE(GLOB CSHARP_EXAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.in") | 26 | FILE(GLOB CSHARP_EXAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.in") |
1551 | 25 | FOREACH(CSHARP_EXAMPLE ${CSHARP_EXAMPLES}) | 27 | FOREACH(CSHARP_EXAMPLE ${CSHARP_EXAMPLES}) |
1552 | 26 | STRING(REPLACE ".in" "" CSHARP_EXAMPLE_DEST ${CSHARP_EXAMPLE}) | 28 | STRING(REPLACE ".in" "" CSHARP_EXAMPLE_DEST ${CSHARP_EXAMPLE}) |
1553 | 27 | 29 | ||
1554 | === added file 'swig/csharp/tests/satellites.json' | |||
1555 | --- swig/csharp/tests/satellites.json 1970-01-01 00:00:00 +0000 | |||
1556 | +++ swig/csharp/tests/satellites.json 2013-03-27 00:40:33 +0000 | |||
1557 | @@ -0,0 +1,17 @@ | |||
1558 | 1 | { | ||
1559 | 2 | "creator" : "Satellites plugin version 0.6.4", | ||
1560 | 3 | "satellites" : { | ||
1561 | 4 | "AAU CUBESAT" : { | ||
1562 | 5 | "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768", | ||
1563 | 6 | "visible" : false | ||
1564 | 7 | }, | ||
1565 | 8 | "AJISAI (EGS)" : { | ||
1566 | 9 | "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696", | ||
1567 | 10 | "visible" : true | ||
1568 | 11 | }, | ||
1569 | 12 | "AKARI (ASTRO-F)" : { | ||
1570 | 13 | "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294", | ||
1571 | 14 | "visible" : true | ||
1572 | 15 | } | ||
1573 | 16 | } | ||
1574 | 17 | } | ||
1575 | 0 | 18 | ||
1576 | === modified file 'swig/csharp/tests/test01.cs' | |||
1577 | --- swig/csharp/tests/test01.cs 2012-07-20 21:21:21 +0000 | |||
1578 | +++ swig/csharp/tests/test01.cs 2013-03-27 00:40:33 +0000 | |||
1579 | @@ -14,8 +14,6 @@ | |||
1580 | 14 | * limitations under the License. | 14 | * limitations under the License. |
1581 | 15 | */ | 15 | */ |
1582 | 16 | using System; | 16 | using System; |
1583 | 17 | using System.Collections.Generic; | ||
1584 | 18 | using System.Linq; | ||
1585 | 19 | using System.Text; | 17 | using System.Text; |
1586 | 20 | using org.zorbaxquery.api; | 18 | using org.zorbaxquery.api; |
1587 | 21 | 19 | ||
1588 | 22 | 20 | ||
1589 | === added file 'swig/csharp/tests/test09.cs' | |||
1590 | --- swig/csharp/tests/test09.cs 1970-01-01 00:00:00 +0000 | |||
1591 | +++ swig/csharp/tests/test09.cs 2013-03-27 00:40:33 +0000 | |||
1592 | @@ -0,0 +1,95 @@ | |||
1593 | 1 | /* | ||
1594 | 2 | * Copyright 2006-2012 The FLWOR Foundation. | ||
1595 | 3 | * | ||
1596 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
1597 | 5 | * you may not use this file except in compliance with the License. | ||
1598 | 6 | * You may obtain a copy of the License at | ||
1599 | 7 | * | ||
1600 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
1601 | 9 | * | ||
1602 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
1603 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
1604 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
1605 | 13 | * See the License for the specific language governing permissions and | ||
1606 | 14 | * limitations under the License. | ||
1607 | 15 | */ | ||
1608 | 16 | using System; | ||
1609 | 17 | using System.Text; | ||
1610 | 18 | using org.zorbaxquery.api; | ||
1611 | 19 | |||
1612 | 20 | namespace ZorbaApplication | ||
1613 | 21 | { | ||
1614 | 22 | |||
1615 | 23 | class MyDiagnosticHandler : DiagnosticHandler { | ||
1616 | 24 | public override void error(ZorbaException exception) { | ||
1617 | 25 | System.Console.WriteLine("Exception catched in MyDiagnosticHandler"); | ||
1618 | 26 | System.Console.WriteLine("Description: " + exception.getDescription()); | ||
1619 | 27 | } | ||
1620 | 28 | } | ||
1621 | 29 | |||
1622 | 30 | class Program | ||
1623 | 31 | { | ||
1624 | 32 | static String test(String query) { | ||
1625 | 33 | MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler(); | ||
1626 | 34 | |||
1627 | 35 | InMemoryStore store = InMemoryStore.getInstance(); | ||
1628 | 36 | Zorba zorba = Zorba.getInstance(store); | ||
1629 | 37 | |||
1630 | 38 | XQuery xquery = zorba.compileQuery(query, diagnosticHandler); | ||
1631 | 39 | |||
1632 | 40 | StringBuilder sbuilder = new StringBuilder(); | ||
1633 | 41 | sbuilder.Append(xquery.execute()); | ||
1634 | 42 | |||
1635 | 43 | xquery.destroy(); | ||
1636 | 44 | xquery.Dispose(); | ||
1637 | 45 | |||
1638 | 46 | zorba.shutdown(); | ||
1639 | 47 | InMemoryStore.shutdown(store); | ||
1640 | 48 | |||
1641 | 49 | return sbuilder.ToString(); | ||
1642 | 50 | } | ||
1643 | 51 | |||
1644 | 52 | static void Main(string[] args) | ||
1645 | 53 | { | ||
1646 | 54 | System.Console.WriteLine("Running: Compile query string using JSONiq"); | ||
1647 | 55 | |||
1648 | 56 | String query = @" | ||
1649 | 57 | let $sats:=jn:json-doc('@CSharpPath@/tests/satellites.json')('satellites') | ||
1650 | 58 | return { | ||
1651 | 59 | 'visible' : [ | ||
1652 | 60 | for $sat in jn:keys($sats) | ||
1653 | 61 | where $sats($sat)('visible') | ||
1654 | 62 | return $sat | ||
1655 | 63 | ], | ||
1656 | 64 | 'invisible' : [ | ||
1657 | 65 | for $sat in jn:keys($sats) | ||
1658 | 66 | where not($sats($sat)('visible')) | ||
1659 | 67 | return $sat | ||
1660 | 68 | ] | ||
1661 | 69 | } | ||
1662 | 70 | "; | ||
1663 | 71 | |||
1664 | 72 | String testResult = "{ \"visible\" : [ \"AJISAI (EGS)\", \"AKARI (ASTRO-F)\" ], \"invisible\" : [ \"AAU CUBESAT\" ] }"; | ||
1665 | 73 | System.Console.WriteLine("Query: " + query); | ||
1666 | 74 | String result; | ||
1667 | 75 | try { | ||
1668 | 76 | result = test(query); | ||
1669 | 77 | } catch(Exception e) { | ||
1670 | 78 | System.Console.WriteLine("Failed"); | ||
1671 | 79 | Console.WriteLine("{0} Exception caught.", e); | ||
1672 | 80 | return; | ||
1673 | 81 | } | ||
1674 | 82 | |||
1675 | 83 | System.Console.WriteLine("Expecting: " + testResult); | ||
1676 | 84 | System.Console.WriteLine("Result: " + result); | ||
1677 | 85 | |||
1678 | 86 | if (result.Equals(testResult)) { | ||
1679 | 87 | System.Console.WriteLine("Success"); | ||
1680 | 88 | } else { | ||
1681 | 89 | System.Console.WriteLine("Failed"); | ||
1682 | 90 | } | ||
1683 | 91 | |||
1684 | 92 | |||
1685 | 93 | } | ||
1686 | 94 | } | ||
1687 | 95 | } | ||
1688 | 0 | 96 | ||
1689 | === added file 'swig/csharp/tests/test10.cs' | |||
1690 | --- swig/csharp/tests/test10.cs 1970-01-01 00:00:00 +0000 | |||
1691 | +++ swig/csharp/tests/test10.cs 2013-03-27 00:40:33 +0000 | |||
1692 | @@ -0,0 +1,86 @@ | |||
1693 | 1 | /* | ||
1694 | 2 | * Copyright 2006-2012 The FLWOR Foundation. | ||
1695 | 3 | * | ||
1696 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
1697 | 5 | * you may not use this file except in compliance with the License. | ||
1698 | 6 | * You may obtain a copy of the License at | ||
1699 | 7 | * | ||
1700 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
1701 | 9 | * | ||
1702 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
1703 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
1704 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
1705 | 13 | * See the License for the specific language governing permissions and | ||
1706 | 14 | * limitations under the License. | ||
1707 | 15 | */ | ||
1708 | 16 | using System; | ||
1709 | 17 | using System.Text; | ||
1710 | 18 | using org.zorbaxquery.api; | ||
1711 | 19 | |||
1712 | 20 | namespace ZorbaApplication | ||
1713 | 21 | { | ||
1714 | 22 | |||
1715 | 23 | class MyDiagnosticHandler : DiagnosticHandler { | ||
1716 | 24 | public override void error(ZorbaException exception) { | ||
1717 | 25 | System.Console.WriteLine("Exception catched in MyDiagnosticHandler"); | ||
1718 | 26 | System.Console.WriteLine("Description: " + exception.getDescription()); | ||
1719 | 27 | } | ||
1720 | 28 | } | ||
1721 | 29 | |||
1722 | 30 | class Program | ||
1723 | 31 | { | ||
1724 | 32 | static String test() { | ||
1725 | 33 | MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler(); | ||
1726 | 34 | |||
1727 | 35 | InMemoryStore store = InMemoryStore.getInstance(); | ||
1728 | 36 | Zorba zorba = Zorba.getInstance(store); | ||
1729 | 37 | |||
1730 | 38 | ItemFactory itemFactory = zorba.getItemFactory(); | ||
1731 | 39 | Item iNull = itemFactory.createJSONNull(); | ||
1732 | 40 | System.Console.WriteLine( "Creating JSON Item null: " + iNull.serialize()); | ||
1733 | 41 | iNull.Dispose(); | ||
1734 | 42 | |||
1735 | 43 | Item iNumber = itemFactory.createJSONNumber("5"); | ||
1736 | 44 | System.Console.WriteLine( "Creating JSON Item number: " + iNumber.serialize() ); | ||
1737 | 45 | iNumber.Dispose(); | ||
1738 | 46 | |||
1739 | 47 | StringVector sv = new StringVector(); | ||
1740 | 48 | sv.Add("Hello"); | ||
1741 | 49 | sv.Add("Zorba"); | ||
1742 | 50 | sv.Add("Hello"); | ||
1743 | 51 | sv.Add("Zorba"); | ||
1744 | 52 | Item iArray = itemFactory.createJSONArray(sv); | ||
1745 | 53 | sv.Dispose(); | ||
1746 | 54 | System.Console.WriteLine( "Creating JSON Item array: " + iArray.serialize() ); | ||
1747 | 55 | iArray.Dispose(); | ||
1748 | 56 | |||
1749 | 57 | zorba.shutdown(); | ||
1750 | 58 | InMemoryStore.shutdown(store); | ||
1751 | 59 | |||
1752 | 60 | return "ok"; | ||
1753 | 61 | } | ||
1754 | 62 | |||
1755 | 63 | static void Main(string[] args) | ||
1756 | 64 | { | ||
1757 | 65 | System.Console.WriteLine("Running: Compile query string using Diagnostic Handler"); | ||
1758 | 66 | |||
1759 | 67 | String testResult = "ok"; | ||
1760 | 68 | String result; | ||
1761 | 69 | try { | ||
1762 | 70 | result = test(); | ||
1763 | 71 | } catch(Exception e) { | ||
1764 | 72 | System.Console.WriteLine("Failed"); | ||
1765 | 73 | Console.WriteLine("{0} Exception caught.", e); | ||
1766 | 74 | return; | ||
1767 | 75 | } | ||
1768 | 76 | |||
1769 | 77 | if (result.Equals(testResult)) { | ||
1770 | 78 | System.Console.WriteLine("Success"); | ||
1771 | 79 | } else { | ||
1772 | 80 | System.Console.WriteLine("Failed"); | ||
1773 | 81 | } | ||
1774 | 82 | |||
1775 | 83 | |||
1776 | 84 | } | ||
1777 | 85 | } | ||
1778 | 86 | } | ||
1779 | 0 | 87 | ||
1780 | === modified file 'swig/java/CMakeLists.txt' | |||
1781 | --- swig/java/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
1782 | +++ swig/java/CMakeLists.txt 2013-03-27 00:40:33 +0000 | |||
1783 | @@ -32,21 +32,21 @@ | |||
1784 | 32 | 32 | ||
1785 | 33 | SET( CMAKE_SWIG_FLAGS -package org.zorbaxquery.api) | 33 | SET( CMAKE_SWIG_FLAGS -package org.zorbaxquery.api) |
1786 | 34 | 34 | ||
1789 | 35 | SWIG_ADD_MODULE( lib_zorba_java_api java zorba_api.i ) | 35 | SWIG_ADD_MODULE( zorba_api_java java zorba_api.i ) |
1790 | 36 | SWIG_LINK_LIBRARIES( lib_zorba_java_api zorba_simplestore ${JAVA_LIBRARY} ) | 36 | SWIG_LINK_LIBRARIES( zorba_api_java zorba_simplestore ${JAVA_LIBRARY} ) |
1791 | 37 | IF (WIN32) | 37 | IF (WIN32) |
1793 | 38 | SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES PROJECT_LABEL "Java" OUTPUT_NAME "zorba_api" FOLDER "APIs") | 38 | SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES PROJECT_LABEL "Java" OUTPUT_NAME "zorba_api" FOLDER "APIs") |
1794 | 39 | ELSE (WIN32) | 39 | ELSE (WIN32) |
1796 | 40 | SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES OUTPUT_NAME "libzorba_api") | 40 | SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES OUTPUT_NAME "libzorba_api") |
1797 | 41 | ENDIF (WIN32) | 41 | ENDIF (WIN32) |
1798 | 42 | IF ( APPLE ) | 42 | IF ( APPLE ) |
1800 | 43 | SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES SUFFIX .jnilib ) | 43 | SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES SUFFIX .jnilib ) |
1801 | 44 | ENDIF ( APPLE ) | 44 | ENDIF ( APPLE ) |
1802 | 45 | 45 | ||
1803 | 46 | # The following fix was added because of the changes in CMake 2.8, which have the | 46 | # The following fix was added because of the changes in CMake 2.8, which have the |
1804 | 47 | # result of naming the java binding library "liblibzorba_api.so" instead of "libzorba_api.so" | 47 | # result of naming the java binding library "liblibzorba_api.so" instead of "libzorba_api.so" |
1805 | 48 | IF (LINUX OR CYGWIN OR APPLE) | 48 | IF (LINUX OR CYGWIN OR APPLE) |
1807 | 49 | SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES PREFIX "" ) | 49 | SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES PREFIX "" ) |
1808 | 50 | ENDIF (LINUX OR CYGWIN OR APPLE) | 50 | ENDIF (LINUX OR CYGWIN OR APPLE) |
1809 | 51 | 51 | ||
1810 | 52 | FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h") | 52 | FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h") |
1811 | @@ -60,7 +60,7 @@ | |||
1812 | 60 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_JAVA_EXTRA}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_JAVA_EXTRA}") | 60 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_JAVA_EXTRA}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_JAVA_EXTRA}") |
1813 | 61 | ENDFOREACH(ZORBA_JAVA_EXTRA ${ZORBA_JAVA_EXTRAS}) | 61 | ENDFOREACH(ZORBA_JAVA_EXTRA ${ZORBA_JAVA_EXTRAS}) |
1814 | 62 | 62 | ||
1816 | 63 | ADD_CUSTOM_COMMAND(TARGET lib_zorba_java_api | 63 | ADD_CUSTOM_COMMAND(TARGET zorba_api_java |
1817 | 64 | POST_BUILD | 64 | POST_BUILD |
1818 | 65 | COMMAND cmake -E echo "Compiling Java files..." | 65 | COMMAND cmake -E echo "Compiling Java files..." |
1819 | 66 | COMMAND ${Java_JAVAC_EXECUTABLE} *.java -d ${CMAKE_CURRENT_BINARY_DIR} | 66 | COMMAND ${Java_JAVAC_EXECUTABLE} *.java -d ${CMAKE_CURRENT_BINARY_DIR} |
1820 | @@ -79,12 +79,12 @@ | |||
1821 | 79 | 79 | ||
1822 | 80 | IF ( APPLE ) | 80 | IF ( APPLE ) |
1823 | 81 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}libzorba_api.jnilib DESTINATION ${JAVA_SITEARCH_DIR}) | 81 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}libzorba_api.jnilib DESTINATION ${JAVA_SITEARCH_DIR}) |
1825 | 82 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR}) | 82 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR}) |
1826 | 83 | ELSE ( APPLE ) | 83 | ELSE ( APPLE ) |
1828 | 84 | IF(NOT WIN32) | 84 | IF(NOT WIN32) |
1829 | 85 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzorba_api.so DESTINATION ${JAVA_SITEARCH_DIR}) | 85 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzorba_api.so DESTINATION ${JAVA_SITEARCH_DIR}) |
1832 | 86 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR}) | 86 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR}) |
1833 | 87 | ELSE(NOT WIN32) | 87 | ELSE(NOT WIN32) |
1834 | 88 | IF (MSVC_IDE) | 88 | IF (MSVC_IDE) |
1835 | 89 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/zorba_api.dll | 89 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/zorba_api.dll |
1836 | 90 | DESTINATION share/java | 90 | DESTINATION share/java |
1837 | @@ -100,7 +100,7 @@ | |||
1838 | 100 | DESTINATION share/java | 100 | DESTINATION share/java |
1839 | 101 | COMPONENT "java_swig") | 101 | COMPONENT "java_swig") |
1840 | 102 | ENDIF (MSVC_IDE) | 102 | ENDIF (MSVC_IDE) |
1842 | 103 | ENDIF(NOT WIN32) | 103 | ENDIF(NOT WIN32) |
1843 | 104 | ENDIF ( APPLE ) | 104 | ENDIF ( APPLE ) |
1844 | 105 | 105 | ||
1845 | 106 | 106 | ||
1846 | 107 | 107 | ||
1847 | === modified file 'swig/php/CMakeLists.txt' | |||
1848 | --- swig/php/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
1849 | +++ swig/php/CMakeLists.txt 2013-03-27 00:40:33 +0000 | |||
1850 | @@ -24,25 +24,32 @@ | |||
1851 | 24 | ADD_DEFINITIONS(-DZEND_WIN32 -DPHP_WIN32 -DZEND_INCLUDE_FULL_WINDOWS_HEADERS -DZEND_DEBUG=0 -DZTS=1) | 24 | ADD_DEFINITIONS(-DZEND_WIN32 -DPHP_WIN32 -DZEND_INCLUDE_FULL_WINDOWS_HEADERS -DZEND_DEBUG=0 -DZTS=1) |
1852 | 25 | ENDIF (WIN32) | 25 | ENDIF (WIN32) |
1853 | 26 | 26 | ||
1855 | 27 | SWIG_ADD_MODULE (zorba_api php5 zorba_api.i) | 27 | SWIG_ADD_MODULE (zorba_api_php php5 zorba_api.i) |
1856 | 28 | 28 | ||
1857 | 29 | IF (APPLE) | 29 | IF (APPLE) |
1859 | 30 | SWIG_LINK_LIBRARIES (zorba_api zorba_simplestore ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) | 30 | SWIG_LINK_LIBRARIES (zorba_api_php zorba_simplestore ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) |
1860 | 31 | ELSE (APPLE) | 31 | ELSE (APPLE) |
1862 | 32 | SWIG_LINK_LIBRARIES (zorba_api zorba_simplestore) | 32 | SWIG_LINK_LIBRARIES (zorba_api_php zorba_simplestore) |
1863 | 33 | ENDIF (APPLE) | 33 | ENDIF (APPLE) |
1864 | 34 | 34 | ||
1865 | 35 | #fix for library path, using windows backslash causes error | ||
1866 | 35 | IF (WIN32) | 36 | IF (WIN32) |
1867 | 36 | STRING(REGEX REPLACE "\\\\" "/" PHP5_LIBRARY "${PHP5_LIBRARY}") | 37 | STRING(REGEX REPLACE "\\\\" "/" PHP5_LIBRARY "${PHP5_LIBRARY}") |
1869 | 37 | SWIG_LINK_LIBRARIES (zorba_api ${PHP5_LIBRARY}) | 38 | SWIG_LINK_LIBRARIES (zorba_api_php ${PHP5_LIBRARY}) |
1870 | 38 | ENDIF (WIN32) | 39 | ENDIF (WIN32) |
1871 | 39 | 40 | ||
1872 | 40 | #Copy test to the build folder | 41 | #Copy test to the build folder |
1873 | 41 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/test.xq" "${CMAKE_CURRENT_BINARY_DIR}/test.xq" COPYONLY) | 42 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/test.xq" "${CMAKE_CURRENT_BINARY_DIR}/test.xq" COPYONLY) |
1874 | 42 | 43 | ||
1876 | 43 | #Copy | 44 | #Copy alternate files |
1877 | 44 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/XQueryProcessor.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php" COPYONLY) | 45 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/XQueryProcessor.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php" COPYONLY) |
1879 | 45 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/zorba_api_wrapper.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php" COPYONLY) | 46 | #fix for swig error with wrapper name |
1880 | 47 | ADD_CUSTOM_COMMAND( | ||
1881 | 48 | TARGET zorba_api_php | ||
1882 | 49 | POST_BUILD | ||
1883 | 50 | COMMAND cmake -E echo "Fixing PHP wrapper..." | ||
1884 | 51 | COMMAND cmake -P "${CMAKE_CURRENT_SOURCE_DIR}/postfix.cmake" | ||
1885 | 52 | ) | ||
1886 | 46 | 53 | ||
1887 | 47 | FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h") | 54 | FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h") |
1888 | 48 | FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS}) | 55 | FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS}) |
1889 | @@ -51,10 +58,14 @@ | |||
1890 | 51 | 58 | ||
1891 | 52 | # The following fix was added because of the changes in CMake 2.8, which have the | 59 | # The following fix was added because of the changes in CMake 2.8, which have the |
1892 | 53 | # result of naming the java binding library "liblibzorba_api.so" instead of "libzorba_api.so" | 60 | # result of naming the java binding library "liblibzorba_api.so" instead of "libzorba_api.so" |
1893 | 54 | SET_TARGET_PROPERTIES( ${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PROJECT_LABEL "PHP" FOLDER "APIs") | ||
1894 | 55 | IF (LINUX OR CYGWIN OR APPLE) | 61 | IF (LINUX OR CYGWIN OR APPLE) |
1895 | 56 | SET_TARGET_PROPERTIES (${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "") | 62 | SET_TARGET_PROPERTIES (${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "") |
1896 | 57 | ENDIF (LINUX OR CYGWIN OR APPLE) | 63 | ENDIF (LINUX OR CYGWIN OR APPLE) |
1897 | 64 | |||
1898 | 65 | #set project folder location for IDEs | ||
1899 | 66 | SET_TARGET_PROPERTIES(zorba_api_php PROPERTIES PROJECT_LABEL "PHP" FOLDER "APIs") | ||
1900 | 67 | |||
1901 | 68 | SET_TARGET_PROPERTIES(zorba_api_php PROPERTIES OUTPUT_NAME "zorba_api") | ||
1902 | 58 | 69 | ||
1903 | 59 | IF (NOT WIN32 OR CYGWIN) | 70 | IF (NOT WIN32 OR CYGWIN) |
1904 | 60 | STRING (REPLACE ${CMAKE_INSTALL_PREFIX} "" PHP5_INSTALL_PATH ${PHP5_EXTENSION_DIR}) | 71 | STRING (REPLACE ${CMAKE_INSTALL_PREFIX} "" PHP5_INSTALL_PATH ${PHP5_EXTENSION_DIR}) |
1905 | @@ -67,7 +78,7 @@ | |||
1906 | 67 | ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}zorba_api.so | 78 | ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}zorba_api.so |
1907 | 68 | DESTINATION ${PHP5_INSTALL_PATH} | 79 | DESTINATION ${PHP5_INSTALL_PATH} |
1908 | 69 | ) | 80 | ) |
1910 | 70 | ELSE (NOT WIN32 OR CYGWIN) | 81 | ELSE (NOT WIN32 OR CYGWIN) |
1911 | 71 | IF (MSVC_IDE) | 82 | IF (MSVC_IDE) |
1912 | 72 | INSTALL ( FILES | 83 | INSTALL ( FILES |
1913 | 73 | ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php | 84 | ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php |
1914 | @@ -79,7 +90,7 @@ | |||
1915 | 79 | INSTALL ( FILES | 90 | INSTALL ( FILES |
1916 | 80 | ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php | 91 | ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php |
1917 | 81 | ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php | 92 | ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php |
1919 | 82 | ${CMAKE_CURRENT_BINARY_DIR}/php_zorba_api.dll | 93 | ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.dll |
1920 | 83 | COMPONENT "php_swig" | 94 | COMPONENT "php_swig" |
1921 | 84 | DESTINATION share/php ) | 95 | DESTINATION share/php ) |
1922 | 85 | ENDIF (MSVC_IDE) | 96 | ENDIF (MSVC_IDE) |
1923 | 86 | 97 | ||
1924 | === modified file 'swig/php/XQueryProcessor.php' | |||
1925 | --- swig/php/XQueryProcessor.php 2012-01-17 13:30:49 +0000 | |||
1926 | +++ swig/php/XQueryProcessor.php 2013-03-27 00:40:33 +0000 | |||
1927 | @@ -1,5 +1,5 @@ | |||
1928 | 1 | <?php | 1 | <?php |
1930 | 2 | require_once 'Zorba/zorba_api_wrapper.php'; | 2 | require_once 'zorba_api_wrapper.php'; |
1931 | 3 | 3 | ||
1932 | 4 | class XQueryCompilerException extends Exception{} | 4 | class XQueryCompilerException extends Exception{} |
1933 | 5 | class XQueryProcessorException extends Exception{} | 5 | class XQueryProcessorException extends Exception{} |
1934 | 6 | 6 | ||
1935 | === added file 'swig/php/postfix.cmake' | |||
1936 | --- swig/php/postfix.cmake 1970-01-01 00:00:00 +0000 | |||
1937 | +++ swig/php/postfix.cmake 2013-03-27 00:40:33 +0000 | |||
1938 | @@ -0,0 +1,8 @@ | |||
1939 | 1 | |||
1940 | 2 | FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" FILE_CONTENT) | ||
1941 | 3 | STRING(REGEX REPLACE "php_zorba_api.dll" "zorba_api.dll" MODIFIED_FILE_CONTENT "${FILE_CONTENT}") | ||
1942 | 4 | STRING(REGEX REPLACE "zorba_api.so" "libzorba_api.so" MODIFIED_FILE_CONTENT "${MODIFIED_FILE_CONTENT}") | ||
1943 | 5 | STRING(REGEX REPLACE "'zorba_api.'" "'libzorba_api.'" MODIFIED_FILE_CONTENT "${MODIFIED_FILE_CONTENT}") | ||
1944 | 6 | FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" "${MODIFIED_FILE_CONTENT}") | ||
1945 | 7 | |||
1946 | 8 | CONFIGURE_FILE("${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php" COPYONLY) | ||
1947 | 0 | 9 | ||
1948 | === modified file 'swig/php/tests/CMakeLists.txt' | |||
1949 | --- swig/php/tests/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
1950 | +++ swig/php/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000 | |||
1951 | @@ -1,4 +1,4 @@ | |||
1953 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | 1 | # Copyright 2006-2013 The FLWOR Foundation. |
1954 | 2 | # | 2 | # |
1955 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
1956 | 4 | # you may not use this file except in compliance with the License. | 4 | # you may not use this file except in compliance with the License. |
1957 | @@ -18,69 +18,29 @@ | |||
1958 | 18 | ELSE (MSVC_IDE) | 18 | ELSE (MSVC_IDE) |
1959 | 19 | SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php) | 19 | SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php) |
1960 | 20 | ENDIF (MSVC_IDE) | 20 | ENDIF (MSVC_IDE) |
1962 | 21 | SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php) | 21 | SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php/Zorba) |
1963 | 22 | |||
1964 | 23 | IF (WIN32) | ||
1965 | 24 | STRING(REGEX REPLACE "/" "\\\\" phpExtensionPath "${phpExtensionPath}") | ||
1966 | 25 | STRING(REGEX REPLACE "/" "\\\\" phpPath "${phpPath}") | ||
1967 | 26 | STRING(REGEX REPLACE "/" "\\\\" phpIncludePath "${phpIncludePath}") | ||
1968 | 27 | ENDIF (WIN32) | ||
1969 | 22 | 28 | ||
1970 | 23 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini) | 29 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini) |
1971 | 24 | |||
1972 | 25 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY) | 30 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY) |
2034 | 26 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY) | 31 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY) |
2035 | 27 | 32 | ||
2036 | 28 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.php ${CMAKE_CURRENT_BINARY_DIR}/test01.php) | 33 | #copy tests |
2037 | 29 | ADD_TEST("php_test01" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test01.php) | 34 | FILE(GLOB ZORBA_PHP_TESTS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.php") |
2038 | 30 | SET_TESTS_PROPERTIES("php_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 35 | FOREACH(ZORBA_PHP_TEST ${ZORBA_PHP_TESTS}) |
2039 | 31 | 36 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_PHP_TEST}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_PHP_TEST}") | |
2040 | 32 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.php ${CMAKE_CURRENT_BINARY_DIR}/test02.php) | 37 | STRING(REGEX REPLACE ".php" "" ZORBA_PHP_TEST_NAME "${ZORBA_PHP_TEST}") |
2041 | 33 | ADD_TEST("php_test02" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test02.php) | 38 | ADD_TEST("php_${ZORBA_PHP_TEST_NAME}" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${ZORBA_PHP_TEST}) |
2042 | 34 | SET_TESTS_PROPERTIES("php_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 39 | SET_TESTS_PROPERTIES("php_${ZORBA_PHP_TEST_NAME}" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
2043 | 35 | 40 | ENDFOREACH(ZORBA_PHP_TEST ${ZORBA_PHP_TESTS}) | |
2044 | 36 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.php ${CMAKE_CURRENT_BINARY_DIR}/test03.php) | 41 | |
2045 | 37 | #ADD_TEST("php_test03" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test03.php) | 42 | #copy additional .xq files |
2046 | 38 | #SET_TESTS_PROPERTIES("php_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 43 | FILE(GLOB ZORBA_PHP_XQS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.xq") |
2047 | 39 | 44 | FOREACH(ZORBA_PHP_XQ ${ZORBA_PHP_XQS}) | |
2048 | 40 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.php ${CMAKE_CURRENT_BINARY_DIR}/test04.php) | 45 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_PHP_XQ}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_PHP_XQ}" COPYONLY) |
2049 | 41 | ADD_TEST("php_test04" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test04.php) | 46 | ENDFOREACH(ZORBA_PHP_XQ ${ZORBA_PHP_XQS}) |
1989 | 42 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY) | ||
1990 | 43 | SET_TESTS_PROPERTIES("php_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
1991 | 44 | |||
1992 | 45 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.php ${CMAKE_CURRENT_BINARY_DIR}/test05.php) | ||
1993 | 46 | ADD_TEST("php_test05" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test05.php) | ||
1994 | 47 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY) | ||
1995 | 48 | SET_TESTS_PROPERTIES("php_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
1996 | 49 | |||
1997 | 50 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.php ${CMAKE_CURRENT_BINARY_DIR}/test06.php) | ||
1998 | 51 | ADD_TEST("php_test06" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test06.php) | ||
1999 | 52 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY) | ||
2000 | 53 | SET_TESTS_PROPERTIES("php_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2001 | 54 | |||
2002 | 55 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.php ${CMAKE_CURRENT_BINARY_DIR}/test07.php) | ||
2003 | 56 | ADD_TEST("php_test07" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test07.php) | ||
2004 | 57 | SET_TESTS_PROPERTIES("php_test07" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2005 | 58 | |||
2006 | 59 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.php ${CMAKE_CURRENT_BINARY_DIR}/test08.php) | ||
2007 | 60 | ADD_TEST("php_test08" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test08.php) | ||
2008 | 61 | SET_TESTS_PROPERTIES("php_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2009 | 62 | |||
2010 | 63 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test09.php ${CMAKE_CURRENT_BINARY_DIR}/test09.php) | ||
2011 | 64 | #ADD_TEST("php_test09" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test09.php) | ||
2012 | 65 | #SET_TESTS_PROPERTIES("php_test09" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2013 | 66 | |||
2014 | 67 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.php ${CMAKE_CURRENT_BINARY_DIR}/test10.php) | ||
2015 | 68 | ADD_TEST("php_test10" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test10.php) | ||
2016 | 69 | SET_TESTS_PROPERTIES("php_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2017 | 70 | |||
2018 | 71 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.php ${CMAKE_CURRENT_BINARY_DIR}/test11.php) | ||
2019 | 72 | #ADD_TEST("php_test11" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test11.php) | ||
2020 | 73 | #SET_TESTS_PROPERTIES("php_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2021 | 74 | |||
2022 | 75 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.php ${CMAKE_CURRENT_BINARY_DIR}/test12.php) | ||
2023 | 76 | #ADD_TEST("php_test12" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test12.php) | ||
2024 | 77 | #SET_TESTS_PROPERTIES("php_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2025 | 78 | |||
2026 | 79 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.php ${CMAKE_CURRENT_BINARY_DIR}/test13.php) | ||
2027 | 80 | #ADD_TEST("php_test13" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test13.php) | ||
2028 | 81 | #SET_TESTS_PROPERTIES("php_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2029 | 82 | |||
2030 | 83 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.php ${CMAKE_CURRENT_BINARY_DIR}/test14.php) | ||
2031 | 84 | #ADD_TEST("php_test14" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test14.php) | ||
2032 | 85 | #SET_TESTS_PROPERTIES("php_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | ||
2033 | 86 | |||
2050 | 87 | 47 | ||
2051 | === modified file 'swig/php/tests/php.ini.in' | |||
2052 | --- swig/php/tests/php.ini.in 2012-03-27 00:56:11 +0000 | |||
2053 | +++ swig/php/tests/php.ini.in 2013-03-27 00:40:33 +0000 | |||
2054 | @@ -1,3 +1,3 @@ | |||
2055 | 1 | enable_dl=On | 1 | enable_dl=On |
2056 | 2 | extension_dir=@phpExtensionPath@ | 2 | extension_dir=@phpExtensionPath@ |
2057 | 3 | include_path=".:@phpIncludePath@" | ||
2058 | 4 | \ No newline at end of file | 3 | \ No newline at end of file |
2059 | 4 | include_path="@phpIncludePath@" | ||
2060 | 5 | \ No newline at end of file | 5 | \ No newline at end of file |
2061 | 6 | 6 | ||
2062 | === added file 'swig/php/tests/satellites.json' | |||
2063 | --- swig/php/tests/satellites.json 1970-01-01 00:00:00 +0000 | |||
2064 | +++ swig/php/tests/satellites.json 2013-03-27 00:40:33 +0000 | |||
2065 | @@ -0,0 +1,17 @@ | |||
2066 | 1 | { | ||
2067 | 2 | "creator" : "Satellites plugin version 0.6.4", | ||
2068 | 3 | "satellites" : { | ||
2069 | 4 | "AAU CUBESAT" : { | ||
2070 | 5 | "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768", | ||
2071 | 6 | "visible" : false | ||
2072 | 7 | }, | ||
2073 | 8 | "AJISAI (EGS)" : { | ||
2074 | 9 | "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696", | ||
2075 | 10 | "visible" : true | ||
2076 | 11 | }, | ||
2077 | 12 | "AKARI (ASTRO-F)" : { | ||
2078 | 13 | "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294", | ||
2079 | 14 | "visible" : true | ||
2080 | 15 | } | ||
2081 | 16 | } | ||
2082 | 17 | } | ||
2083 | 0 | 18 | ||
2084 | === modified file 'swig/php/tests/test01.php' | |||
2085 | --- swig/php/tests/test01.php 2012-03-27 00:56:11 +0000 | |||
2086 | +++ swig/php/tests/test01.php 2013-03-27 00:40:33 +0000 | |||
2087 | @@ -15,7 +15,7 @@ | |||
2088 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2089 | 16 | */ | 16 | */ |
2090 | 17 | 17 | ||
2092 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2093 | 19 | 19 | ||
2094 | 20 | print "Running: Get zorba instance and shutdown\n"; | 20 | print "Running: Get zorba instance and shutdown\n"; |
2095 | 21 | 21 | ||
2096 | 22 | 22 | ||
2097 | === modified file 'swig/php/tests/test02.php' | |||
2098 | --- swig/php/tests/test02.php 2012-03-27 00:56:11 +0000 | |||
2099 | +++ swig/php/tests/test02.php 2013-03-27 00:40:33 +0000 | |||
2100 | @@ -15,7 +15,7 @@ | |||
2101 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2102 | 16 | */ | 16 | */ |
2103 | 17 | 17 | ||
2105 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2106 | 19 | 19 | ||
2107 | 20 | function test(Zorba $aZorba) { | 20 | function test(Zorba $aZorba) { |
2108 | 21 | $lQuery = $aZorba->compileQuery("(1,2,3,4,5)"); | 21 | $lQuery = $aZorba->compileQuery("(1,2,3,4,5)"); |
2109 | 22 | 22 | ||
2110 | === removed file 'swig/php/tests/test03.php' | |||
2111 | --- swig/php/tests/test03.php 2012-03-27 00:56:11 +0000 | |||
2112 | +++ swig/php/tests/test03.php 1970-01-01 00:00:00 +0000 | |||
2113 | @@ -1,48 +0,0 @@ | |||
2114 | 1 | <? | ||
2115 | 2 | /* | ||
2116 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | ||
2117 | 4 | * | ||
2118 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
2119 | 6 | * you may not use this file except in compliance with the License. | ||
2120 | 7 | * You may obtain a copy of the License at | ||
2121 | 8 | * | ||
2122 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
2123 | 10 | * | ||
2124 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
2125 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
2126 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2127 | 14 | * See the License for the specific language governing permissions and | ||
2128 | 15 | * limitations under the License. | ||
2129 | 16 | */ | ||
2130 | 17 | |||
2131 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | ||
2132 | 19 | |||
2133 | 20 | class MyDiagnosticHandler(DiagnosticHandler handler) { | ||
2134 | 21 | funtion error(self, *args) { | ||
2135 | 22 | print "Error args: ", args; | ||
2136 | 23 | } | ||
2137 | 24 | } | ||
2138 | 25 | |||
2139 | 26 | function test(Zorba $aZorba) | ||
2140 | 27 | { | ||
2141 | 28 | diagnosticHandler = MyDiagnosticHandler() | ||
2142 | 29 | try { | ||
2143 | 30 | xquery = zorba.compileQuery("1 div 0", diagnosticHandler); | ||
2144 | 31 | print xquery.execute() | ||
2145 | 32 | } catch (Exception e) { | ||
2146 | 33 | print "Caught error: "; | ||
2147 | 34 | } | ||
2148 | 35 | return | ||
2149 | 36 | } | ||
2150 | 37 | |||
2151 | 38 | $store = InMemoryStore::getInstance(); | ||
2152 | 39 | $zorba = Zorba::getInstance($store); | ||
2153 | 40 | |||
2154 | 41 | print "Running: Compile query string using Diagnostic Handler" | ||
2155 | 42 | test($zorba); | ||
2156 | 43 | print "Success"; | ||
2157 | 44 | |||
2158 | 45 | $zorba->shutdown(); | ||
2159 | 46 | InMemoryStore::shutdown($store); | ||
2160 | 47 | |||
2161 | 48 | ?> | ||
2162 | 49 | \ No newline at end of file | 0 | \ No newline at end of file |
2163 | 50 | 1 | ||
2164 | === added file 'swig/php/tests/test03.php.disabled' | |||
2165 | --- swig/php/tests/test03.php.disabled 1970-01-01 00:00:00 +0000 | |||
2166 | +++ swig/php/tests/test03.php.disabled 2013-03-27 00:40:33 +0000 | |||
2167 | @@ -0,0 +1,52 @@ | |||
2168 | 1 | <? | ||
2169 | 2 | /* | ||
2170 | 3 | * Copyright 2006-2013 The FLWOR Foundation. | ||
2171 | 4 | * | ||
2172 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
2173 | 6 | * you may not use this file except in compliance with the License. | ||
2174 | 7 | * You may obtain a copy of the License at | ||
2175 | 8 | * | ||
2176 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
2177 | 10 | * | ||
2178 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
2179 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
2180 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2181 | 14 | * See the License for the specific language governing permissions and | ||
2182 | 15 | * limitations under the License. | ||
2183 | 16 | */ | ||
2184 | 17 | |||
2185 | 18 | require 'zorba_api_wrapper.php'; | ||
2186 | 19 | |||
2187 | 20 | class MyDiagnosticHandler extends DiagnosticHandler { | ||
2188 | 21 | public function error($args) { | ||
2189 | 22 | print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n"; | ||
2190 | 23 | } | ||
2191 | 24 | } | ||
2192 | 25 | |||
2193 | 26 | function test(Zorba $aZorba) | ||
2194 | 27 | { | ||
2195 | 28 | $diagnosticHandler = new MyDiagnosticHandler(); | ||
2196 | 29 | try { | ||
2197 | 30 | $xquery = $aZorba->compileQuery("1 div 0", $diagnosticHandler); | ||
2198 | 31 | $xquery->execute(); | ||
2199 | 32 | } catch (ZorbaException $e) { | ||
2200 | 33 | print "Caught unexpected Zorba error: " . $e->getDescription(); | ||
2201 | 34 | exit(); | ||
2202 | 35 | } catch (Exception $e) { | ||
2203 | 36 | print "Caught error: " . $e; | ||
2204 | 37 | exit(); | ||
2205 | 38 | } | ||
2206 | 39 | return; | ||
2207 | 40 | } | ||
2208 | 41 | |||
2209 | 42 | $store = InMemoryStore::getInstance(); | ||
2210 | 43 | $zorba = Zorba::getInstance($store); | ||
2211 | 44 | |||
2212 | 45 | print "Running: Compile query string using Diagnostic Handler\n"; | ||
2213 | 46 | test($zorba); | ||
2214 | 47 | print "Success\n"; | ||
2215 | 48 | |||
2216 | 49 | $zorba->shutdown(); | ||
2217 | 50 | InMemoryStore::shutdown($store); | ||
2218 | 51 | |||
2219 | 52 | ?> | ||
2220 | 0 | 53 | ||
2221 | === modified file 'swig/php/tests/test04.php' | |||
2222 | --- swig/php/tests/test04.php 2012-03-27 00:56:11 +0000 | |||
2223 | +++ swig/php/tests/test04.php 2013-03-27 00:40:33 +0000 | |||
2224 | @@ -15,7 +15,7 @@ | |||
2225 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2226 | 16 | */ | 16 | */ |
2227 | 17 | 17 | ||
2229 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2230 | 19 | 19 | ||
2231 | 20 | function test(Zorba $aZorba) { | 20 | function test(Zorba $aZorba) { |
2232 | 21 | #Read and write result | 21 | #Read and write result |
2233 | 22 | 22 | ||
2234 | === modified file 'swig/php/tests/test05.php' | |||
2235 | --- swig/php/tests/test05.php 2012-03-27 00:56:11 +0000 | |||
2236 | +++ swig/php/tests/test05.php 2013-03-27 00:40:33 +0000 | |||
2237 | @@ -15,7 +15,7 @@ | |||
2238 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2239 | 16 | */ | 16 | */ |
2240 | 17 | 17 | ||
2242 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2243 | 19 | 19 | ||
2244 | 20 | function test(Zorba $aZorba) { | 20 | function test(Zorba $aZorba) { |
2245 | 21 | #Read and write result | 21 | #Read and write result |
2246 | 22 | 22 | ||
2247 | === modified file 'swig/php/tests/test06.php' | |||
2248 | --- swig/php/tests/test06.php 2012-03-27 00:56:11 +0000 | |||
2249 | +++ swig/php/tests/test06.php 2013-03-27 00:40:33 +0000 | |||
2250 | @@ -15,7 +15,7 @@ | |||
2251 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2252 | 16 | */ | 16 | */ |
2253 | 17 | 17 | ||
2255 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2256 | 19 | 19 | ||
2257 | 20 | function test(Zorba $aZorba) { | 20 | function test(Zorba $aZorba) { |
2258 | 21 | #Read and write result | 21 | #Read and write result |
2259 | 22 | 22 | ||
2260 | === modified file 'swig/php/tests/test07.php' | |||
2261 | --- swig/php/tests/test07.php 2012-03-27 00:56:11 +0000 | |||
2262 | +++ swig/php/tests/test07.php 2013-03-27 00:40:33 +0000 | |||
2263 | @@ -15,7 +15,7 @@ | |||
2264 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2265 | 16 | */ | 16 | */ |
2266 | 17 | 17 | ||
2268 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2269 | 19 | 19 | ||
2270 | 20 | function test(Zorba $aZorba) { | 20 | function test(Zorba $aZorba) { |
2271 | 21 | $filename = 'books.xml'; | 21 | $filename = 'books.xml'; |
2272 | 22 | 22 | ||
2273 | === modified file 'swig/php/tests/test08.php' | |||
2274 | --- swig/php/tests/test08.php 2012-03-27 00:56:11 +0000 | |||
2275 | +++ swig/php/tests/test08.php 2013-03-27 00:40:33 +0000 | |||
2276 | @@ -15,7 +15,7 @@ | |||
2277 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2278 | 16 | */ | 16 | */ |
2279 | 17 | 17 | ||
2281 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2282 | 19 | 19 | ||
2283 | 20 | function println($string) { | 20 | function println($string) { |
2284 | 21 | print $string."\n"; | 21 | print $string."\n"; |
2285 | 22 | 22 | ||
2286 | === modified file 'swig/php/tests/test09.php' | |||
2287 | --- swig/php/tests/test09.php 2012-03-27 00:56:11 +0000 | |||
2288 | +++ swig/php/tests/test09.php 2013-03-27 00:40:33 +0000 | |||
2289 | @@ -15,66 +15,29 @@ | |||
2290 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2291 | 16 | */ | 16 | */ |
2292 | 17 | 17 | ||
2294 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2295 | 19 | 19 | ||
2296 | 20 | function test(Zorba $aZorba) { | 20 | function test(Zorba $aZorba) { |
2354 | 21 | $xquery = $aZorba->compileQuery("<a>text-a1<b at1='att1' at2='{1+2}'>text-b1</b>text-a2</a>"); | 21 | $filename = 'books.xml'; |
2355 | 22 | 22 | $f = fopen($filename, 'r'); | |
2356 | 23 | 23 | $contents = fread($f, filesize($filename)); | |
2357 | 24 | $saxHandler = new SAX2ContentHandlerProxy(); | 24 | fclose($f); |
2358 | 25 | $saxHandler->setStartDocumentHandler(startDocumentHandler); | 25 | |
2359 | 26 | $saxHandler->setEndDocumentHandler(endDocumentHandler); | 26 | $dataManager = $aZorba->getXmlDataManager(); |
2360 | 27 | $saxHandler->setStartElementHandler(startElementHandler); | 27 | $docIter = $dataManager->parseXML($contents); |
2361 | 28 | $saxHandler->setEndElementHandler(endElementHandler); | 28 | $docIter->open(); |
2362 | 29 | $saxHandler->setCharactersHandler(charactersHandler); | 29 | |
2363 | 30 | $saxHandler->setProcessingInstructionHandler(processingInstructionHandler); | 30 | $doc = Item::createEmptyItem(); |
2364 | 31 | $saxHandler->setIgnorableWhitespaceHandler(ignorableWhitespaceHandler); | 31 | $docIter->next($doc); |
2365 | 32 | $saxHandler->setStartPrefixMappingHandler(startPrefixMappingHandler); | 32 | |
2366 | 33 | $saxHandler->setEndPrefixMappingHandler(endPrefixMappingHandler); | 33 | $docIter->close(); |
2367 | 34 | $saxHandler->setSkippedEntityHandler(skippedEntityHandler); | 34 | $docIter->destroy(); |
2368 | 35 | $xquery->executeSAX($saxHandler); | 35 | |
2369 | 36 | 36 | $xquery = $aZorba->compileQuery("."); | |
2370 | 37 | return; | 37 | $dynCtx = $xquery->getDynamicContext(); |
2371 | 38 | } | 38 | $dynCtx->setContextItem($doc); |
2372 | 39 | 39 | print $xquery->execute()."\n"; | |
2373 | 40 | function startDocumentHandler() { | 40 | |
2317 | 41 | print "Start Document"; | ||
2318 | 42 | return; | ||
2319 | 43 | } | ||
2320 | 44 | function endDocumentHandler() { | ||
2321 | 45 | print "End Document"; | ||
2322 | 46 | return; | ||
2323 | 47 | } | ||
2324 | 48 | function startElementHandler($URI, $localName, $QName, $SAXAttributes) { | ||
2325 | 49 | print "Start Element - " . $QName; | ||
2326 | 50 | return; | ||
2327 | 51 | } | ||
2328 | 52 | function endElementHandler($URI, $localName, $QName) { | ||
2329 | 53 | print "End Element - " . $QName; | ||
2330 | 54 | return; | ||
2331 | 55 | } | ||
2332 | 56 | function charactersHandler($text) { | ||
2333 | 57 | print "Characters - " . $text; | ||
2334 | 58 | return; | ||
2335 | 59 | } | ||
2336 | 60 | function processingInstructionHandler($target, $data) { | ||
2337 | 61 | print "Processing Instruction"; | ||
2338 | 62 | return; | ||
2339 | 63 | } | ||
2340 | 64 | function ignorableWhitespaceHandler($text) { | ||
2341 | 65 | print "Ignorable Whitespace - " . $text; | ||
2342 | 66 | return; | ||
2343 | 67 | } | ||
2344 | 68 | function startPrefixMappingHandler($prefix, $URI) { | ||
2345 | 69 | print "Start Prefix Mapping - " . $prefix; | ||
2346 | 70 | return; | ||
2347 | 71 | } | ||
2348 | 72 | function endPrefixMappingHandler($prefix) { | ||
2349 | 73 | print "End Prefix Mapping - " . $prefix; | ||
2350 | 74 | return; | ||
2351 | 75 | } | ||
2352 | 76 | function skippedEntityHandler($name) { | ||
2353 | 77 | print "Skipped Entity - " . $name; | ||
2374 | 78 | return; | 41 | return; |
2375 | 79 | } | 42 | } |
2376 | 80 | 43 | ||
2377 | @@ -82,7 +45,7 @@ | |||
2378 | 82 | $store = InMemoryStore::getInstance(); | 45 | $store = InMemoryStore::getInstance(); |
2379 | 83 | $zorba = Zorba::getInstance($store); | 46 | $zorba = Zorba::getInstance($store); |
2380 | 84 | 47 | ||
2382 | 85 | print "Running: XQuery execute - executeSAX\n"; | 48 | print "Running: XQuery execute - Get Iterator and print info from its items\n"; |
2383 | 86 | test($zorba); | 49 | test($zorba); |
2384 | 87 | print "Success"; | 50 | print "Success"; |
2385 | 88 | 51 | ||
2386 | 89 | 52 | ||
2387 | === modified file 'swig/php/tests/test10.php' | |||
2388 | --- swig/php/tests/test10.php 2012-03-27 00:56:11 +0000 | |||
2389 | +++ swig/php/tests/test10.php 2013-03-27 00:40:33 +0000 | |||
2390 | @@ -1,6 +1,6 @@ | |||
2391 | 1 | <? | 1 | <? |
2392 | 2 | /* | 2 | /* |
2394 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | 3 | * Copyright 2006-2013 The FLWOR Foundation. |
2395 | 4 | * | 4 | * |
2396 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
2397 | 6 | * you may not use this file except in compliance with the License. | 6 | * you may not use this file except in compliance with the License. |
2398 | @@ -15,41 +15,53 @@ | |||
2399 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2400 | 16 | */ | 16 | */ |
2401 | 17 | 17 | ||
2425 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2426 | 19 | 19 | ||
2427 | 20 | function test(Zorba $aZorba) { | 20 | class MyDiagnosticHandler extends DiagnosticHandler { |
2428 | 21 | $filename = 'books.xml'; | 21 | public function error($args) { |
2429 | 22 | $f = fopen($filename, 'r'); | 22 | print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n"; |
2430 | 23 | $contents = fread($f, filesize($filename)); | 23 | } |
2431 | 24 | fclose($f); | 24 | } |
2432 | 25 | 25 | ||
2433 | 26 | $dataManager = $aZorba->getXmlDataManager(); | 26 | function test(Zorba $aZorba, $query) |
2434 | 27 | $docIter = $dataManager->parseXML($contents); | 27 | { |
2435 | 28 | $docIter->open(); | 28 | $diagnosticHandler = new MyDiagnosticHandler(); |
2436 | 29 | 29 | $xquery = $aZorba->compileQuery($query, $diagnosticHandler); | |
2437 | 30 | $doc = Item::createEmptyItem(); | 30 | try { |
2438 | 31 | $docIter->next($doc); | 31 | print $xquery->execute(); |
2439 | 32 | 32 | } catch (Exception $e) { | |
2440 | 33 | $docIter->close(); | 33 | print "Caught error: " . $e; |
2441 | 34 | $docIter->destroy(); | 34 | exit(); |
2442 | 35 | 35 | } | |
2443 | 36 | $xquery = $aZorba->compileQuery("."); | 36 | $xquery->destroy(); |
2421 | 37 | $dynCtx = $xquery->getDynamicContext(); | ||
2422 | 38 | $dynCtx->setContextItem($doc); | ||
2423 | 39 | print $xquery->execute()."\n"; | ||
2424 | 40 | |||
2444 | 41 | return; | 37 | return; |
2445 | 42 | } | 38 | } |
2446 | 43 | 39 | ||
2447 | 44 | |||
2448 | 45 | $store = InMemoryStore::getInstance(); | 40 | $store = InMemoryStore::getInstance(); |
2449 | 46 | $zorba = Zorba::getInstance($store); | 41 | $zorba = Zorba::getInstance($store); |
2450 | 47 | 42 | ||
2454 | 48 | print "Running: XQuery execute - Get Iterator and print info from its items\n"; | 43 | print "Running: Compile query string using JSONiq \n"; |
2455 | 49 | test($zorba); | 44 | |
2456 | 50 | print "Success"; | 45 | $query = <<<'eoquery' |
2457 | 46 | let $sats:=jn:json-doc("@phpPath@/tests/satellites.json")('satellites') | ||
2458 | 47 | return { | ||
2459 | 48 | 'visible' : [ | ||
2460 | 49 | for $sat in jn:keys($sats) | ||
2461 | 50 | where $sats($sat)('visible') | ||
2462 | 51 | return $sat | ||
2463 | 52 | ], | ||
2464 | 53 | 'invisible' : [ | ||
2465 | 54 | for $sat in jn:keys($sats) | ||
2466 | 55 | where not($sats($sat)('visible')) | ||
2467 | 56 | return $sat | ||
2468 | 57 | ] | ||
2469 | 58 | } | ||
2470 | 59 | eoquery; | ||
2471 | 60 | |||
2472 | 61 | test($zorba, $query); | ||
2473 | 62 | print "Success\n"; | ||
2474 | 51 | 63 | ||
2475 | 52 | $zorba->shutdown(); | 64 | $zorba->shutdown(); |
2476 | 53 | InMemoryStore::shutdown($store); | 65 | InMemoryStore::shutdown($store); |
2477 | 54 | 66 | ||
2478 | 55 | ?> | ||
2479 | 56 | \ No newline at end of file | 67 | \ No newline at end of file |
2480 | 68 | ?> | ||
2481 | 57 | 69 | ||
2482 | === modified file 'swig/php/tests/test11.php' | |||
2483 | --- swig/php/tests/test11.php 2013-02-07 17:24:36 +0000 | |||
2484 | +++ swig/php/tests/test11.php 2013-03-27 00:40:33 +0000 | |||
2485 | @@ -1,6 +1,6 @@ | |||
2486 | 1 | <? | 1 | <? |
2487 | 2 | /* | 2 | /* |
2489 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | 3 | * Copyright 2006-2013 The FLWOR Foundation. |
2490 | 4 | * | 4 | * |
2491 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
2492 | 6 | * you may not use this file except in compliance with the License. | 6 | * you may not use this file except in compliance with the License. |
2493 | @@ -15,34 +15,45 @@ | |||
2494 | 15 | * limitations under the License. | 15 | * limitations under the License. |
2495 | 16 | */ | 16 | */ |
2496 | 17 | 17 | ||
2498 | 18 | require '@phpPath@/Zorba/zorba_api_wrapper.php'; | 18 | require 'zorba_api_wrapper.php'; |
2499 | 19 | 19 | ||
2503 | 20 | class MyDiagnosticHandler(DiagnosticHandler handler) { | 20 | class MyDiagnosticHandler extends DiagnosticHandler { |
2504 | 21 | funtion error(self, *args) { | 21 | public function error($args) { |
2505 | 22 | print "Error args: ", args; | 22 | print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n"; |
2506 | 23 | } | 23 | } |
2507 | 24 | } | 24 | } |
2508 | 25 | 25 | ||
2509 | 26 | function test(Zorba $aZorba) | 26 | function test(Zorba $aZorba) |
2510 | 27 | { | 27 | { |
2512 | 28 | diagnosticHandler = MyDiagnosticHandler() | 28 | $diagnosticHandler = new MyDiagnosticHandler(); |
2513 | 29 | try { | 29 | try { |
2518 | 30 | xquery = zorba.compileQuery("1 div 0", diagnosticHandler); | 30 | $itemFactory = $aZorba->getItemFactory(); |
2519 | 31 | print xquery.execute() | 31 | print "Creating JSON Item null: ". $itemFactory->createJSONNull()->serialize() . "\n"; |
2520 | 32 | } catch (Exception e) { | 32 | print "Creating JSON Item number: ". $itemFactory->createJSONNumber("5")->serialize() . "\n"; |
2521 | 33 | print "Caught error: "; | 33 | $sv = new StringVector(4); |
2522 | 34 | $sv->set(0, "Hello"); | ||
2523 | 35 | $sv->set(1, "Zorba"); | ||
2524 | 36 | $sv->set(2, "Hello"); | ||
2525 | 37 | $sv->set(3, "Zorba"); | ||
2526 | 38 | print "Creating JSON Item array: ". $itemFactory->createJSONArray($sv)->serialize() . "\n"; | ||
2527 | 39 | print "Success"; | ||
2528 | 40 | } catch (ZorbaException $e) { | ||
2529 | 41 | print "Caught unexpected Zorba error: " . $e->getDescription() . "\n" ; | ||
2530 | 42 | exit(); | ||
2531 | 43 | } catch (Exception $e) { | ||
2532 | 44 | print "Caught error: " . $e . "\n"; | ||
2533 | 45 | exit(); | ||
2534 | 34 | } | 46 | } |
2536 | 35 | return | 47 | return; |
2537 | 36 | } | 48 | } |
2538 | 37 | 49 | ||
2539 | 38 | $store = InMemoryStore::getInstance(); | 50 | $store = InMemoryStore::getInstance(); |
2540 | 39 | $zorba = Zorba::getInstance($store); | 51 | $zorba = Zorba::getInstance($store); |
2541 | 40 | 52 | ||
2543 | 41 | print "Running: Compile query string using Diagnostic Handler" | 53 | print "Running: Compile query string using Diagnostic Handler\n"; |
2544 | 42 | test($zorba); | 54 | test($zorba); |
2545 | 43 | print "Success"; | ||
2546 | 44 | 55 | ||
2547 | 45 | $zorba->shutdown(); | 56 | $zorba->shutdown(); |
2548 | 46 | InMemoryStore::shutdown($store); | 57 | InMemoryStore::shutdown($store); |
2549 | 47 | 58 | ||
2550 | 48 | ?> | ||
2551 | 49 | \ No newline at end of file | 59 | \ No newline at end of file |
2552 | 60 | ?> | ||
2553 | 50 | 61 | ||
2554 | === removed file 'swig/php/tests/test12.php' | |||
2555 | --- swig/php/tests/test12.php 2012-03-27 00:56:11 +0000 | |||
2556 | +++ swig/php/tests/test12.php 1970-01-01 00:00:00 +0000 | |||
2557 | @@ -1,52 +0,0 @@ | |||
2558 | 1 | <? | ||
2559 | 2 | /* | ||
2560 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | ||
2561 | 4 | * | ||
2562 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
2563 | 6 | * you may not use this file except in compliance with the License. | ||
2564 | 7 | * You may obtain a copy of the License at | ||
2565 | 8 | * | ||
2566 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
2567 | 10 | * | ||
2568 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
2569 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
2570 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2571 | 14 | * See the License for the specific language governing permissions and | ||
2572 | 15 | * limitations under the License. | ||
2573 | 16 | */ | ||
2574 | 17 | |||
2575 | 18 | //require '@phpPath@/Zorba/zorba_api_wrapper.php'; | ||
2576 | 19 | require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php'; | ||
2577 | 20 | |||
2578 | 21 | class MyDiagnosticHandler(zorba_api.DiagnosticHandler): | ||
2579 | 22 | def error(self, *args): | ||
2580 | 23 | print "Error args: ", args | ||
2581 | 24 | |||
2582 | 25 | def test(zorba): | ||
2583 | 26 | #Read and write result | ||
2584 | 27 | print 'Executing: compilerHints.xq' | ||
2585 | 28 | f = open('compilerHints.xq', 'r') | ||
2586 | 29 | lines = f.read() | ||
2587 | 30 | f.close() | ||
2588 | 31 | diagnosticHandler = MyDiagnosticHandler() | ||
2589 | 32 | compilerHints = zorba_api.CompilerHints() | ||
2590 | 33 | compilerHints.setOptimizationLevel(1) | ||
2591 | 34 | xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler) | ||
2592 | 35 | |||
2593 | 36 | result = xquery.execute() | ||
2594 | 37 | print result | ||
2595 | 38 | return | ||
2596 | 39 | |||
2597 | 40 | |||
2598 | 41 | store = zorba_api.InMemoryStore_getInstance() | ||
2599 | 42 | zorba = zorba_api.Zorba_getInstance(store) | ||
2600 | 43 | |||
2601 | 44 | print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1" | ||
2602 | 45 | test(zorba) | ||
2603 | 46 | print "Success" | ||
2604 | 47 | |||
2605 | 48 | |||
2606 | 49 | zorba.shutdown() | ||
2607 | 50 | zorba_api.InMemoryStore_shutdown(store) | ||
2608 | 51 | |||
2609 | 52 | ?> | ||
2610 | 53 | \ No newline at end of file | 0 | \ No newline at end of file |
2611 | 54 | 1 | ||
2612 | === removed file 'swig/php/tests/test13.php' | |||
2613 | --- swig/php/tests/test13.php 2012-03-27 00:56:11 +0000 | |||
2614 | +++ swig/php/tests/test13.php 1970-01-01 00:00:00 +0000 | |||
2615 | @@ -1,53 +0,0 @@ | |||
2616 | 1 | <? | ||
2617 | 2 | /* | ||
2618 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | ||
2619 | 4 | * | ||
2620 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
2621 | 6 | * you may not use this file except in compliance with the License. | ||
2622 | 7 | * You may obtain a copy of the License at | ||
2623 | 8 | * | ||
2624 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
2625 | 10 | * | ||
2626 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
2627 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
2628 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2629 | 14 | * See the License for the specific language governing permissions and | ||
2630 | 15 | * limitations under the License. | ||
2631 | 16 | */ | ||
2632 | 17 | |||
2633 | 18 | //require '@phpPath@/Zorba/zorba_api_wrapper.php'; | ||
2634 | 19 | require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php'; | ||
2635 | 20 | |||
2636 | 21 | class MyDiagnosticHandler(zorba_api.DiagnosticHandler): | ||
2637 | 22 | def error(self, *args): | ||
2638 | 23 | print "Error args: ", args | ||
2639 | 24 | |||
2640 | 25 | def test(zorba): | ||
2641 | 26 | #Read and write result | ||
2642 | 27 | print 'Executing: compilerHints.xq' | ||
2643 | 28 | f = open('compilerHints.xq', 'r') | ||
2644 | 29 | lines = f.read() | ||
2645 | 30 | f.close() | ||
2646 | 31 | diagnosticHandler = MyDiagnosticHandler() | ||
2647 | 32 | compilerHints = zorba_api.CompilerHints() | ||
2648 | 33 | compilerHints.setLibModule(True) | ||
2649 | 34 | compilerHints.setOptimizationLevel(0) | ||
2650 | 35 | xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler) | ||
2651 | 36 | |||
2652 | 37 | result = xquery.execute() | ||
2653 | 38 | print result | ||
2654 | 39 | return | ||
2655 | 40 | |||
2656 | 41 | |||
2657 | 42 | store = zorba_api.InMemoryStore_getInstance() | ||
2658 | 43 | zorba = zorba_api.Zorba_getInstance(store) | ||
2659 | 44 | |||
2660 | 45 | print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 0 - setLibModule(True)" | ||
2661 | 46 | test(zorba) | ||
2662 | 47 | print "Success" | ||
2663 | 48 | |||
2664 | 49 | |||
2665 | 50 | zorba.shutdown() | ||
2666 | 51 | zorba_api.InMemoryStore_shutdown(store) | ||
2667 | 52 | |||
2668 | 53 | ?> | ||
2669 | 54 | \ No newline at end of file | 0 | \ No newline at end of file |
2670 | 55 | 1 | ||
2671 | === removed file 'swig/php/tests/test14.php' | |||
2672 | --- swig/php/tests/test14.php 2012-03-27 00:56:11 +0000 | |||
2673 | +++ swig/php/tests/test14.php 1970-01-01 00:00:00 +0000 | |||
2674 | @@ -1,53 +0,0 @@ | |||
2675 | 1 | <? | ||
2676 | 2 | /* | ||
2677 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | ||
2678 | 4 | * | ||
2679 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
2680 | 6 | * you may not use this file except in compliance with the License. | ||
2681 | 7 | * You may obtain a copy of the License at | ||
2682 | 8 | * | ||
2683 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
2684 | 10 | * | ||
2685 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
2686 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
2687 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2688 | 14 | * See the License for the specific language governing permissions and | ||
2689 | 15 | * limitations under the License. | ||
2690 | 16 | */ | ||
2691 | 17 | |||
2692 | 18 | //require '@phpPath@/Zorba/zorba_api_wrapper.php'; | ||
2693 | 19 | require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php'; | ||
2694 | 20 | |||
2695 | 21 | class MyDiagnosticHandler(zorba_api.DiagnosticHandler): | ||
2696 | 22 | def error(self, *args): | ||
2697 | 23 | print "Error args: ", args | ||
2698 | 24 | |||
2699 | 25 | def test(zorba): | ||
2700 | 26 | #Read and write result | ||
2701 | 27 | print 'Executing: compilerHints.xq' | ||
2702 | 28 | f = open('compilerHints.xq', 'r') | ||
2703 | 29 | lines = f.read() | ||
2704 | 30 | f.close() | ||
2705 | 31 | diagnosticHandler = MyDiagnosticHandler() | ||
2706 | 32 | compilerHints = zorba_api.CompilerHints() | ||
2707 | 33 | compilerHints.setLibModule(True) | ||
2708 | 34 | compilerHints.setOptimizationLevel(1) | ||
2709 | 35 | xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler) | ||
2710 | 36 | |||
2711 | 37 | result = xquery.execute() | ||
2712 | 38 | print result | ||
2713 | 39 | return | ||
2714 | 40 | |||
2715 | 41 | |||
2716 | 42 | store = zorba_api.InMemoryStore_getInstance() | ||
2717 | 43 | zorba = zorba_api.Zorba_getInstance(store) | ||
2718 | 44 | |||
2719 | 45 | print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1 - setLibModule(True)" | ||
2720 | 46 | test(zorba) | ||
2721 | 47 | print "Success" | ||
2722 | 48 | |||
2723 | 49 | |||
2724 | 50 | zorba.shutdown() | ||
2725 | 51 | zorba_api.InMemoryStore_shutdown(store) | ||
2726 | 52 | |||
2727 | 53 | ?> | ||
2728 | 54 | \ No newline at end of file | 0 | \ No newline at end of file |
2729 | 55 | 1 | ||
2730 | === removed file 'swig/php/tests/zorba_api.php' | |||
2731 | --- swig/php/tests/zorba_api.php 2012-03-27 00:56:11 +0000 | |||
2732 | +++ swig/php/tests/zorba_api.php 1970-01-01 00:00:00 +0000 | |||
2733 | @@ -1,178 +0,0 @@ | |||
2734 | 1 | <?php | ||
2735 | 2 | /* | ||
2736 | 3 | * Copyright 2006-2012 The FLWOR Foundation. | ||
2737 | 4 | * | ||
2738 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
2739 | 6 | * you may not use this file except in compliance with the License. | ||
2740 | 7 | * You may obtain a copy of the License at | ||
2741 | 8 | * | ||
2742 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
2743 | 10 | * | ||
2744 | 11 | * Unless required by applicable law or agreed to in writing, software | ||
2745 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
2746 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2747 | 14 | * See the License for the specific language governing permissions and | ||
2748 | 15 | * limitations under the License. | ||
2749 | 16 | */ | ||
2750 | 17 | |||
2751 | 18 | // Try to load our extension if it's not already loaded. | ||
2752 | 19 | if (!extension_loaded("zorba_api")) { | ||
2753 | 20 | if (strtolower(substr(PHP_OS, 0, 3)) === 'win') { | ||
2754 | 21 | if (!dl('zorba_api.dll')) return; | ||
2755 | 22 | } else { | ||
2756 | 23 | // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'. | ||
2757 | 24 | // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'. | ||
2758 | 25 | if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') { | ||
2759 | 26 | if (!dl('zorba_api.so')) return; | ||
2760 | 27 | } else { | ||
2761 | 28 | if (!dl('zorba_api.'.PHP_SHLIB_SUFFIX)) return; | ||
2762 | 29 | } | ||
2763 | 30 | } | ||
2764 | 31 | } | ||
2765 | 32 | |||
2766 | 33 | class Item { | ||
2767 | 34 | public $_cPtr=null; | ||
2768 | 35 | |||
2769 | 36 | static function createEmptyItem() { | ||
2770 | 37 | $r=Item_createEmptyItem(); | ||
2771 | 38 | return is_resource($r) ? new Item($r) : $r; | ||
2772 | 39 | } | ||
2773 | 40 | |||
2774 | 41 | function getStringValue() { | ||
2775 | 42 | return Item_getStringValue($this->_cPtr); | ||
2776 | 43 | } | ||
2777 | 44 | |||
2778 | 45 | function __construct() { | ||
2779 | 46 | $this->_cPtr=new_Item(); | ||
2780 | 47 | } | ||
2781 | 48 | } | ||
2782 | 49 | |||
2783 | 50 | class Iterator { | ||
2784 | 51 | public $_cPtr=null; | ||
2785 | 52 | |||
2786 | 53 | function open() { | ||
2787 | 54 | Iterator_open($this->_cPtr); | ||
2788 | 55 | } | ||
2789 | 56 | |||
2790 | 57 | function next($arg1) { | ||
2791 | 58 | return Iterator_next($this->_cPtr,$arg1); | ||
2792 | 59 | } | ||
2793 | 60 | |||
2794 | 61 | function close() { | ||
2795 | 62 | Iterator_close($this->_cPtr); | ||
2796 | 63 | } | ||
2797 | 64 | |||
2798 | 65 | function destroy() { | ||
2799 | 66 | Iterator_destroy($this->_cPtr); | ||
2800 | 67 | } | ||
2801 | 68 | |||
2802 | 69 | function __construct($cPtr) { | ||
2803 | 70 | $this->_cPtr=$cPtr; | ||
2804 | 71 | } | ||
2805 | 72 | |||
2806 | 73 | public function __destruct() { | ||
2807 | 74 | $this->destroy(); | ||
2808 | 75 | } | ||
2809 | 76 | } | ||
2810 | 77 | |||
2811 | 78 | class XQuery { | ||
2812 | 79 | public $_cPtr=null; | ||
2813 | 80 | |||
2814 | 81 | function execute() { | ||
2815 | 82 | return XQuery_execute($this->_cPtr); | ||
2816 | 83 | } | ||
2817 | 84 | |||
2818 | 85 | function isUpdateQuery() { | ||
2819 | 86 | return XQuery_isUpdateQuery($this->_cPtr); | ||
2820 | 87 | } | ||
2821 | 88 | |||
2822 | 89 | function applyUpdates() { | ||
2823 | 90 | XQuery_applyUpdates($this->_cPtr); | ||
2824 | 91 | } | ||
2825 | 92 | |||
2826 | 93 | function destroy() { | ||
2827 | 94 | XQuery_destroy($this->_cPtr); | ||
2828 | 95 | } | ||
2829 | 96 | |||
2830 | 97 | function iterator() { | ||
2831 | 98 | $r=XQuery_iterator($this->_cPtr); | ||
2832 | 99 | return is_resource($r) ? new Iterator($r) : $r; | ||
2833 | 100 | } | ||
2834 | 101 | |||
2835 | 102 | function __construct($cPtr) { | ||
2836 | 103 | $this->_cPtr=$cPtr; | ||
2837 | 104 | } | ||
2838 | 105 | |||
2839 | 106 | function __destruct() { | ||
2840 | 107 | $this->destroy(); | ||
2841 | 108 | } | ||
2842 | 109 | } | ||
2843 | 110 | |||
2844 | 111 | class Store { | ||
2845 | 112 | //public $_cPtr=null; | ||
2846 | 113 | |||
2847 | 114 | //function __construct() { | ||
2848 | 115 | // $this->_cPtr=new_Store(); | ||
2849 | 116 | //} | ||
2850 | 117 | } | ||
2851 | 118 | |||
2852 | 119 | class InMemoryStore extends Store { | ||
2853 | 120 | public $_cPtr=null; | ||
2854 | 121 | |||
2855 | 122 | static function getInstance() { | ||
2856 | 123 | $r=InMemoryStore_getInstance(); | ||
2857 | 124 | return is_resource($r) ? new InMemoryStore($r) : $r; | ||
2858 | 125 | } | ||
2859 | 126 | |||
2860 | 127 | static function shutdown($arg1) { | ||
2861 | 128 | InMemoryStore_shutdown($arg1); | ||
2862 | 129 | } | ||
2863 | 130 | |||
2864 | 131 | private function __construct($cPtr) { | ||
2865 | 132 | $this->_cPtr=$cPtr; | ||
2866 | 133 | } | ||
2867 | 134 | } | ||
2868 | 135 | |||
2869 | 136 | class XmlDataManager { | ||
2870 | 137 | public $_cPtr=null; | ||
2871 | 138 | |||
2872 | 139 | function loadDocument($aName,$aContent) { | ||
2873 | 140 | XmlDataManager_loadDocument($this->_cPtr,$aName,$aContent); | ||
2874 | 141 | } | ||
2875 | 142 | |||
2876 | 143 | function deleteDocument($aName) { | ||
2877 | 144 | return XmlDataManager_deleteDocument($this->_cPtr,$aName); | ||
2878 | 145 | } | ||
2879 | 146 | |||
2880 | 147 | function __construct($cPtr) { | ||
2881 | 148 | $this->_cPtr=$cPtr; | ||
2882 | 149 | } | ||
2883 | 150 | } | ||
2884 | 151 | |||
2885 | 152 | class Zorba { | ||
2886 | 153 | public $_cPtr=null; | ||
2887 | 154 | |||
2888 | 155 | static function getInstance($arg1) { | ||
2889 | 156 | $r=Zorba_getInstance($arg1->_cPtr); | ||
2890 | 157 | return is_resource($r) ? new Zorba($r) : $r; | ||
2891 | 158 | } | ||
2892 | 159 | |||
2893 | 160 | function compileQuery($aStr) { | ||
2894 | 161 | $r=Zorba_compileQuery($this->_cPtr,$aStr); | ||
2895 | 162 | return is_resource($r) ? new XQuery($r) : $r; | ||
2896 | 163 | } | ||
2897 | 164 | |||
2898 | 165 | function getXmlDataManager() { | ||
2899 | 166 | $r=Zorba_getXmlDataManager($this->_cPtr); | ||
2900 | 167 | return is_resource($r) ? new XmlDataManager($r) : $r; | ||
2901 | 168 | } | ||
2902 | 169 | |||
2903 | 170 | function shutdown() { | ||
2904 | 171 | Zorba_shutdown($this->_cPtr); | ||
2905 | 172 | } | ||
2906 | 173 | |||
2907 | 174 | private function __construct($cPtr) { | ||
2908 | 175 | $this->_cPtr=$cPtr; | ||
2909 | 176 | } | ||
2910 | 177 | } | ||
2911 | 178 | ?> | ||
2912 | 179 | 0 | ||
2913 | === modified file 'swig/php/zorba_api.i' | |||
2914 | --- swig/php/zorba_api.i 2013-02-07 17:24:36 +0000 | |||
2915 | +++ swig/php/zorba_api.i 2013-03-27 00:40:33 +0000 | |||
2916 | @@ -13,6 +13,9 @@ | |||
2917 | 13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
2918 | 14 | * limitations under the License. | 14 | * limitations under the License. |
2919 | 15 | */ | 15 | */ |
2920 | 16 | |||
2921 | 17 | %rename (IteratorImpl) Iterator; | ||
2922 | 18 | |||
2923 | 16 | %begin %{ | 19 | %begin %{ |
2924 | 17 | #include <iostream> | 20 | #include <iostream> |
2925 | 18 | 21 | ||
2926 | @@ -36,8 +39,13 @@ | |||
2927 | 36 | %{ | 39 | %{ |
2928 | 37 | #include "zend_exceptions.h" | 40 | #include "zend_exceptions.h" |
2929 | 38 | %} | 41 | %} |
2930 | 42 | |||
2931 | 43 | TSRMLS_FETCH(); | ||
2932 | 44 | |||
2933 | 39 | %include ../zorba_api.i | 45 | %include ../zorba_api.i |
2934 | 46 | |||
2935 | 40 | %{ | 47 | %{ |
2936 | 48 | |||
2937 | 41 | #define SWIG_exception(code, msg) { mt_zend_throw_exception(0, msg, code TSRMLS_CC); } | 49 | #define SWIG_exception(code, msg) { mt_zend_throw_exception(0, msg, code TSRMLS_CC); } |
2938 | 42 | 50 | ||
2939 | 43 | ZEND_API zval * mt_zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC); | 51 | ZEND_API zval * mt_zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC); |
2940 | 44 | 52 | ||
2941 | === removed file 'swig/php/zorba_api_wrapper.php' | |||
2942 | --- swig/php/zorba_api_wrapper.php 2013-02-07 17:24:36 +0000 | |||
2943 | +++ swig/php/zorba_api_wrapper.php 1970-01-01 00:00:00 +0000 | |||
2944 | @@ -1,1215 +0,0 @@ | |||
2945 | 1 | <?php | ||
2946 | 2 | //Try to load the extension if it's not already loaded. | ||
2947 | 3 | if(!extension_loaded('zorba_api')) { | ||
2948 | 4 | $zorbaExtNotLoaded = "Zorba extension couldn't loaded"; | ||
2949 | 5 | if(function_exists('dl')) { | ||
2950 | 6 | if(strtolower(substr(PHP_OS, 0, 3)) === 'win') { | ||
2951 | 7 | if(!dl('zorba_api.dll')) { | ||
2952 | 8 | throw new Exception($zorbaExtNotLoaded); | ||
2953 | 9 | } | ||
2954 | 10 | } else { | ||
2955 | 11 | $suffix = "so"; | ||
2956 | 12 | if(PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') { | ||
2957 | 13 | $suffix = PHP_SHLIB_SUFFIX; | ||
2958 | 14 | } | ||
2959 | 15 | if(!dl('zorba_api.'.$suffix)) { | ||
2960 | 16 | if(!dl('libzorba_api.'.$suffix)) { | ||
2961 | 17 | throw new Exception($zorbaExtNotLoaded); | ||
2962 | 18 | } | ||
2963 | 19 | } | ||
2964 | 20 | } | ||
2965 | 21 | } else { | ||
2966 | 22 | throw new Exception($zorbaExtNotLoaded); | ||
2967 | 23 | } | ||
2968 | 24 | } | ||
2969 | 25 | |||
2970 | 26 | class DynamicContext{ | ||
2971 | 27 | public $_cPtr=null; | ||
2972 | 28 | |||
2973 | 29 | public function __set($var, $value) { | ||
2974 | 30 | $r = DynamicContext___set($this->_cPtr, $var, $value); | ||
2975 | 31 | return $r; | ||
2976 | 32 | |||
2977 | 33 | } | ||
2978 | 34 | |||
2979 | 35 | public function __isset($var) { | ||
2980 | 36 | $r = DynamicContext___isset($this->_cPtr, $var); | ||
2981 | 37 | return $r; | ||
2982 | 38 | |||
2983 | 39 | } | ||
2984 | 40 | |||
2985 | 41 | public function __get($var) { | ||
2986 | 42 | $r = DynamicContext___get($this->_cPtr, $var); | ||
2987 | 43 | return $r; | ||
2988 | 44 | |||
2989 | 45 | } | ||
2990 | 46 | |||
2991 | 47 | public function setVariable($aNamespace, $aLocalname, $arg3) { | ||
2992 | 48 | $r = DynamicContext_setVariable($this->_cPtr, $aNamespace, $aLocalname, $arg3); | ||
2993 | 49 | return $r; | ||
2994 | 50 | |||
2995 | 51 | } | ||
2996 | 52 | |||
2997 | 53 | public function setContextItem($arg1) { | ||
2998 | 54 | $r = DynamicContext_setContextItem($this->_cPtr, $arg1); | ||
2999 | 55 | return $r; | ||
3000 | 56 | |||
3001 | 57 | } | ||
3002 | 58 | |||
3003 | 59 | public function __construct($ptr) { | ||
3004 | 60 | $this->_cPtr = $ptr; | ||
3005 | 61 | } | ||
3006 | 62 | |||
3007 | 63 | } | ||
3008 | 64 | |||
3009 | 65 | class Item{ | ||
3010 | 66 | public $_cPtr=null; | ||
3011 | 67 | |||
3012 | 68 | public function __set($var, $value) { | ||
3013 | 69 | $r = Item___set($this->_cPtr, $var, $value); | ||
3014 | 70 | return $r; | ||
3015 | 71 | |||
3016 | 72 | } | ||
3017 | 73 | |||
3018 | 74 | public function __isset($var) { | ||
3019 | 75 | $r = Item___isset($this->_cPtr, $var); | ||
3020 | 76 | return $r; | ||
3021 | 77 | |||
3022 | 78 | } | ||
3023 | 79 | |||
3024 | 80 | public function __get($var) { | ||
3025 | 81 | $r = Item___get($this->_cPtr, $var); | ||
3026 | 82 | return $r; | ||
3027 | 83 | |||
3028 | 84 | } | ||
3029 | 85 | |||
3030 | 86 | static public function createEmptyItem() { | ||
3031 | 87 | $r = Item_createEmptyItem(); | ||
3032 | 88 | return is_resource($r) ? new Item($r) : $r; | ||
3033 | 89 | |||
3034 | 90 | } | ||
3035 | 91 | |||
3036 | 92 | public function getStringValue() { | ||
3037 | 93 | $r = Item_getStringValue($this->_cPtr); | ||
3038 | 94 | return $r; | ||
3039 | 95 | |||
3040 | 96 | } | ||
3041 | 97 | |||
3042 | 98 | public function serialize() { | ||
3043 | 99 | $r = Item_serialize($this->_cPtr); | ||
3044 | 100 | return $r; | ||
3045 | 101 | |||
3046 | 102 | } | ||
3047 | 103 | |||
3048 | 104 | public function getAtomizationValue() { | ||
3049 | 105 | $r = Item_getAtomizationValue($this->_cPtr); | ||
3050 | 106 | return is_resource($r) ? new IteratorImpl($r) : $r; | ||
3051 | 107 | |||
3052 | 108 | } | ||
3053 | 109 | |||
3054 | 110 | public function getAttributes() { | ||
3055 | 111 | $r = Item_getAttributes($this->_cPtr); | ||
3056 | 112 | return is_resource($r) ? new IteratorImpl($r) : $r; | ||
3057 | 113 | |||
3058 | 114 | } | ||
3059 | 115 | |||
3060 | 116 | public function getBooleanValue() { | ||
3061 | 117 | $r = Item_getBooleanValue($this->_cPtr); | ||
3062 | 118 | return $r; | ||
3063 | 119 | |||
3064 | 120 | } | ||
3065 | 121 | |||
3066 | 122 | public function getChildren() { | ||
3067 | 123 | $r = Item_getChildren($this->_cPtr); | ||
3068 | 124 | return is_resource($r) ? new IteratorImpl($r) : $r; | ||
3069 | 125 | |||
3070 | 126 | } | ||
3071 | 127 | |||
3072 | 128 | public function getEBV() { | ||
3073 | 129 | $r = Item_getEBV($this->_cPtr); | ||
3074 | 130 | return is_resource($r) ? new Item($r) : $r; | ||
3075 | 131 | |||
3076 | 132 | } | ||
3077 | 133 | |||
3078 | 134 | public function getIntValue() { | ||
3079 | 135 | $r = Item_getIntValue($this->_cPtr); | ||
3080 | 136 | return $r; | ||
3081 | 137 | |||
3082 | 138 | } | ||
3083 | 139 | |||
3084 | 140 | public function getLocalName() { | ||
3085 | 141 | $r = Item_getLocalName($this->_cPtr); | ||
3086 | 142 | return $r; | ||
3087 | 143 | |||
3088 | 144 | } | ||
3089 | 145 | |||
3090 | 146 | public function getNamespace() { | ||
3091 | 147 | $r = Item_getNamespace($this->_cPtr); | ||
3092 | 148 | return $r; | ||
3093 | 149 | |||
3094 | 150 | } | ||
3095 | 151 | |||
3096 | 152 | public function getNodeName($aNodeName) { | ||
3097 | 153 | $r = Item_getNodeName($this->_cPtr, $aNodeName); | ||
3098 | 154 | return $r; | ||
3099 | 155 | |||
3100 | 156 | } | ||
3101 | 157 | |||
3102 | 158 | public function getPrefix() { | ||
3103 | 159 | $r = Item_getPrefix($this->_cPtr); | ||
3104 | 160 | return $r; | ||
3105 | 161 | |||
3106 | 162 | } | ||
3107 | 163 | |||
3108 | 164 | public function getType() { | ||
3109 | 165 | $r = Item_getType($this->_cPtr); | ||
3110 | 166 | return is_resource($r) ? new Item($r) : $r; | ||
3111 | 167 | |||
3112 | 168 | } | ||
3113 | 169 | |||
3114 | 170 | public function getUnsignedIntValue() { | ||
3115 | 171 | $r = Item_getUnsignedIntValue($this->_cPtr); | ||
3116 | 172 | return $r; | ||
3117 | 173 | |||
3118 | 174 | } | ||
3119 | 175 | |||
3120 | 176 | public function getNodeKind() { | ||
3121 | 177 | $r = Item_getNodeKind($this->_cPtr); | ||
3122 | 178 | return $r; | ||
3123 | 179 | |||
3124 | 180 | } | ||
3125 | 181 | |||
3126 | 182 | public function isAtomic() { | ||
3127 | 183 | $r = Item_isAtomic($this->_cPtr); | ||
3128 | 184 | return $r; | ||
3129 | 185 | |||
3130 | 186 | } | ||
3131 | 187 | |||
3132 | 188 | public function isNaN() { | ||
3133 | 189 | $r = Item_isNaN($this->_cPtr); | ||
3134 | 190 | return $r; | ||
3135 | 191 | |||
3136 | 192 | } | ||
3137 | 193 | |||
3138 | 194 | public function isNode() { | ||
3139 | 195 | $r = Item_isNode($this->_cPtr); | ||
3140 | 196 | return $r; | ||
3141 | 197 | |||
3142 | 198 | } | ||
3143 | 199 | |||
3144 | 200 | public function isNull() { | ||
3145 | 201 | $r = Item_isNull($this->_cPtr); | ||
3146 | 202 | return $r; | ||
3147 | 203 | |||
3148 | 204 | } | ||
3149 | 205 | |||
3150 | 206 | public function isPosOrNegInf() { | ||
3151 | 207 | $r = Item_isPosOrNegInf($this->_cPtr); | ||
3152 | 208 | return $r; | ||
3153 | 209 | |||
3154 | 210 | } | ||
3155 | 211 | |||
3156 | 212 | public function __construct($ptr) { | ||
3157 | 213 | $this->_cPtr = $ptr; | ||
3158 | 214 | } | ||
3159 | 215 | |||
3160 | 216 | } | ||
3161 | 217 | |||
3162 | 218 | class IteratorImpl{ | ||
3163 | 219 | public $_cPtr=null; | ||
3164 | 220 | |||
3165 | 221 | public function __set($var, $value) { | ||
3166 | 222 | $r = Iterator___set($this->_cPtr, $var, $value); | ||
3167 | 223 | return $r; | ||
3168 | 224 | |||
3169 | 225 | } | ||
3170 | 226 | |||
3171 | 227 | public function __isset($var) { | ||
3172 | 228 | $r = Iterator___isset($this->_cPtr, $var); | ||
3173 | 229 | return $r; | ||
3174 | 230 | |||
3175 | 231 | } | ||
3176 | 232 | |||
3177 | 233 | public function __get($var) { | ||
3178 | 234 | $r = Iterator___get($this->_cPtr, $var); | ||
3179 | 235 | return $r; | ||
3180 | 236 | |||
3181 | 237 | } | ||
3182 | 238 | |||
3183 | 239 | public function open() { | ||
3184 | 240 | $r = Iterator_open($this->_cPtr); | ||
3185 | 241 | return $r; | ||
3186 | 242 | |||
3187 | 243 | } | ||
3188 | 244 | |||
3189 | 245 | public function next($arg1) { | ||
3190 | 246 | $r = Iterator_next($this->_cPtr, $arg1); | ||
3191 | 247 | return $r; | ||
3192 | 248 | |||
3193 | 249 | } | ||
3194 | 250 | |||
3195 | 251 | public function close() { | ||
3196 | 252 | $r = Iterator_close($this->_cPtr); | ||
3197 | 253 | return $r; | ||
3198 | 254 | |||
3199 | 255 | } | ||
3200 | 256 | |||
3201 | 257 | public function destroy() { | ||
3202 | 258 | $r = Iterator_destroy($this->_cPtr); | ||
3203 | 259 | return $r; | ||
3204 | 260 | |||
3205 | 261 | } | ||
3206 | 262 | |||
3207 | 263 | public function __construct($ptr) { | ||
3208 | 264 | $this->_cPtr = $ptr; | ||
3209 | 265 | } | ||
3210 | 266 | |||
3211 | 267 | } | ||
3212 | 268 | |||
3213 | 269 | class XQuery{ | ||
3214 | 270 | public $_cPtr=null; | ||
3215 | 271 | |||
3216 | 272 | public function __set($var, $value) { | ||
3217 | 273 | $r = XQuery___set($this->_cPtr, $var, $value); | ||
3218 | 274 | return $r; | ||
3219 | 275 | |||
3220 | 276 | } | ||
3221 | 277 | |||
3222 | 278 | public function __isset($var) { | ||
3223 | 279 | $r = XQuery___isset($this->_cPtr, $var); | ||
3224 | 280 | return $r; | ||
3225 | 281 | |||
3226 | 282 | } | ||
3227 | 283 | |||
3228 | 284 | public function __get($var) { | ||
3229 | 285 | $r = XQuery___get($this->_cPtr, $var); | ||
3230 | 286 | return $r; | ||
3231 | 287 | |||
3232 | 288 | } | ||
3233 | 289 | |||
3234 | 290 | public function execute() { | ||
3235 | 291 | $r = XQuery_execute($this->_cPtr); | ||
3236 | 292 | return $r; | ||
3237 | 293 | |||
3238 | 294 | } | ||
3239 | 295 | |||
3240 | 296 | public function printPlanAsXML() { | ||
3241 | 297 | $r = XQuery_printPlanAsXML($this->_cPtr); | ||
3242 | 298 | return $r; | ||
3243 | 299 | |||
3244 | 300 | } | ||
3245 | 301 | |||
3246 | 302 | public function printPlanAsDOT() { | ||
3247 | 303 | $r = XQuery_printPlanAsDOT($this->_cPtr); | ||
3248 | 304 | return $r; | ||
3249 | 305 | |||
3250 | 306 | } | ||
3251 | 307 | |||
3252 | 308 | public function compile($aQuery, $aStaticContext=null) { | ||
3253 | 309 | switch(func_num_args()) { | ||
3254 | 310 | case 1: $r = XQuery_compile($this->_cPtr, $aQuery);break; | ||
3255 | 311 | case 2: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);break; | ||
3256 | 312 | default: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext); | ||
3257 | 313 | } | ||
3258 | 314 | return $r; | ||
3259 | 315 | |||
3260 | 316 | } | ||
3261 | 317 | |||
3262 | 318 | public function destroy() { | ||
3263 | 319 | $r = XQuery_destroy($this->_cPtr); | ||
3264 | 320 | return $r; | ||
3265 | 321 | |||
3266 | 322 | } | ||
3267 | 323 | |||
3268 | 324 | public function iterator() { | ||
3269 | 325 | $r = XQuery_iterator($this->_cPtr); | ||
3270 | 326 | return is_resource($r) ? new IteratorImpl($r) : $r; | ||
3271 | 327 | |||
3272 | 328 | } | ||
3273 | 329 | |||
3274 | 330 | public function getDynamicContext() { | ||
3275 | 331 | $r = XQuery_getDynamicContext($this->_cPtr); | ||
3276 | 332 | return is_resource($r) ? new DynamicContext($r) : $r; | ||
3277 | 333 | |||
3278 | 334 | } | ||
3279 | 335 | |||
3280 | 336 | public function __construct($ptr) { | ||
3281 | 337 | $this->_cPtr = $ptr; | ||
3282 | 338 | } | ||
3283 | 339 | |||
3284 | 340 | } | ||
3285 | 341 | |||
3286 | 342 | class Store{ | ||
3287 | 343 | public $_cPtr=null; | ||
3288 | 344 | |||
3289 | 345 | public function __set($var, $value) { | ||
3290 | 346 | $r = Store___set($this->_cPtr, $var, $value); | ||
3291 | 347 | return $r; | ||
3292 | 348 | |||
3293 | 349 | } | ||
3294 | 350 | |||
3295 | 351 | public function __isset($var) { | ||
3296 | 352 | $r = Store___isset($this->_cPtr, $var); | ||
3297 | 353 | return $r; | ||
3298 | 354 | |||
3299 | 355 | } | ||
3300 | 356 | |||
3301 | 357 | public function __get($var) { | ||
3302 | 358 | $r = Store___get($this->_cPtr, $var); | ||
3303 | 359 | return $r; | ||
3304 | 360 | |||
3305 | 361 | } | ||
3306 | 362 | |||
3307 | 363 | public function __construct($ptr) { | ||
3308 | 364 | $this->_cPtr = $ptr; | ||
3309 | 365 | } | ||
3310 | 366 | |||
3311 | 367 | } | ||
3312 | 368 | |||
3313 | 369 | class InMemoryStore extends Store{ | ||
3314 | 370 | public $_cPtr=null; | ||
3315 | 371 | |||
3316 | 372 | static public function getInstance() { | ||
3317 | 373 | $r = InMemoryStore_getInstance(); | ||
3318 | 374 | return is_resource($r) ? new InMemoryStore($r) : $r; | ||
3319 | 375 | |||
3320 | 376 | } | ||
3321 | 377 | |||
3322 | 378 | static public function shutdown($arg1) { | ||
3323 | 379 | $r = InMemoryStore_shutdown($arg1); | ||
3324 | 380 | return $r; | ||
3325 | 381 | |||
3326 | 382 | } | ||
3327 | 383 | |||
3328 | 384 | } | ||
3329 | 385 | |||
3330 | 386 | class DocumentManager{ | ||
3331 | 387 | public $_cPtr=null; | ||
3332 | 388 | |||
3333 | 389 | public function __set($var, $value) { | ||
3334 | 390 | $r = DocumentManager___set($this->_cPtr, $var, $value); | ||
3335 | 391 | return $r; | ||
3336 | 392 | |||
3337 | 393 | } | ||
3338 | 394 | |||
3339 | 395 | public function __isset($var) { | ||
3340 | 396 | $r = DocumentManager___isset($this->_cPtr, $var); | ||
3341 | 397 | return $r; | ||
3342 | 398 | |||
3343 | 399 | } | ||
3344 | 400 | |||
3345 | 401 | public function __get($var) { | ||
3346 | 402 | $r = DocumentManager___get($this->_cPtr, $var); | ||
3347 | 403 | return $r; | ||
3348 | 404 | |||
3349 | 405 | } | ||
3350 | 406 | |||
3351 | 407 | public function put($aName, $aDoc) { | ||
3352 | 408 | $r = DocumentManager_put($this->_cPtr, $aName, $aDoc); | ||
3353 | 409 | return $r; | ||
3354 | 410 | |||
3355 | 411 | } | ||
3356 | 412 | |||
3357 | 413 | public function remove($aName) { | ||
3358 | 414 | $r = DocumentManager_remove($this->_cPtr, $aName); | ||
3359 | 415 | return $r; | ||
3360 | 416 | |||
3361 | 417 | } | ||
3362 | 418 | |||
3363 | 419 | public function document($aName) { | ||
3364 | 420 | $r = DocumentManager_document($this->_cPtr, $aName); | ||
3365 | 421 | return is_resource($r) ? new Item($r) : $r; | ||
3366 | 422 | |||
3367 | 423 | } | ||
3368 | 424 | |||
3369 | 425 | public function isAvailableDocument($aName) { | ||
3370 | 426 | $r = DocumentManager_isAvailableDocument($this->_cPtr, $aName); | ||
3371 | 427 | return $r; | ||
3372 | 428 | |||
3373 | 429 | } | ||
3374 | 430 | |||
3375 | 431 | public function __construct($ptr) { | ||
3376 | 432 | $this->_cPtr = $ptr; | ||
3377 | 433 | } | ||
3378 | 434 | |||
3379 | 435 | } | ||
3380 | 436 | |||
3381 | 437 | class XmlDataManager{ | ||
3382 | 438 | public $_cPtr=null; | ||
3383 | 439 | |||
3384 | 440 | public function __set($var, $value) { | ||
3385 | 441 | $r = XmlDataManager___set($this->_cPtr, $var, $value); | ||
3386 | 442 | return $r; | ||
3387 | 443 | |||
3388 | 444 | } | ||
3389 | 445 | |||
3390 | 446 | public function __isset($var) { | ||
3391 | 447 | $r = XmlDataManager___isset($this->_cPtr, $var); | ||
3392 | 448 | return $r; | ||
3393 | 449 | |||
3394 | 450 | } | ||
3395 | 451 | |||
3396 | 452 | public function __get($var) { | ||
3397 | 453 | $r = XmlDataManager___get($this->_cPtr, $var); | ||
3398 | 454 | return $r; | ||
3399 | 455 | |||
3400 | 456 | } | ||
3401 | 457 | |||
3402 | 458 | public function getDocumentManager() { | ||
3403 | 459 | $r = XmlDataManager_getDocumentManager($this->_cPtr); | ||
3404 | 460 | return is_resource($r) ? new DocumentManager($r) : $r; | ||
3405 | 461 | |||
3406 | 462 | } | ||
3407 | 463 | |||
3408 | 464 | public function parseXML($aDoc) { | ||
3409 | 465 | $r = XmlDataManager_parseXML($this->_cPtr, $aDoc); | ||
3410 | 466 | return is_resource($r) ? new IteratorImpl($r) : $r; | ||
3411 | 467 | |||
3412 | 468 | } | ||
3413 | 469 | |||
3414 | 470 | public function __construct($ptr) { | ||
3415 | 471 | $this->_cPtr = $ptr; | ||
3416 | 472 | } | ||
3417 | 473 | |||
3418 | 474 | } | ||
3419 | 475 | |||
3420 | 476 | class ZorbaException{ | ||
3421 | 477 | public $_cPtr=null; | ||
3422 | 478 | |||
3423 | 479 | public function __set($var, $value) { | ||
3424 | 480 | $r = ZorbaException___set($this->_cPtr, $var, $value); | ||
3425 | 481 | return $r; | ||
3426 | 482 | |||
3427 | 483 | } | ||
3428 | 484 | |||
3429 | 485 | public function __isset($var) { | ||
3430 | 486 | $r = ZorbaException___isset($this->_cPtr, $var); | ||
3431 | 487 | return $r; | ||
3432 | 488 | |||
3433 | 489 | } | ||
3434 | 490 | |||
3435 | 491 | public function __get($var) { | ||
3436 | 492 | $r = ZorbaException___get($this->_cPtr, $var); | ||
3437 | 493 | return $r; | ||
3438 | 494 | |||
3439 | 495 | } | ||
3440 | 496 | |||
3441 | 497 | public function __construct($ptr) { | ||
3442 | 498 | $this->_cPtr = $ptr; | ||
3443 | 499 | } | ||
3444 | 500 | |||
3445 | 501 | public function getDescription() { | ||
3446 | 502 | $r = ZorbaException_getDescription($this->_cPtr); | ||
3447 | 503 | return $r; | ||
3448 | 504 | |||
3449 | 505 | } | ||
3450 | 506 | |||
3451 | 507 | public function getErrorCode() { | ||
3452 | 508 | $r = ZorbaException_getErrorCode($this->_cPtr); | ||
3453 | 509 | return $r; | ||
3454 | 510 | |||
3455 | 511 | } | ||
3456 | 512 | |||
3457 | 513 | public function getFileLineNumber() { | ||
3458 | 514 | $r = ZorbaException_getFileLineNumber($this->_cPtr); | ||
3459 | 515 | return $r; | ||
3460 | 516 | |||
3461 | 517 | } | ||
3462 | 518 | |||
3463 | 519 | public function getFileName() { | ||
3464 | 520 | $r = ZorbaException_getFileName($this->_cPtr); | ||
3465 | 521 | return $r; | ||
3466 | 522 | |||
3467 | 523 | } | ||
3468 | 524 | |||
3469 | 525 | static public function getErrorCodeAsString($aErrorCode) { | ||
3470 | 526 | $r = ZorbaException_getErrorCodeAsString($aErrorCode); | ||
3471 | 527 | return $r; | ||
3472 | 528 | |||
3473 | 529 | } | ||
3474 | 530 | |||
3475 | 531 | } | ||
3476 | 532 | |||
3477 | 533 | class XQueryException extends ZorbaException{ | ||
3478 | 534 | public $_cPtr=null; | ||
3479 | 535 | |||
3480 | 536 | public function getColumnBegin() { | ||
3481 | 537 | $r = XQueryException_getColumnBegin($this->_cPtr); | ||
3482 | 538 | return $r; | ||
3483 | 539 | |||
3484 | 540 | } | ||
3485 | 541 | |||
3486 | 542 | public function getLineBegin() { | ||
3487 | 543 | $r = XQueryException_getLineBegin($this->_cPtr); | ||
3488 | 544 | return $r; | ||
3489 | 545 | |||
3490 | 546 | } | ||
3491 | 547 | |||
3492 | 548 | public function getQueryURI() { | ||
3493 | 549 | $r = XQueryException_getQueryURI($this->_cPtr); | ||
3494 | 550 | return $r; | ||
3495 | 551 | |||
3496 | 552 | } | ||
3497 | 553 | |||
3498 | 554 | } | ||
3499 | 555 | |||
3500 | 556 | class CompilerHints{ | ||
3501 | 557 | public $_cPtr=null; | ||
3502 | 558 | |||
3503 | 559 | public function __set($var, $value) { | ||
3504 | 560 | $r = CompilerHints___set($this->_cPtr, $var, $value); | ||
3505 | 561 | return $r; | ||
3506 | 562 | |||
3507 | 563 | } | ||
3508 | 564 | |||
3509 | 565 | public function __isset($var) { | ||
3510 | 566 | $r = CompilerHints___isset($this->_cPtr, $var); | ||
3511 | 567 | return $r; | ||
3512 | 568 | |||
3513 | 569 | } | ||
3514 | 570 | |||
3515 | 571 | public function __get($var) { | ||
3516 | 572 | $r = CompilerHints___get($this->_cPtr, $var); | ||
3517 | 573 | return $r; | ||
3518 | 574 | |||
3519 | 575 | } | ||
3520 | 576 | |||
3521 | 577 | public function getLibModule() { | ||
3522 | 578 | $r = CompilerHints_getLibModule($this->_cPtr); | ||
3523 | 579 | return $r; | ||
3524 | 580 | |||
3525 | 581 | } | ||
3526 | 582 | |||
3527 | 583 | public function setLibModule($aLibModule) { | ||
3528 | 584 | $r = CompilerHints_setLibModule($this->_cPtr, $aLibModule); | ||
3529 | 585 | return $r; | ||
3530 | 586 | |||
3531 | 587 | } | ||
3532 | 588 | |||
3533 | 589 | public function getOptimizationLevel() { | ||
3534 | 590 | $r = CompilerHints_getOptimizationLevel($this->_cPtr); | ||
3535 | 591 | return $r; | ||
3536 | 592 | |||
3537 | 593 | } | ||
3538 | 594 | |||
3539 | 595 | public function setOptimizationLevel($aOptLevel) { | ||
3540 | 596 | $r = CompilerHints_setOptimizationLevel($this->_cPtr, $aOptLevel); | ||
3541 | 597 | return $r; | ||
3542 | 598 | |||
3543 | 599 | } | ||
3544 | 600 | |||
3545 | 601 | public function __construct($ptr) { | ||
3546 | 602 | $this->_cPtr = $ptr; | ||
3547 | 603 | } | ||
3548 | 604 | |||
3549 | 605 | } | ||
3550 | 606 | |||
3551 | 607 | class StaticContext{ | ||
3552 | 608 | public $_cPtr=null; | ||
3553 | 609 | |||
3554 | 610 | public function __set($var, $value) { | ||
3555 | 611 | $r = StaticContext___set($this->_cPtr, $var, $value); | ||
3556 | 612 | return $r; | ||
3557 | 613 | |||
3558 | 614 | } | ||
3559 | 615 | |||
3560 | 616 | public function __isset($var) { | ||
3561 | 617 | $r = StaticContext___isset($this->_cPtr, $var); | ||
3562 | 618 | return $r; | ||
3563 | 619 | |||
3564 | 620 | } | ||
3565 | 621 | |||
3566 | 622 | public function __get($var) { | ||
3567 | 623 | $r = StaticContext___get($this->_cPtr, $var); | ||
3568 | 624 | return $r; | ||
3569 | 625 | |||
3570 | 626 | } | ||
3571 | 627 | |||
3572 | 628 | public function __construct($ptr) { | ||
3573 | 629 | $this->_cPtr = $ptr; | ||
3574 | 630 | } | ||
3575 | 631 | |||
3576 | 632 | public function addColation($aURI) { | ||
3577 | 633 | $r = StaticContext_addColation($this->_cPtr, $aURI); | ||
3578 | 634 | return $r; | ||
3579 | 635 | |||
3580 | 636 | } | ||
3581 | 637 | |||
3582 | 638 | public function addNamespace($aPrefix, $aURI) { | ||
3583 | 639 | $r = StaticContext_addNamespace($this->_cPtr, $aPrefix, $aURI); | ||
3584 | 640 | return $r; | ||
3585 | 641 | |||
3586 | 642 | } | ||
3587 | 643 | |||
3588 | 644 | public function addReference() { | ||
3589 | 645 | $r = StaticContext_addReference($this->_cPtr); | ||
3590 | 646 | return $r; | ||
3591 | 647 | |||
3592 | 648 | } | ||
3593 | 649 | |||
3594 | 650 | public function containsFunction($aFnNameUri, $aFnNameLocal, $arity) { | ||
3595 | 651 | $r = StaticContext_containsFunction($this->_cPtr, $aFnNameUri, $aFnNameLocal, $arity); | ||
3596 | 652 | return $r; | ||
3597 | 653 | |||
3598 | 654 | } | ||
3599 | 655 | |||
3600 | 656 | public function createChildContext() { | ||
3601 | 657 | $r = StaticContext_createChildContext($this->_cPtr); | ||
3602 | 658 | return is_resource($r) ? new StaticContext($r) : $r; | ||
3603 | 659 | |||
3604 | 660 | } | ||
3605 | 661 | |||
3606 | 662 | public function declareOption($aQName, $aOptionVal) { | ||
3607 | 663 | $r = StaticContext_declareOption($this->_cPtr, $aQName, $aOptionVal); | ||
3608 | 664 | return $r; | ||
3609 | 665 | |||
3610 | 666 | } | ||
3611 | 667 | |||
3612 | 668 | public function disableFunction($aQName, $arity) { | ||
3613 | 669 | $r = StaticContext_disableFunction($this->_cPtr, $aQName, $arity); | ||
3614 | 670 | return $r; | ||
3615 | 671 | |||
3616 | 672 | } | ||
3617 | 673 | |||
3618 | 674 | public function free() { | ||
3619 | 675 | $r = StaticContext_free($this->_cPtr); | ||
3620 | 676 | return $r; | ||
3621 | 677 | |||
3622 | 678 | } | ||
3623 | 679 | |||
3624 | 680 | public function getBaseURI() { | ||
3625 | 681 | $r = StaticContext_getBaseURI($this->_cPtr); | ||
3626 | 682 | return $r; | ||
3627 | 683 | |||
3628 | 684 | } | ||
3629 | 685 | |||
3630 | 686 | public function getBoundarySpacePolicy() { | ||
3631 | 687 | $r = StaticContext_getBoundarySpacePolicy($this->_cPtr); | ||
3632 | 688 | return $r; | ||
3633 | 689 | |||
3634 | 690 | } | ||
3635 | 691 | |||
3636 | 692 | public function getConstructionMode() { | ||
3637 | 693 | $r = StaticContext_getConstructionMode($this->_cPtr); | ||
3638 | 694 | return $r; | ||
3639 | 695 | |||
3640 | 696 | } | ||
3641 | 697 | |||
3642 | 698 | public function getCopyNamespacesMode($aPreserve, $aInherit) { | ||
3643 | 699 | $r = StaticContext_getCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit); | ||
3644 | 700 | return $r; | ||
3645 | 701 | |||
3646 | 702 | } | ||
3647 | 703 | |||
3648 | 704 | public function getDefaultCollation() { | ||
3649 | 705 | $r = StaticContext_getDefaultCollation($this->_cPtr); | ||
3650 | 706 | return $r; | ||
3651 | 707 | |||
3652 | 708 | } | ||
3653 | 709 | |||
3654 | 710 | public function getDefaultElementAndTypeNamespace() { | ||
3655 | 711 | $r = StaticContext_getDefaultElementAndTypeNamespace($this->_cPtr); | ||
3656 | 712 | return $r; | ||
3657 | 713 | |||
3658 | 714 | } | ||
3659 | 715 | |||
3660 | 716 | public function getDefaultFunctionNamespace() { | ||
3661 | 717 | $r = StaticContext_getDefaultFunctionNamespace($this->_cPtr); | ||
3662 | 718 | return $r; | ||
3663 | 719 | |||
3664 | 720 | } | ||
3665 | 721 | |||
3666 | 722 | public function getDefaultOrderForEmptySequences() { | ||
3667 | 723 | $r = StaticContext_getDefaultOrderForEmptySequences($this->_cPtr); | ||
3668 | 724 | return $r; | ||
3669 | 725 | |||
3670 | 726 | } | ||
3671 | 727 | |||
3672 | 728 | public function getNamespaceURIByPrefix($aPrefix) { | ||
3673 | 729 | $r = StaticContext_getNamespaceURIByPrefix($this->_cPtr, $aPrefix); | ||
3674 | 730 | return $r; | ||
3675 | 731 | |||
3676 | 732 | } | ||
3677 | 733 | |||
3678 | 734 | public function getOption($aQName, $aOptionValue) { | ||
3679 | 735 | $r = StaticContext_getOption($this->_cPtr, $aQName, $aOptionValue); | ||
3680 | 736 | return $r; | ||
3681 | 737 | |||
3682 | 738 | } | ||
3683 | 739 | |||
3684 | 740 | public function getOrderingMode() { | ||
3685 | 741 | $r = StaticContext_getOrderingMode($this->_cPtr); | ||
3686 | 742 | return $r; | ||
3687 | 743 | |||
3688 | 744 | } | ||
3689 | 745 | |||
3690 | 746 | public function getRefCount() { | ||
3691 | 747 | $r = StaticContext_getRefCount($this->_cPtr); | ||
3692 | 748 | return $r; | ||
3693 | 749 | |||
3694 | 750 | } | ||
3695 | 751 | |||
3696 | 752 | public function getRevalidationMode() { | ||
3697 | 753 | $r = StaticContext_getRevalidationMode($this->_cPtr); | ||
3698 | 754 | return $r; | ||
3699 | 755 | |||
3700 | 756 | } | ||
3701 | 757 | |||
3702 | 758 | public function getXPath1_0CompatibMode() { | ||
3703 | 759 | $r = StaticContext_getXPath1_0CompatibMode($this->_cPtr); | ||
3704 | 760 | return $r; | ||
3705 | 761 | |||
3706 | 762 | } | ||
3707 | 763 | |||
3708 | 764 | public function loadProlog($aProlog, $hints) { | ||
3709 | 765 | $r = StaticContext_loadProlog($this->_cPtr, $aProlog, $hints); | ||
3710 | 766 | return $r; | ||
3711 | 767 | |||
3712 | 768 | } | ||
3713 | 769 | |||
3714 | 770 | public function removeReference() { | ||
3715 | 771 | $r = StaticContext_removeReference($this->_cPtr); | ||
3716 | 772 | return $r; | ||
3717 | 773 | |||
3718 | 774 | } | ||
3719 | 775 | |||
3720 | 776 | public function resetTraceStream() { | ||
3721 | 777 | $r = StaticContext_resetTraceStream($this->_cPtr); | ||
3722 | 778 | return $r; | ||
3723 | 779 | |||
3724 | 780 | } | ||
3725 | 781 | |||
3726 | 782 | public function setBaseURI($aBaseURI) { | ||
3727 | 783 | $r = StaticContext_setBaseURI($this->_cPtr, $aBaseURI); | ||
3728 | 784 | return $r; | ||
3729 | 785 | |||
3730 | 786 | } | ||
3731 | 787 | |||
3732 | 788 | public function setBoundarySpacePolicy($aMode) { | ||
3733 | 789 | $r = StaticContext_setBoundarySpacePolicy($this->_cPtr, $aMode); | ||
3734 | 790 | return $r; | ||
3735 | 791 | |||
3736 | 792 | } | ||
3737 | 793 | |||
3738 | 794 | public function setConstructionMode($aMode) { | ||
3739 | 795 | $r = StaticContext_setConstructionMode($this->_cPtr, $aMode); | ||
3740 | 796 | return $r; | ||
3741 | 797 | |||
3742 | 798 | } | ||
3743 | 799 | |||
3744 | 800 | public function setCopyNamespacesMode($aPreserve, $aInherit) { | ||
3745 | 801 | $r = StaticContext_setCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit); | ||
3746 | 802 | return $r; | ||
3747 | 803 | |||
3748 | 804 | } | ||
3749 | 805 | |||
3750 | 806 | public function setDefaultCollation($aURI) { | ||
3751 | 807 | $r = StaticContext_setDefaultCollation($this->_cPtr, $aURI); | ||
3752 | 808 | return $r; | ||
3753 | 809 | |||
3754 | 810 | } | ||
3755 | 811 | |||
3756 | 812 | public function setDefaultElementAndTypeNamespace($aURI) { | ||
3757 | 813 | $r = StaticContext_setDefaultElementAndTypeNamespace($this->_cPtr, $aURI); | ||
3758 | 814 | return $r; | ||
3759 | 815 | |||
3760 | 816 | } | ||
3761 | 817 | |||
3762 | 818 | public function setDefaultFunctionNamespace($aURI) { | ||
3763 | 819 | $r = StaticContext_setDefaultFunctionNamespace($this->_cPtr, $aURI); | ||
3764 | 820 | return $r; | ||
3765 | 821 | |||
3766 | 822 | } | ||
3767 | 823 | |||
3768 | 824 | public function setDefaultOrderForEmptySequences($aMode) { | ||
3769 | 825 | $r = StaticContext_setDefaultOrderForEmptySequences($this->_cPtr, $aMode); | ||
3770 | 826 | return $r; | ||
3771 | 827 | |||
3772 | 828 | } | ||
3773 | 829 | |||
3774 | 830 | public function setOrderingMode($aMode) { | ||
3775 | 831 | $r = StaticContext_setOrderingMode($this->_cPtr, $aMode); | ||
3776 | 832 | return $r; | ||
3777 | 833 | |||
3778 | 834 | } | ||
3779 | 835 | |||
3780 | 836 | public function setRevalidationMode($aMode) { | ||
3781 | 837 | $r = StaticContext_setRevalidationMode($this->_cPtr, $aMode); | ||
3782 | 838 | return $r; | ||
3783 | 839 | |||
3784 | 840 | } | ||
3785 | 841 | |||
3786 | 842 | public function setXPath1_0CompatibMode($aMode) { | ||
3787 | 843 | $r = StaticContext_setXPath1_0CompatibMode($this->_cPtr, $aMode); | ||
3788 | 844 | return $r; | ||
3789 | 845 | |||
3790 | 846 | } | ||
3791 | 847 | |||
3792 | 848 | public function destroy() { | ||
3793 | 849 | $r = StaticContext_destroy($this->_cPtr); | ||
3794 | 850 | return $r; | ||
3795 | 851 | |||
3796 | 852 | } | ||
3797 | 853 | |||
3798 | 854 | } | ||
3799 | 855 | |||
3800 | 856 | class Zorba{ | ||
3801 | 857 | public $_cPtr=null; | ||
3802 | 858 | |||
3803 | 859 | public function __set($var, $value) { | ||
3804 | 860 | $r = Zorba___set($this->_cPtr, $var, $value); | ||
3805 | 861 | return $r; | ||
3806 | 862 | |||
3807 | 863 | } | ||
3808 | 864 | |||
3809 | 865 | public function __isset($var) { | ||
3810 | 866 | $r = Zorba___isset($this->_cPtr, $var); | ||
3811 | 867 | return $r; | ||
3812 | 868 | |||
3813 | 869 | } | ||
3814 | 870 | |||
3815 | 871 | public function __get($var) { | ||
3816 | 872 | $r = Zorba___get($this->_cPtr, $var); | ||
3817 | 873 | return $r; | ||
3818 | 874 | |||
3819 | 875 | } | ||
3820 | 876 | |||
3821 | 877 | static public function getInstance($arg1) { | ||
3822 | 878 | $r = Zorba_getInstance($arg1); | ||
3823 | 879 | return is_resource($r) ? new Zorba($r) : $r; | ||
3824 | 880 | |||
3825 | 881 | } | ||
3826 | 882 | |||
3827 | 883 | public function createStaticContext() { | ||
3828 | 884 | $r = Zorba_createStaticContext($this->_cPtr); | ||
3829 | 885 | return is_resource($r) ? new StaticContext($r) : $r; | ||
3830 | 886 | |||
3831 | 887 | } | ||
3832 | 888 | |||
3833 | 889 | public function createQuery() { | ||
3834 | 890 | $r = Zorba_createQuery($this->_cPtr); | ||
3835 | 891 | return is_resource($r) ? new XQuery($r) : $r; | ||
3836 | 892 | |||
3837 | 893 | } | ||
3838 | 894 | |||
3839 | 895 | public function compileQuery($aStr, $aStaticContext=null) { | ||
3840 | 896 | switch(func_num_args()) { | ||
3841 | 897 | case 1: $r = Zorba_compileQuery($this->_cPtr, $aStr);break; | ||
3842 | 898 | case 2: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);break; | ||
3843 | 899 | default: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext); | ||
3844 | 900 | } | ||
3845 | 901 | return is_resource($r) ? new XQuery($r) : $r; | ||
3846 | 902 | |||
3847 | 903 | } | ||
3848 | 904 | |||
3849 | 905 | public function getItemFactory() { | ||
3850 | 906 | $r = Zorba_getItemFactory($this->_cPtr); | ||
3851 | 907 | return is_resource($r) ? new ItemFactory($r) : $r; | ||
3852 | 908 | |||
3853 | 909 | } | ||
3854 | 910 | |||
3855 | 911 | public function getXmlDataManager() { | ||
3856 | 912 | $r = Zorba_getXmlDataManager($this->_cPtr); | ||
3857 | 913 | return is_resource($r) ? new XmlDataManager($r) : $r; | ||
3858 | 914 | |||
3859 | 915 | } | ||
3860 | 916 | |||
3861 | 917 | public function shutdown() { | ||
3862 | 918 | $r = Zorba_shutdown($this->_cPtr); | ||
3863 | 919 | return $r; | ||
3864 | 920 | |||
3865 | 921 | } | ||
3866 | 922 | |||
3867 | 923 | public function __construct($ptr) { | ||
3868 | 924 | $this->_cPtr = $ptr; | ||
3869 | 925 | } | ||
3870 | 926 | |||
3871 | 927 | } | ||
3872 | 928 | |||
3873 | 929 | class ItemFactory{ | ||
3874 | 930 | public $_cPtr=null; | ||
3875 | 931 | |||
3876 | 932 | public function __set($var, $value) { | ||
3877 | 933 | $r = ItemFactory___set($this->_cPtr, $var, $value); | ||
3878 | 934 | return $r; | ||
3879 | 935 | |||
3880 | 936 | } | ||
3881 | 937 | |||
3882 | 938 | public function __isset($var) { | ||
3883 | 939 | $r = ItemFactory___isset($this->_cPtr, $var); | ||
3884 | 940 | return $r; | ||
3885 | 941 | |||
3886 | 942 | } | ||
3887 | 943 | |||
3888 | 944 | public function __get($var) { | ||
3889 | 945 | $r = ItemFactory___get($this->_cPtr, $var); | ||
3890 | 946 | return $r; | ||
3891 | 947 | |||
3892 | 948 | } | ||
3893 | 949 | |||
3894 | 950 | public function __construct($ptr) { | ||
3895 | 951 | $this->_cPtr = $ptr; | ||
3896 | 952 | } | ||
3897 | 953 | |||
3898 | 954 | public function createAnyURI($aURI) { | ||
3899 | 955 | $r = ItemFactory_createAnyURI($this->_cPtr, $aURI); | ||
3900 | 956 | return is_resource($r) ? new Item($r) : $r; | ||
3901 | 957 | |||
3902 | 958 | } | ||
3903 | 959 | |||
3904 | 960 | public function createAttributeNode($aParent, $aNodeName, $aTypeName, $aTypedValue) { | ||
3905 | 961 | $r = ItemFactory_createAttributeNode($this->_cPtr, $aParent, $aNodeName, $aTypeName, $aTypedValue); | ||
3906 | 962 | return is_resource($r) ? new Item($r) : $r; | ||
3907 | 963 | |||
3908 | 964 | } | ||
3909 | 965 | |||
3910 | 966 | public function createBase64Binary($aBinData_or_aStream, $aLength=null) { | ||
3911 | 967 | switch(func_num_args()) { | ||
3912 | 968 | case 1: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream);break; | ||
3913 | 969 | case 2: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);break; | ||
3914 | 970 | default: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength); | ||
3915 | 971 | } | ||
3916 | 972 | return is_resource($r) ? new Item($r) : $r; | ||
3917 | 973 | |||
3918 | 974 | } | ||
3919 | 975 | |||
3920 | 976 | public function createBoolean($aValue) { | ||
3921 | 977 | $r = ItemFactory_createBoolean($this->_cPtr, $aValue); | ||
3922 | 978 | return is_resource($r) ? new Item($r) : $r; | ||
3923 | 979 | |||
3924 | 980 | } | ||
3925 | 981 | |||
3926 | 982 | public function createByte($aByte) { | ||
3927 | 983 | $r = ItemFactory_createByte($this->_cPtr, $aByte); | ||
3928 | 984 | return is_resource($r) ? new Item($r) : $r; | ||
3929 | 985 | |||
3930 | 986 | } | ||
3931 | 987 | |||
3932 | 988 | public function createDate($aDate_or_aYear, $aMonth=null, $aDay=null) { | ||
3933 | 989 | switch(func_num_args()) { | ||
3934 | 990 | case 1: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear);break; | ||
3935 | 991 | case 2: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth);break; | ||
3936 | 992 | case 3: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);break; | ||
3937 | 993 | default: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay); | ||
3938 | 994 | } | ||
3939 | 995 | return is_resource($r) ? new Item($r) : $r; | ||
3940 | 996 | |||
3941 | 997 | } | ||
3942 | 998 | |||
3943 | 999 | public function createDateTime($aDateTimeValue_or_aYear, $aMonth=null, $aDay=null, $aHour=null, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) { | ||
3944 | 1000 | switch(func_num_args()) { | ||
3945 | 1001 | case 1: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear);break; | ||
3946 | 1002 | case 2: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth);break; | ||
3947 | 1003 | case 3: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay);break; | ||
3948 | 1004 | case 4: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour);break; | ||
3949 | 1005 | case 5: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute);break; | ||
3950 | 1006 | case 6: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond);break; | ||
3951 | 1007 | case 7: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);break; | ||
3952 | 1008 | default: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours); | ||
3953 | 1009 | } | ||
3954 | 1010 | return is_resource($r) ? new Item($r) : $r; | ||
3955 | 1011 | |||
3956 | 1012 | } | ||
3957 | 1013 | |||
3958 | 1014 | public function createDecimal($aValue) { | ||
3959 | 1015 | $r = ItemFactory_createDecimal($this->_cPtr, $aValue); | ||
3960 | 1016 | return is_resource($r) ? new Item($r) : $r; | ||
3961 | 1017 | |||
3962 | 1018 | } | ||
3963 | 1019 | |||
3964 | 1020 | public function createDecimalFromDouble($aValue) { | ||
3965 | 1021 | $r = ItemFactory_createDecimalFromDouble($this->_cPtr, $aValue); | ||
3966 | 1022 | return is_resource($r) ? new Item($r) : $r; | ||
3967 | 1023 | |||
3968 | 1024 | } | ||
3969 | 1025 | |||
3970 | 1026 | public function createDecimalFromLong($aValue) { | ||
3971 | 1027 | $r = ItemFactory_createDecimalFromLong($this->_cPtr, $aValue); | ||
3972 | 1028 | return is_resource($r) ? new Item($r) : $r; | ||
3973 | 1029 | |||
3974 | 1030 | } | ||
3975 | 1031 | |||
3976 | 1032 | public function createDouble($aValue) { | ||
3977 | 1033 | $r = ItemFactory_createDouble($this->_cPtr, $aValue); | ||
3978 | 1034 | return is_resource($r) ? new Item($r) : $r; | ||
3979 | 1035 | |||
3980 | 1036 | } | ||
3981 | 1037 | |||
3982 | 1038 | public function createDuration($aValue_or_aYear, $aMonths=null, $aDays=null, $aHours=null, $aMinutes=null, $aSeconds=null) { | ||
3983 | 1039 | switch(func_num_args()) { | ||
3984 | 1040 | case 1: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear);break; | ||
3985 | 1041 | case 2: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths);break; | ||
3986 | 1042 | case 3: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays);break; | ||
3987 | 1043 | case 4: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours);break; | ||
3988 | 1044 | case 5: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes);break; | ||
3989 | 1045 | case 6: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);break; | ||
3990 | 1046 | default: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds); | ||
3991 | 1047 | } | ||
3992 | 1048 | return is_resource($r) ? new Item($r) : $r; | ||
3993 | 1049 | |||
3994 | 1050 | } | ||
3995 | 1051 | |||
3996 | 1052 | public function createFloat($aValue) { | ||
3997 | 1053 | $r = ItemFactory_createFloat($this->_cPtr, $aValue); | ||
3998 | 1054 | return is_resource($r) ? new Item($r) : $r; | ||
3999 | 1055 | |||
4000 | 1056 | } | ||
4001 | 1057 | |||
4002 | 1058 | public function createGDay($aValue_or_aDay) { | ||
4003 | 1059 | $r = ItemFactory_createGDay($this->_cPtr, $aValue_or_aDay); | ||
4004 | 1060 | return is_resource($r) ? new Item($r) : $r; | ||
4005 | 1061 | |||
4006 | 1062 | } | ||
4007 | 1063 | |||
4008 | 1064 | public function createGMonth($aValue_or_aMonth) { | ||
4009 | 1065 | $r = ItemFactory_createGMonth($this->_cPtr, $aValue_or_aMonth); | ||
4010 | 1066 | return is_resource($r) ? new Item($r) : $r; | ||
4011 | 1067 | |||
4012 | 1068 | } | ||
4013 | 1069 | |||
4014 | 1070 | public function createGMonthDay($aValue_or_aMonth, $aDay=null) { | ||
4015 | 1071 | switch(func_num_args()) { | ||
4016 | 1072 | case 1: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth);break; | ||
4017 | 1073 | case 2: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);break; | ||
4018 | 1074 | default: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay); | ||
4019 | 1075 | } | ||
4020 | 1076 | return is_resource($r) ? new Item($r) : $r; | ||
4021 | 1077 | |||
4022 | 1078 | } | ||
4023 | 1079 | |||
4024 | 1080 | public function createGYear($aYear_or_aValue) { | ||
4025 | 1081 | $r = ItemFactory_createGYear($this->_cPtr, $aYear_or_aValue); | ||
4026 | 1082 | return is_resource($r) ? new Item($r) : $r; | ||
4027 | 1083 | |||
4028 | 1084 | } | ||
4029 | 1085 | |||
4030 | 1086 | public function createGYearMonth($aValue_or_aYear, $aMonth=null) { | ||
4031 | 1087 | switch(func_num_args()) { | ||
4032 | 1088 | case 1: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear);break; | ||
4033 | 1089 | case 2: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);break; | ||
4034 | 1090 | default: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth); | ||
4035 | 1091 | } | ||
4036 | 1092 | return is_resource($r) ? new Item($r) : $r; | ||
4037 | 1093 | |||
4038 | 1094 | } | ||
4039 | 1095 | |||
4040 | 1096 | public function createHexBinary($aHexData, $aSize) { | ||
4041 | 1097 | $r = ItemFactory_createHexBinary($this->_cPtr, $aHexData, $aSize); | ||
4042 | 1098 | return is_resource($r) ? new Item($r) : $r; | ||
4043 | 1099 | |||
4044 | 1100 | } | ||
4045 | 1101 | |||
4046 | 1102 | public function createInt($aInt) { | ||
4047 | 1103 | $r = ItemFactory_createInt($this->_cPtr, $aInt); | ||
4048 | 1104 | return is_resource($r) ? new Item($r) : $r; | ||
4049 | 1105 | |||
4050 | 1106 | } | ||
4051 | 1107 | |||
4052 | 1108 | public function createInteger($aInteger) { | ||
4053 | 1109 | $r = ItemFactory_createInteger($this->_cPtr, (string)$aInteger); | ||
4054 | 1110 | return is_resource($r) ? new Item($r) : $r; | ||
4055 | 1111 | |||
4056 | 1112 | } | ||
4057 | 1113 | |||
4058 | 1114 | public function createLong($aLong) { | ||
4059 | 1115 | $r = ItemFactory_createLong($this->_cPtr, $aLong); | ||
4060 | 1116 | return is_resource($r) ? new Item($r) : $r; | ||
4061 | 1117 | |||
4062 | 1118 | } | ||
4063 | 1119 | |||
4064 | 1120 | public function createNCName($aValue) { | ||
4065 | 1121 | $r = ItemFactory_createNCName($this->_cPtr, $aValue); | ||
4066 | 1122 | return is_resource($r) ? new Item($r) : $r; | ||
4067 | 1123 | |||
4068 | 1124 | } | ||
4069 | 1125 | |||
4070 | 1126 | public function createNegativeInteger($aValue) { | ||
4071 | 1127 | $r = ItemFactory_createNegativeInteger($this->_cPtr, $aValue); | ||
4072 | 1128 | return is_resource($r) ? new Item($r) : $r; | ||
4073 | 1129 | |||
4074 | 1130 | } | ||
4075 | 1131 | |||
4076 | 1132 | public function createNonNegativeInteger($aValue) { | ||
4077 | 1133 | $r = ItemFactory_createNonNegativeInteger($this->_cPtr, $aValue); | ||
4078 | 1134 | return is_resource($r) ? new Item($r) : $r; | ||
4079 | 1135 | |||
4080 | 1136 | } | ||
4081 | 1137 | |||
4082 | 1138 | public function createNonPositiveInteger($aValue) { | ||
4083 | 1139 | $r = ItemFactory_createNonPositiveInteger($this->_cPtr, $aValue); | ||
4084 | 1140 | return is_resource($r) ? new Item($r) : $r; | ||
4085 | 1141 | |||
4086 | 1142 | } | ||
4087 | 1143 | |||
4088 | 1144 | public function createPositiveInteger($aValue) { | ||
4089 | 1145 | $r = ItemFactory_createPositiveInteger($this->_cPtr, $aValue); | ||
4090 | 1146 | return is_resource($r) ? new Item($r) : $r; | ||
4091 | 1147 | |||
4092 | 1148 | } | ||
4093 | 1149 | |||
4094 | 1150 | public function createQName($aNamespace_or_aQNameString, $aPrefix_or_aLocalname=null, $aLocalname=null) { | ||
4095 | 1151 | switch(func_num_args()) { | ||
4096 | 1152 | case 1: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString);break; | ||
4097 | 1153 | case 2: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname);break; | ||
4098 | 1154 | case 3: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);break; | ||
4099 | 1155 | default: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname); | ||
4100 | 1156 | } | ||
4101 | 1157 | return is_resource($r) ? new Item($r) : $r; | ||
4102 | 1158 | |||
4103 | 1159 | } | ||
4104 | 1160 | |||
4105 | 1161 | public function createShort($aShort) { | ||
4106 | 1162 | $r = ItemFactory_createShort($this->_cPtr, $aShort); | ||
4107 | 1163 | return is_resource($r) ? new Item($r) : $r; | ||
4108 | 1164 | |||
4109 | 1165 | } | ||
4110 | 1166 | |||
4111 | 1167 | public function createString($aString) { | ||
4112 | 1168 | $r = ItemFactory_createString($this->_cPtr, $aString); | ||
4113 | 1169 | return is_resource($r) ? new Item($r) : $r; | ||
4114 | 1170 | |||
4115 | 1171 | } | ||
4116 | 1172 | |||
4117 | 1173 | public function createTextNode($parent, $content) { | ||
4118 | 1174 | $r = ItemFactory_createTextNode($this->_cPtr, $parent, $content); | ||
4119 | 1175 | return is_resource($r) ? new Item($r) : $r; | ||
4120 | 1176 | |||
4121 | 1177 | } | ||
4122 | 1178 | |||
4123 | 1179 | public function createTime($aHour_or_aValue, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) { | ||
4124 | 1180 | switch(func_num_args()) { | ||
4125 | 1181 | case 1: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue);break; | ||
4126 | 1182 | case 2: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute);break; | ||
4127 | 1183 | case 3: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond);break; | ||
4128 | 1184 | case 4: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);break; | ||
4129 | 1185 | default: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours); | ||
4130 | 1186 | } | ||
4131 | 1187 | return is_resource($r) ? new Item($r) : $r; | ||
4132 | 1188 | |||
4133 | 1189 | } | ||
4134 | 1190 | |||
4135 | 1191 | public function createUnsignedByte($aValue) { | ||
4136 | 1192 | $r = ItemFactory_createUnsignedByte($this->_cPtr, $aValue); | ||
4137 | 1193 | return is_resource($r) ? new Item($r) : $r; | ||
4138 | 1194 | |||
4139 | 1195 | } | ||
4140 | 1196 | |||
4141 | 1197 | public function createUnsignedInt($aValue) { | ||
4142 | 1198 | $r = ItemFactory_createUnsignedInt($this->_cPtr, $aValue); | ||
4143 | 1199 | return is_resource($r) ? new Item($r) : $r; | ||
4144 | 1200 | |||
4145 | 1201 | } | ||
4146 | 1202 | |||
4147 | 1203 | public function createUnsignedLong($aValue) { | ||
4148 | 1204 | $r = ItemFactory_createUnsignedLong($this->_cPtr, $aValue); | ||
4149 | 1205 | return is_resource($r) ? new Item($r) : $r; | ||
4150 | 1206 | |||
4151 | 1207 | } | ||
4152 | 1208 | |||
4153 | 1209 | public function createUnsignedShort($aValue) { | ||
4154 | 1210 | $r = ItemFactory_createUnsignedShort($this->_cPtr, $aValue); | ||
4155 | 1211 | return is_resource($r) ? new Item($r) : $r; | ||
4156 | 1212 | |||
4157 | 1213 | } | ||
4158 | 1214 | |||
4159 | 1215 | } | ||
4160 | 1216 | 0 | ||
4161 | === modified file 'swig/python/tests/CMakeLists.txt' | |||
4162 | --- swig/python/tests/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
4163 | +++ swig/python/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000 | |||
4164 | @@ -14,65 +14,66 @@ | |||
4165 | 14 | 14 | ||
4166 | 15 | SET(pythonPath ${CMAKE_BINARY_DIR}/swig/python) | 15 | SET(pythonPath ${CMAKE_BINARY_DIR}/swig/python) |
4167 | 16 | 16 | ||
4170 | 17 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml.in ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY) | 17 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY) |
4171 | 18 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq.in ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY) | 18 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY) |
4172 | 19 | 19 | ||
4174 | 20 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.py.in ${CMAKE_CURRENT_BINARY_DIR}/test01.py) | 20 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.py ${CMAKE_CURRENT_BINARY_DIR}/test01.py) |
4175 | 21 | ADD_TEST("python_test01" ${PYTHON_EXECUTABLE} test01.py) | 21 | ADD_TEST("python_test01" ${PYTHON_EXECUTABLE} test01.py) |
4176 | 22 | SET_TESTS_PROPERTIES("python_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 22 | SET_TESTS_PROPERTIES("python_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4177 | 23 | 23 | ||
4179 | 24 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.py.in ${CMAKE_CURRENT_BINARY_DIR}/test02.py) | 24 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.py ${CMAKE_CURRENT_BINARY_DIR}/test02.py) |
4180 | 25 | ADD_TEST("python_test02" ${PYTHON_EXECUTABLE} test02.py) | 25 | ADD_TEST("python_test02" ${PYTHON_EXECUTABLE} test02.py) |
4181 | 26 | SET_TESTS_PROPERTIES("python_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 26 | SET_TESTS_PROPERTIES("python_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4182 | 27 | 27 | ||
4184 | 28 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.py.in ${CMAKE_CURRENT_BINARY_DIR}/test03.py) | 28 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.py ${CMAKE_CURRENT_BINARY_DIR}/test03.py) |
4185 | 29 | ADD_TEST("python_test03" ${PYTHON_EXECUTABLE} test03.py) | 29 | ADD_TEST("python_test03" ${PYTHON_EXECUTABLE} test03.py) |
4186 | 30 | SET_TESTS_PROPERTIES("python_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 30 | SET_TESTS_PROPERTIES("python_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4187 | 31 | 31 | ||
4189 | 32 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.py.in ${CMAKE_CURRENT_BINARY_DIR}/test04.py) | 32 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.py ${CMAKE_CURRENT_BINARY_DIR}/test04.py) |
4190 | 33 | ADD_TEST("python_test04" ${PYTHON_EXECUTABLE} test04.py) | 33 | ADD_TEST("python_test04" ${PYTHON_EXECUTABLE} test04.py) |
4192 | 34 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY) | 34 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY) |
4193 | 35 | SET_TESTS_PROPERTIES("python_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 35 | SET_TESTS_PROPERTIES("python_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4194 | 36 | 36 | ||
4196 | 37 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.py.in ${CMAKE_CURRENT_BINARY_DIR}/test05.py) | 37 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.py ${CMAKE_CURRENT_BINARY_DIR}/test05.py) |
4197 | 38 | ADD_TEST("python_test05" ${PYTHON_EXECUTABLE} test05.py) | 38 | ADD_TEST("python_test05" ${PYTHON_EXECUTABLE} test05.py) |
4199 | 39 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY) | 39 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY) |
4200 | 40 | SET_TESTS_PROPERTIES("python_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 40 | SET_TESTS_PROPERTIES("python_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4201 | 41 | 41 | ||
4203 | 42 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.py.in ${CMAKE_CURRENT_BINARY_DIR}/test06.py) | 42 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.py ${CMAKE_CURRENT_BINARY_DIR}/test06.py) |
4204 | 43 | ADD_TEST("python_test06" ${PYTHON_EXECUTABLE} test06.py) | 43 | ADD_TEST("python_test06" ${PYTHON_EXECUTABLE} test06.py) |
4206 | 44 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY) | 44 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY) |
4207 | 45 | SET_TESTS_PROPERTIES("python_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 45 | SET_TESTS_PROPERTIES("python_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4208 | 46 | 46 | ||
4210 | 47 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.1.py.in ${CMAKE_CURRENT_BINARY_DIR}/test07.1.py) | 47 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.1.py ${CMAKE_CURRENT_BINARY_DIR}/test07.1.py) |
4211 | 48 | ADD_TEST("python_test07.1" ${PYTHON_EXECUTABLE} test07.1.py) | 48 | ADD_TEST("python_test07.1" ${PYTHON_EXECUTABLE} test07.1.py) |
4213 | 49 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.2.py.in ${CMAKE_CURRENT_BINARY_DIR}/test07.2.py) | 49 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.2.py ${CMAKE_CURRENT_BINARY_DIR}/test07.2.py) |
4214 | 50 | ADD_TEST("python_test07.2" ${PYTHON_EXECUTABLE} test07.2.py) | 50 | ADD_TEST("python_test07.2" ${PYTHON_EXECUTABLE} test07.2.py) |
4215 | 51 | SET_TESTS_PROPERTIES("python_test07.1" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 51 | SET_TESTS_PROPERTIES("python_test07.1" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4216 | 52 | SET_TESTS_PROPERTIES("python_test07.2" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 52 | SET_TESTS_PROPERTIES("python_test07.2" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4217 | 53 | 53 | ||
4219 | 54 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.py.in ${CMAKE_CURRENT_BINARY_DIR}/test08.py) | 54 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.py ${CMAKE_CURRENT_BINARY_DIR}/test08.py) |
4220 | 55 | ADD_TEST("python_test08" ${PYTHON_EXECUTABLE} test08.py) | 55 | ADD_TEST("python_test08" ${PYTHON_EXECUTABLE} test08.py) |
4221 | 56 | SET_TESTS_PROPERTIES("python_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 56 | SET_TESTS_PROPERTIES("python_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4222 | 57 | 57 | ||
4223 | 58 | 58 | ||
4225 | 59 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.py.in ${CMAKE_CURRENT_BINARY_DIR}/test10.py) | 59 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.py ${CMAKE_CURRENT_BINARY_DIR}/test10.py) |
4226 | 60 | ADD_TEST("python_test10" ${PYTHON_EXECUTABLE} test10.py) | 60 | ADD_TEST("python_test10" ${PYTHON_EXECUTABLE} test10.py) |
4227 | 61 | SET_TESTS_PROPERTIES("python_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 61 | SET_TESTS_PROPERTIES("python_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4228 | 62 | 62 | ||
4230 | 63 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.py.in ${CMAKE_CURRENT_BINARY_DIR}/test11.py) | 63 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.py ${CMAKE_CURRENT_BINARY_DIR}/test11.py) |
4231 | 64 | ADD_TEST("python_test11" ${PYTHON_EXECUTABLE} test11.py) | 64 | ADD_TEST("python_test11" ${PYTHON_EXECUTABLE} test11.py) |
4232 | 65 | SET_TESTS_PROPERTIES("python_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 65 | SET_TESTS_PROPERTIES("python_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4233 | 66 | 66 | ||
4243 | 67 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.py.in ${CMAKE_CURRENT_BINARY_DIR}/test12.py) | 67 | # CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY) |
4244 | 68 | #ADD_TEST("python_test12" ${PYTHON_EXECUTABLE} test12.py) | 68 | # CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.py ${CMAKE_CURRENT_BINARY_DIR}/test12.py) |
4245 | 69 | #SET_TESTS_PROPERTIES("python_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 69 | # ADD_TEST("python_test12" ${PYTHON_EXECUTABLE} test12.py) |
4246 | 70 | 70 | # SET_TESTS_PROPERTIES("python_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | |
4247 | 71 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.py.in ${CMAKE_CURRENT_BINARY_DIR}/test13.py) | 71 | |
4248 | 72 | #ADD_TEST("python_test13" ${PYTHON_EXECUTABLE} test13.py) | 72 | # CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.py ${CMAKE_CURRENT_BINARY_DIR}/test13.py) |
4249 | 73 | #SET_TESTS_PROPERTIES("python_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 73 | # ADD_TEST("python_test13" ${PYTHON_EXECUTABLE} test13.py) |
4250 | 74 | 74 | # SET_TESTS_PROPERTIES("python_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | |
4251 | 75 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.py.in ${CMAKE_CURRENT_BINARY_DIR}/test14.py) | 75 | |
4252 | 76 | #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.py ${CMAKE_CURRENT_BINARY_DIR}/test14.py) | ||
4253 | 76 | #ADD_TEST("python_test14" ${PYTHON_EXECUTABLE} test14.py) | 77 | #ADD_TEST("python_test14" ${PYTHON_EXECUTABLE} test14.py) |
4254 | 77 | #SET_TESTS_PROPERTIES("python_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success") | 78 | #SET_TESTS_PROPERTIES("python_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success") |
4255 | 78 | 79 | ||
4256 | 79 | 80 | ||
4257 | === added file 'swig/python/tests/books.xml' | |||
4258 | --- swig/python/tests/books.xml 1970-01-01 00:00:00 +0000 | |||
4259 | +++ swig/python/tests/books.xml 2013-03-27 00:40:33 +0000 | |||
4260 | @@ -0,0 +1,11 @@ | |||
4261 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
4262 | 2 | <books> | ||
4263 | 3 | <book> | ||
4264 | 4 | <title>Book 1</title> | ||
4265 | 5 | <author>Author 1</author> | ||
4266 | 6 | </book> | ||
4267 | 7 | <book featured="YES"> | ||
4268 | 8 | <title>Book 2</title> | ||
4269 | 9 | <author>Author 2</author> | ||
4270 | 10 | </book> | ||
4271 | 11 | </books> | ||
4272 | 0 | 12 | ||
4273 | === removed file 'swig/python/tests/books.xml.in' | |||
4274 | --- swig/python/tests/books.xml.in 2013-02-07 17:24:36 +0000 | |||
4275 | +++ swig/python/tests/books.xml.in 1970-01-01 00:00:00 +0000 | |||
4276 | @@ -1,11 +0,0 @@ | |||
4277 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
4278 | 2 | <books> | ||
4279 | 3 | <book> | ||
4280 | 4 | <title>Book 1</title> | ||
4281 | 5 | <author>Author 1</author> | ||
4282 | 6 | </book> | ||
4283 | 7 | <book featured="YES"> | ||
4284 | 8 | <title>Book 2</title> | ||
4285 | 9 | <author>Author 2</author> | ||
4286 | 10 | </book> | ||
4287 | 11 | </books> | ||
4288 | 12 | 0 | ||
4289 | === added file 'swig/python/tests/compilerHints.xq' | |||
4290 | --- swig/python/tests/compilerHints.xq 1970-01-01 00:00:00 +0000 | |||
4291 | +++ swig/python/tests/compilerHints.xq 2013-03-27 00:40:33 +0000 | |||
4292 | @@ -0,0 +1,4 @@ | |||
4293 | 1 | for tumbling window $w in (2, 4, 6, 8, 10, 12, 14) | ||
4294 | 2 | start at $s when fn:true() | ||
4295 | 3 | only end at $e when $e - $s eq 2 | ||
4296 | 4 | return avg($w) | ||
4297 | 0 | 5 | ||
4298 | === removed file 'swig/python/tests/compilerHints.xq.in' | |||
4299 | --- swig/python/tests/compilerHints.xq.in 2013-02-07 17:24:36 +0000 | |||
4300 | +++ swig/python/tests/compilerHints.xq.in 1970-01-01 00:00:00 +0000 | |||
4301 | @@ -1,4 +0,0 @@ | |||
4302 | 1 | for tumbling window $w in (2, 4, 6, 8, 10, 12, 14) | ||
4303 | 2 | start at $s when fn:true() | ||
4304 | 3 | only end at $e when $e - $s eq 2 | ||
4305 | 4 | return avg($w) | ||
4306 | 5 | 0 | ||
4307 | === added file 'swig/python/tests/satellites.json' | |||
4308 | --- swig/python/tests/satellites.json 1970-01-01 00:00:00 +0000 | |||
4309 | +++ swig/python/tests/satellites.json 2013-03-27 00:40:33 +0000 | |||
4310 | @@ -0,0 +1,17 @@ | |||
4311 | 1 | { | ||
4312 | 2 | "creator" : "Satellites plugin version 0.6.4", | ||
4313 | 3 | "satellites" : { | ||
4314 | 4 | "AAU CUBESAT" : { | ||
4315 | 5 | "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768", | ||
4316 | 6 | "visible" : false | ||
4317 | 7 | }, | ||
4318 | 8 | "AJISAI (EGS)" : { | ||
4319 | 9 | "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696", | ||
4320 | 10 | "visible" : true | ||
4321 | 11 | }, | ||
4322 | 12 | "AKARI (ASTRO-F)" : { | ||
4323 | 13 | "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294", | ||
4324 | 14 | "visible" : true | ||
4325 | 15 | } | ||
4326 | 16 | } | ||
4327 | 17 | } | ||
4328 | 0 | 18 | ||
4329 | === added file 'swig/python/tests/test01.py' | |||
4330 | --- swig/python/tests/test01.py 1970-01-01 00:00:00 +0000 | |||
4331 | +++ swig/python/tests/test01.py 2013-03-27 00:40:33 +0000 | |||
4332 | @@ -0,0 +1,26 @@ | |||
4333 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4334 | 2 | # | ||
4335 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4336 | 4 | # you may not use this file except in compliance with the License. | ||
4337 | 5 | # You may obtain a copy of the License at | ||
4338 | 6 | # | ||
4339 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4340 | 8 | # | ||
4341 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4342 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4343 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4344 | 12 | # See the License for the specific language governing permissions and | ||
4345 | 13 | # limitations under the License. | ||
4346 | 14 | |||
4347 | 15 | import sys | ||
4348 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4349 | 17 | import zorba_api | ||
4350 | 18 | |||
4351 | 19 | print "Running: Get zorba instance and shutdown" | ||
4352 | 20 | |||
4353 | 21 | store = zorba_api.InMemoryStore_getInstance() | ||
4354 | 22 | zorba = zorba_api.Zorba_getInstance(store) | ||
4355 | 23 | zorba.shutdown() | ||
4356 | 24 | zorba_api.InMemoryStore_shutdown(store) | ||
4357 | 25 | |||
4358 | 26 | print "Success" | ||
4359 | 0 | 27 | ||
4360 | === removed file 'swig/python/tests/test01.py.in' | |||
4361 | --- swig/python/tests/test01.py.in 2013-02-07 17:24:36 +0000 | |||
4362 | +++ swig/python/tests/test01.py.in 1970-01-01 00:00:00 +0000 | |||
4363 | @@ -1,26 +0,0 @@ | |||
4364 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4365 | 2 | # | ||
4366 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4367 | 4 | # you may not use this file except in compliance with the License. | ||
4368 | 5 | # You may obtain a copy of the License at | ||
4369 | 6 | # | ||
4370 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4371 | 8 | # | ||
4372 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4373 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4374 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4375 | 12 | # See the License for the specific language governing permissions and | ||
4376 | 13 | # limitations under the License. | ||
4377 | 14 | |||
4378 | 15 | import sys | ||
4379 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4380 | 17 | import zorba_api | ||
4381 | 18 | |||
4382 | 19 | print "Running: Get zorba instance and shutdown" | ||
4383 | 20 | |||
4384 | 21 | store = zorba_api.InMemoryStore_getInstance() | ||
4385 | 22 | zorba = zorba_api.Zorba_getInstance(store) | ||
4386 | 23 | zorba.shutdown() | ||
4387 | 24 | zorba_api.InMemoryStore_shutdown(store) | ||
4388 | 25 | |||
4389 | 26 | print "Success" | ||
4390 | 27 | 0 | ||
4391 | === added file 'swig/python/tests/test02.py' | |||
4392 | --- swig/python/tests/test02.py 1970-01-01 00:00:00 +0000 | |||
4393 | +++ swig/python/tests/test02.py 2013-03-27 00:40:33 +0000 | |||
4394 | @@ -0,0 +1,41 @@ | |||
4395 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4396 | 2 | # | ||
4397 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4398 | 4 | # you may not use this file except in compliance with the License. | ||
4399 | 5 | # You may obtain a copy of the License at | ||
4400 | 6 | # | ||
4401 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4402 | 8 | # | ||
4403 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4404 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4405 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4406 | 12 | # See the License for the specific language governing permissions and | ||
4407 | 13 | # limitations under the License. | ||
4408 | 14 | |||
4409 | 15 | import sys | ||
4410 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4411 | 17 | import zorba_api | ||
4412 | 18 | |||
4413 | 19 | |||
4414 | 20 | def test(zorba): | ||
4415 | 21 | xquery = zorba.compileQuery("(1,2,3,4,5)") | ||
4416 | 22 | iter = xquery.iterator() | ||
4417 | 23 | iter.open() | ||
4418 | 24 | item = zorba_api.Item_createEmptyItem() | ||
4419 | 25 | while iter.next(item): | ||
4420 | 26 | print item.getStringValue() | ||
4421 | 27 | iter.close() | ||
4422 | 28 | iter.destroy() | ||
4423 | 29 | return | ||
4424 | 30 | |||
4425 | 31 | |||
4426 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4427 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4428 | 34 | |||
4429 | 35 | print "Running: Compile query string" | ||
4430 | 36 | test(zorba) | ||
4431 | 37 | print "Success" | ||
4432 | 38 | |||
4433 | 39 | zorba.shutdown() | ||
4434 | 40 | zorba_api.InMemoryStore_shutdown(store) | ||
4435 | 41 | |||
4436 | 0 | 42 | ||
4437 | === removed file 'swig/python/tests/test02.py.in' | |||
4438 | --- swig/python/tests/test02.py.in 2013-02-07 17:24:36 +0000 | |||
4439 | +++ swig/python/tests/test02.py.in 1970-01-01 00:00:00 +0000 | |||
4440 | @@ -1,41 +0,0 @@ | |||
4441 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4442 | 2 | # | ||
4443 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4444 | 4 | # you may not use this file except in compliance with the License. | ||
4445 | 5 | # You may obtain a copy of the License at | ||
4446 | 6 | # | ||
4447 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4448 | 8 | # | ||
4449 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4450 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4451 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4452 | 12 | # See the License for the specific language governing permissions and | ||
4453 | 13 | # limitations under the License. | ||
4454 | 14 | |||
4455 | 15 | import sys | ||
4456 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4457 | 17 | import zorba_api | ||
4458 | 18 | |||
4459 | 19 | |||
4460 | 20 | def test(zorba): | ||
4461 | 21 | xquery = zorba.compileQuery("(1,2,3,4,5)") | ||
4462 | 22 | iter = xquery.iterator() | ||
4463 | 23 | iter.open() | ||
4464 | 24 | item = zorba_api.Item_createEmptyItem() | ||
4465 | 25 | while iter.next(item): | ||
4466 | 26 | print item.getStringValue() | ||
4467 | 27 | iter.close() | ||
4468 | 28 | iter.destroy() | ||
4469 | 29 | return | ||
4470 | 30 | |||
4471 | 31 | |||
4472 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4473 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4474 | 34 | |||
4475 | 35 | print "Running: Compile query string" | ||
4476 | 36 | test(zorba) | ||
4477 | 37 | print "Success" | ||
4478 | 38 | |||
4479 | 39 | zorba.shutdown() | ||
4480 | 40 | zorba_api.InMemoryStore_shutdown(store) | ||
4481 | 41 | |||
4482 | 42 | 0 | ||
4483 | === added file 'swig/python/tests/test03.py' | |||
4484 | --- swig/python/tests/test03.py 1970-01-01 00:00:00 +0000 | |||
4485 | +++ swig/python/tests/test03.py 2013-03-27 00:40:33 +0000 | |||
4486 | @@ -0,0 +1,43 @@ | |||
4487 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4488 | 2 | # | ||
4489 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4490 | 4 | # you may not use this file except in compliance with the License. | ||
4491 | 5 | # You may obtain a copy of the License at | ||
4492 | 6 | # | ||
4493 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4494 | 8 | # | ||
4495 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4496 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4497 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4498 | 12 | # See the License for the specific language governing permissions and | ||
4499 | 13 | # limitations under the License. | ||
4500 | 14 | |||
4501 | 15 | import sys | ||
4502 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4503 | 17 | import zorba_api | ||
4504 | 18 | |||
4505 | 19 | class MyDiagnosticHandler(zorba_api.DiagnosticHandler): | ||
4506 | 20 | def error(self, *args): | ||
4507 | 21 | print "Error args: ", args | ||
4508 | 22 | |||
4509 | 23 | def test(zorba): | ||
4510 | 24 | diagnosticHandler = MyDiagnosticHandler() | ||
4511 | 25 | try: | ||
4512 | 26 | print "Compiling 1 div 0" | ||
4513 | 27 | xquery = zorba.compileQuery("1 div 0", diagnosticHandler) | ||
4514 | 28 | print xquery.execute() | ||
4515 | 29 | except Exception, e: | ||
4516 | 30 | print "Caught error: ", e | ||
4517 | 31 | return | ||
4518 | 32 | |||
4519 | 33 | |||
4520 | 34 | store = zorba_api.InMemoryStore_getInstance() | ||
4521 | 35 | zorba = zorba_api.Zorba_getInstance(store) | ||
4522 | 36 | |||
4523 | 37 | print "Running: Compile query string using Diagnostic Handler" | ||
4524 | 38 | test(zorba) | ||
4525 | 39 | print "Success" | ||
4526 | 40 | |||
4527 | 41 | |||
4528 | 42 | zorba.shutdown() | ||
4529 | 43 | zorba_api.InMemoryStore_shutdown(store) | ||
4530 | 0 | 44 | ||
4531 | === removed file 'swig/python/tests/test03.py.in' | |||
4532 | --- swig/python/tests/test03.py.in 2013-02-07 17:24:36 +0000 | |||
4533 | +++ swig/python/tests/test03.py.in 1970-01-01 00:00:00 +0000 | |||
4534 | @@ -1,43 +0,0 @@ | |||
4535 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4536 | 2 | # | ||
4537 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4538 | 4 | # you may not use this file except in compliance with the License. | ||
4539 | 5 | # You may obtain a copy of the License at | ||
4540 | 6 | # | ||
4541 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4542 | 8 | # | ||
4543 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4544 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4545 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4546 | 12 | # See the License for the specific language governing permissions and | ||
4547 | 13 | # limitations under the License. | ||
4548 | 14 | |||
4549 | 15 | import sys | ||
4550 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4551 | 17 | import zorba_api | ||
4552 | 18 | |||
4553 | 19 | class MyDiagnosticHandler(zorba_api.DiagnosticHandler): | ||
4554 | 20 | def error(self, *args): | ||
4555 | 21 | print "Error args: ", args | ||
4556 | 22 | |||
4557 | 23 | def test(zorba): | ||
4558 | 24 | diagnosticHandler = MyDiagnosticHandler() | ||
4559 | 25 | try: | ||
4560 | 26 | print "Compiling 1 div 0" | ||
4561 | 27 | xquery = zorba.compileQuery("1 div 0", diagnosticHandler) | ||
4562 | 28 | print xquery.execute() | ||
4563 | 29 | except Exception, e: | ||
4564 | 30 | print "Cought error: ", e | ||
4565 | 31 | return | ||
4566 | 32 | |||
4567 | 33 | |||
4568 | 34 | store = zorba_api.InMemoryStore_getInstance() | ||
4569 | 35 | zorba = zorba_api.Zorba_getInstance(store) | ||
4570 | 36 | |||
4571 | 37 | print "Running: Compile query string using Diagnostic Handler" | ||
4572 | 38 | test(zorba) | ||
4573 | 39 | print "Success" | ||
4574 | 40 | |||
4575 | 41 | |||
4576 | 42 | zorba.shutdown() | ||
4577 | 43 | zorba_api.InMemoryStore_shutdown(store) | ||
4578 | 44 | 0 | ||
4579 | === added file 'swig/python/tests/test04.py' | |||
4580 | --- swig/python/tests/test04.py 1970-01-01 00:00:00 +0000 | |||
4581 | +++ swig/python/tests/test04.py 2013-03-27 00:40:33 +0000 | |||
4582 | @@ -0,0 +1,42 @@ | |||
4583 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4584 | 2 | # | ||
4585 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4586 | 4 | # you may not use this file except in compliance with the License. | ||
4587 | 5 | # You may obtain a copy of the License at | ||
4588 | 6 | # | ||
4589 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4590 | 8 | # | ||
4591 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4592 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4593 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4594 | 12 | # See the License for the specific language governing permissions and | ||
4595 | 13 | # limitations under the License. | ||
4596 | 14 | |||
4597 | 15 | import sys | ||
4598 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4599 | 17 | import zorba_api | ||
4600 | 18 | |||
4601 | 19 | |||
4602 | 20 | def test(zorba): | ||
4603 | 21 | #Read and write result | ||
4604 | 22 | print 'Executing: test04.xq' | ||
4605 | 23 | f = open('test04.xq', 'r') | ||
4606 | 24 | lines = f.read() | ||
4607 | 25 | f.close() | ||
4608 | 26 | xquery = zorba.compileQuery(lines) | ||
4609 | 27 | result = xquery.execute() | ||
4610 | 28 | print result | ||
4611 | 29 | return | ||
4612 | 30 | |||
4613 | 31 | |||
4614 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4615 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4616 | 34 | |||
4617 | 35 | print "Running: XQuery execute" | ||
4618 | 36 | test(zorba) | ||
4619 | 37 | print "Success" | ||
4620 | 38 | |||
4621 | 39 | |||
4622 | 40 | zorba.shutdown() | ||
4623 | 41 | zorba_api.InMemoryStore_shutdown(store) | ||
4624 | 42 | |||
4625 | 0 | 43 | ||
4626 | === removed file 'swig/python/tests/test04.py.in' | |||
4627 | --- swig/python/tests/test04.py.in 2013-02-07 17:24:36 +0000 | |||
4628 | +++ swig/python/tests/test04.py.in 1970-01-01 00:00:00 +0000 | |||
4629 | @@ -1,42 +0,0 @@ | |||
4630 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4631 | 2 | # | ||
4632 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4633 | 4 | # you may not use this file except in compliance with the License. | ||
4634 | 5 | # You may obtain a copy of the License at | ||
4635 | 6 | # | ||
4636 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4637 | 8 | # | ||
4638 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4639 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4640 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4641 | 12 | # See the License for the specific language governing permissions and | ||
4642 | 13 | # limitations under the License. | ||
4643 | 14 | |||
4644 | 15 | import sys | ||
4645 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4646 | 17 | import zorba_api | ||
4647 | 18 | |||
4648 | 19 | |||
4649 | 20 | def test(zorba): | ||
4650 | 21 | #Read and write result | ||
4651 | 22 | print 'Executing: test04.xq' | ||
4652 | 23 | f = open('test04.xq', 'r') | ||
4653 | 24 | lines = f.read() | ||
4654 | 25 | f.close() | ||
4655 | 26 | xquery = zorba.compileQuery(lines) | ||
4656 | 27 | result = xquery.execute() | ||
4657 | 28 | print result | ||
4658 | 29 | return | ||
4659 | 30 | |||
4660 | 31 | |||
4661 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4662 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4663 | 34 | |||
4664 | 35 | print "Running: XQuery execute" | ||
4665 | 36 | test(zorba) | ||
4666 | 37 | print "Success" | ||
4667 | 38 | |||
4668 | 39 | |||
4669 | 40 | zorba.shutdown() | ||
4670 | 41 | zorba_api.InMemoryStore_shutdown(store) | ||
4671 | 42 | |||
4672 | 43 | 0 | ||
4673 | === added file 'swig/python/tests/test04.xq' | |||
4674 | --- swig/python/tests/test04.xq 1970-01-01 00:00:00 +0000 | |||
4675 | +++ swig/python/tests/test04.xq 2013-03-27 00:40:33 +0000 | |||
4676 | @@ -0,0 +1,4 @@ | |||
4677 | 1 | for tumbling window $w in (2, 4, 6, 8, 10, 12, 14) | ||
4678 | 2 | start at $s when fn:true() | ||
4679 | 3 | only end at $e when $e - $s eq 2 | ||
4680 | 4 | return avg($w) | ||
4681 | 0 | 5 | ||
4682 | === removed file 'swig/python/tests/test04.xq.in' | |||
4683 | --- swig/python/tests/test04.xq.in 2013-02-07 17:24:36 +0000 | |||
4684 | +++ swig/python/tests/test04.xq.in 1970-01-01 00:00:00 +0000 | |||
4685 | @@ -1,4 +0,0 @@ | |||
4686 | 1 | for tumbling window $w in (2, 4, 6, 8, 10, 12, 14) | ||
4687 | 2 | start at $s when fn:true() | ||
4688 | 3 | only end at $e when $e - $s eq 2 | ||
4689 | 4 | return avg($w) | ||
4690 | 5 | 0 | ||
4691 | === added file 'swig/python/tests/test05.py' | |||
4692 | --- swig/python/tests/test05.py 1970-01-01 00:00:00 +0000 | |||
4693 | +++ swig/python/tests/test05.py 2013-03-27 00:40:33 +0000 | |||
4694 | @@ -0,0 +1,42 @@ | |||
4695 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4696 | 2 | # | ||
4697 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4698 | 4 | # you may not use this file except in compliance with the License. | ||
4699 | 5 | # You may obtain a copy of the License at | ||
4700 | 6 | # | ||
4701 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4702 | 8 | # | ||
4703 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4704 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4705 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4706 | 12 | # See the License for the specific language governing permissions and | ||
4707 | 13 | # limitations under the License. | ||
4708 | 14 | |||
4709 | 15 | import sys | ||
4710 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4711 | 17 | import zorba_api | ||
4712 | 18 | |||
4713 | 19 | |||
4714 | 20 | def test(zorba): | ||
4715 | 21 | #Read and write result | ||
4716 | 22 | print 'Executing: test05.xq' | ||
4717 | 23 | f = open('test05.xq', 'r') | ||
4718 | 24 | lines = f.read() | ||
4719 | 25 | f.close() | ||
4720 | 26 | xquery = zorba.compileQuery(lines) | ||
4721 | 27 | result = xquery.printPlanAsXML() | ||
4722 | 28 | print result | ||
4723 | 29 | return | ||
4724 | 30 | |||
4725 | 31 | |||
4726 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4727 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4728 | 34 | |||
4729 | 35 | print "Running: XQuery execute - printPlanAsXML" | ||
4730 | 36 | test(zorba) | ||
4731 | 37 | print "Success" | ||
4732 | 38 | |||
4733 | 39 | |||
4734 | 40 | zorba.shutdown() | ||
4735 | 41 | zorba_api.InMemoryStore_shutdown(store) | ||
4736 | 42 | |||
4737 | 0 | 43 | ||
4738 | === removed file 'swig/python/tests/test05.py.in' | |||
4739 | --- swig/python/tests/test05.py.in 2013-02-07 17:24:36 +0000 | |||
4740 | +++ swig/python/tests/test05.py.in 1970-01-01 00:00:00 +0000 | |||
4741 | @@ -1,42 +0,0 @@ | |||
4742 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4743 | 2 | # | ||
4744 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4745 | 4 | # you may not use this file except in compliance with the License. | ||
4746 | 5 | # You may obtain a copy of the License at | ||
4747 | 6 | # | ||
4748 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4749 | 8 | # | ||
4750 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4751 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4752 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4753 | 12 | # See the License for the specific language governing permissions and | ||
4754 | 13 | # limitations under the License. | ||
4755 | 14 | |||
4756 | 15 | import sys | ||
4757 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4758 | 17 | import zorba_api | ||
4759 | 18 | |||
4760 | 19 | |||
4761 | 20 | def test(zorba): | ||
4762 | 21 | #Read and write result | ||
4763 | 22 | print 'Executing: test05.xq' | ||
4764 | 23 | f = open('test05.xq', 'r') | ||
4765 | 24 | lines = f.read() | ||
4766 | 25 | f.close() | ||
4767 | 26 | xquery = zorba.compileQuery(lines) | ||
4768 | 27 | result = xquery.printPlanAsXML() | ||
4769 | 28 | print result | ||
4770 | 29 | return | ||
4771 | 30 | |||
4772 | 31 | |||
4773 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4774 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4775 | 34 | |||
4776 | 35 | print "Running: XQuery execute - printPlanAsXML" | ||
4777 | 36 | test(zorba) | ||
4778 | 37 | print "Success" | ||
4779 | 38 | |||
4780 | 39 | |||
4781 | 40 | zorba.shutdown() | ||
4782 | 41 | zorba_api.InMemoryStore_shutdown(store) | ||
4783 | 42 | |||
4784 | 43 | 0 | ||
4785 | === added file 'swig/python/tests/test05.xq' | |||
4786 | --- swig/python/tests/test05.xq 1970-01-01 00:00:00 +0000 | |||
4787 | +++ swig/python/tests/test05.xq 2013-03-27 00:40:33 +0000 | |||
4788 | @@ -0,0 +1,7 @@ | |||
4789 | 1 | for $x in (5,6,7,1,2,3,4) | ||
4790 | 2 | where $x < 4 | ||
4791 | 3 | for $y in (4,9,6,8,2) | ||
4792 | 4 | let $z := $x * $y | ||
4793 | 5 | where $z > 20 | ||
4794 | 6 | return | ||
4795 | 7 | <value x="{$x}" y="{$y}">{$z}</value> | ||
4796 | 0 | \ No newline at end of file | 8 | \ No newline at end of file |
4797 | 1 | 9 | ||
4798 | === removed file 'swig/python/tests/test05.xq.in' | |||
4799 | --- swig/python/tests/test05.xq.in 2013-02-07 17:24:36 +0000 | |||
4800 | +++ swig/python/tests/test05.xq.in 1970-01-01 00:00:00 +0000 | |||
4801 | @@ -1,7 +0,0 @@ | |||
4802 | 1 | for $x in (5,6,7,1,2,3,4) | ||
4803 | 2 | where $x < 4 | ||
4804 | 3 | for $y in (4,9,6,8,2) | ||
4805 | 4 | let $z := $x * $y | ||
4806 | 5 | where $z > 20 | ||
4807 | 6 | return | ||
4808 | 7 | <value x="{$x}" y="{$y}">{$z}</value> | ||
4809 | 8 | \ No newline at end of file | 0 | \ No newline at end of file |
4810 | 9 | 1 | ||
4811 | === added file 'swig/python/tests/test06.py' | |||
4812 | --- swig/python/tests/test06.py 1970-01-01 00:00:00 +0000 | |||
4813 | +++ swig/python/tests/test06.py 2013-03-27 00:40:33 +0000 | |||
4814 | @@ -0,0 +1,42 @@ | |||
4815 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4816 | 2 | # | ||
4817 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4818 | 4 | # you may not use this file except in compliance with the License. | ||
4819 | 5 | # You may obtain a copy of the License at | ||
4820 | 6 | # | ||
4821 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4822 | 8 | # | ||
4823 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4824 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4825 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4826 | 12 | # See the License for the specific language governing permissions and | ||
4827 | 13 | # limitations under the License. | ||
4828 | 14 | |||
4829 | 15 | import sys | ||
4830 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4831 | 17 | import zorba_api | ||
4832 | 18 | |||
4833 | 19 | |||
4834 | 20 | def test(zorba): | ||
4835 | 21 | #Read and write result | ||
4836 | 22 | print 'Executing: test06.xq' | ||
4837 | 23 | f = open('test06.xq', 'r') | ||
4838 | 24 | lines = f.read() | ||
4839 | 25 | f.close() | ||
4840 | 26 | xquery = zorba.compileQuery(lines) | ||
4841 | 27 | result = xquery.printPlanAsDOT() | ||
4842 | 28 | print result | ||
4843 | 29 | return | ||
4844 | 30 | |||
4845 | 31 | |||
4846 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4847 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4848 | 34 | |||
4849 | 35 | print "Running: XQuery execute - printPlanAsXML" | ||
4850 | 36 | test(zorba) | ||
4851 | 37 | print "Success" | ||
4852 | 38 | |||
4853 | 39 | |||
4854 | 40 | zorba.shutdown() | ||
4855 | 41 | zorba_api.InMemoryStore_shutdown(store) | ||
4856 | 42 | |||
4857 | 0 | 43 | ||
4858 | === removed file 'swig/python/tests/test06.py.in' | |||
4859 | --- swig/python/tests/test06.py.in 2013-02-07 17:24:36 +0000 | |||
4860 | +++ swig/python/tests/test06.py.in 1970-01-01 00:00:00 +0000 | |||
4861 | @@ -1,42 +0,0 @@ | |||
4862 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4863 | 2 | # | ||
4864 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4865 | 4 | # you may not use this file except in compliance with the License. | ||
4866 | 5 | # You may obtain a copy of the License at | ||
4867 | 6 | # | ||
4868 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4869 | 8 | # | ||
4870 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4871 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4872 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4873 | 12 | # See the License for the specific language governing permissions and | ||
4874 | 13 | # limitations under the License. | ||
4875 | 14 | |||
4876 | 15 | import sys | ||
4877 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4878 | 17 | import zorba_api | ||
4879 | 18 | |||
4880 | 19 | |||
4881 | 20 | def test(zorba): | ||
4882 | 21 | #Read and write result | ||
4883 | 22 | print 'Executing: test06.xq' | ||
4884 | 23 | f = open('test06.xq', 'r') | ||
4885 | 24 | lines = f.read() | ||
4886 | 25 | f.close() | ||
4887 | 26 | xquery = zorba.compileQuery(lines) | ||
4888 | 27 | result = xquery.printPlanAsDOT() | ||
4889 | 28 | print result | ||
4890 | 29 | return | ||
4891 | 30 | |||
4892 | 31 | |||
4893 | 32 | store = zorba_api.InMemoryStore_getInstance() | ||
4894 | 33 | zorba = zorba_api.Zorba_getInstance(store) | ||
4895 | 34 | |||
4896 | 35 | print "Running: XQuery execute - printPlanAsXML" | ||
4897 | 36 | test(zorba) | ||
4898 | 37 | print "Success" | ||
4899 | 38 | |||
4900 | 39 | |||
4901 | 40 | zorba.shutdown() | ||
4902 | 41 | zorba_api.InMemoryStore_shutdown(store) | ||
4903 | 42 | |||
4904 | 43 | 0 | ||
4905 | === added file 'swig/python/tests/test06.xq' | |||
4906 | --- swig/python/tests/test06.xq 1970-01-01 00:00:00 +0000 | |||
4907 | +++ swig/python/tests/test06.xq 2013-03-27 00:40:33 +0000 | |||
4908 | @@ -0,0 +1,7 @@ | |||
4909 | 1 | for $x in (5,6,7,1,2,3,4) | ||
4910 | 2 | where $x < 4 | ||
4911 | 3 | for $y in (4,9,6,8,2) | ||
4912 | 4 | let $z := $x * $y | ||
4913 | 5 | where $z > 20 | ||
4914 | 6 | return | ||
4915 | 7 | <value x="{$x}" y="{$y}">{$z}</value> | ||
4916 | 0 | \ No newline at end of file | 8 | \ No newline at end of file |
4917 | 1 | 9 | ||
4918 | === removed file 'swig/python/tests/test06.xq.in' | |||
4919 | --- swig/python/tests/test06.xq.in 2013-02-07 17:24:36 +0000 | |||
4920 | +++ swig/python/tests/test06.xq.in 1970-01-01 00:00:00 +0000 | |||
4921 | @@ -1,7 +0,0 @@ | |||
4922 | 1 | for $x in (5,6,7,1,2,3,4) | ||
4923 | 2 | where $x < 4 | ||
4924 | 3 | for $y in (4,9,6,8,2) | ||
4925 | 4 | let $z := $x * $y | ||
4926 | 5 | where $z > 20 | ||
4927 | 6 | return | ||
4928 | 7 | <value x="{$x}" y="{$y}">{$z}</value> | ||
4929 | 8 | \ No newline at end of file | 0 | \ No newline at end of file |
4930 | 9 | 1 | ||
4931 | === added file 'swig/python/tests/test07.1.py' | |||
4932 | --- swig/python/tests/test07.1.py 1970-01-01 00:00:00 +0000 | |||
4933 | +++ swig/python/tests/test07.1.py 2013-03-27 00:40:33 +0000 | |||
4934 | @@ -0,0 +1,54 @@ | |||
4935 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4936 | 2 | # | ||
4937 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4938 | 4 | # you may not use this file except in compliance with the License. | ||
4939 | 5 | # You may obtain a copy of the License at | ||
4940 | 6 | # | ||
4941 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
4942 | 8 | # | ||
4943 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
4944 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
4945 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
4946 | 12 | # See the License for the specific language governing permissions and | ||
4947 | 13 | # limitations under the License. | ||
4948 | 14 | |||
4949 | 15 | import sys | ||
4950 | 16 | sys.path.insert(0, '@pythonPath@') | ||
4951 | 17 | import zorba_api | ||
4952 | 18 | |||
4953 | 19 | |||
4954 | 20 | def test(zorba): | ||
4955 | 21 | f = open('books.xml', 'r') | ||
4956 | 22 | lines = f.read() | ||
4957 | 23 | f.close() | ||
4958 | 24 | |||
4959 | 25 | dataManager = zorba.getXmlDataManager() | ||
4960 | 26 | docIter = dataManager.parseXML(lines) | ||
4961 | 27 | docIter.open(); | ||
4962 | 28 | |||
4963 | 29 | doc = zorba_api.Item_createEmptyItem() | ||
4964 | 30 | docIter.next(doc) | ||
4965 | 31 | |||
4966 | 32 | docIter.close() | ||
4967 | 33 | docIter.destroy() | ||
4968 | 34 | |||
4969 | 35 | docManager = dataManager.getDocumentManager() | ||
4970 | 36 | docManager.put("my_fake_books.xml", doc) | ||
4971 | 37 | xquery = zorba.compileQuery("doc('my_fake_books.xml')") | ||
4972 | 38 | |||
4973 | 39 | result = xquery.execute() | ||
4974 | 40 | print result | ||
4975 | 41 | |||
4976 | 42 | return | ||
4977 | 43 | |||
4978 | 44 | store = zorba_api.InMemoryStore_getInstance() | ||
4979 | 45 | zorba = zorba_api.Zorba_getInstance(store) | ||
4980 | 46 | |||
4981 | 47 | print "Running: XQuery execute - parsing XML" | ||
4982 | 48 | test(zorba) | ||
4983 | 49 | print "Success" | ||
4984 | 50 | |||
4985 | 51 | |||
4986 | 52 | zorba.shutdown() | ||
4987 | 53 | zorba_api.InMemoryStore_shutdown(store) | ||
4988 | 54 | |||
4989 | 0 | 55 | ||
4990 | === removed file 'swig/python/tests/test07.1.py.in' | |||
4991 | --- swig/python/tests/test07.1.py.in 2013-02-07 17:24:36 +0000 | |||
4992 | +++ swig/python/tests/test07.1.py.in 1970-01-01 00:00:00 +0000 | |||
4993 | @@ -1,54 +0,0 @@ | |||
4994 | 1 | # Copyright 2006-2011 The FLWOR Foundation. | ||
4995 | 2 | # | ||
4996 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4997 | 4 | # you may not use this file except in compliance with the License. | ||
4998 | 5 | # You may obtain a copy of the License at | ||
4999 | 6 | # | ||
5000 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ bug1132937- 2013-03- 26T12-57- 14.27Z/ log.html
Log at: http://