Merge lp:~zorba-coders/zorba/bug1132937 into lp:zorba

Proposed by Rodolfo Ochoa
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
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

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
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/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1132937-2013-03-26T12-57-14.27Z is finished. The
  final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
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/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1132937-2013-03-26T23-29-14.147Z is finished. The
  final status was:

  14 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

lp:~zorba-coders/zorba/bug1132937 updated
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/php/examples/CMakeLists.txt'
--- doc/php/examples/CMakeLists.txt 2013-02-07 17:24:36 +0000
+++ doc/php/examples/CMakeLists.txt 2013-03-27 00:40:33 +0000
@@ -14,30 +14,31 @@
1414
15IF(PHP5_FOUND)15IF(PHP5_FOUND)
1616
17 MESSAGE(STATUS "PHP Found and Active!")17 MESSAGE(STATUS "PHP Found, installing examples...")
1818
19 SET(phpPath ${CMAKE_BINARY_DIR}/swig/php)19 SET(phpPath ${CMAKE_BINARY_DIR}/swig/php)
20 MESSAGE(STATUS "PHP Path:" ${phpPath})
21 IF (MSVC_IDE)20 IF (MSVC_IDE)
22 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php/@CMAKE_BUILD_TYPE@)21 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php/@CMAKE_BUILD_TYPE@)
23 ELSE (MSVC_IDE)22 ELSE (MSVC_IDE)
24 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php)23 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php)
25 ENDIF (MSVC_IDE)24 ENDIF (MSVC_IDE)
26 MESSAGE(STATUS "PHP Extension Path: " ${phpExtensionPath})25 SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php/Zorba)
27 SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php)26
28 MESSAGE(STATUS "PHP Include Path: " ${phpExtensionPath})27 IF (WIN32)
28 STRING(REGEX REPLACE "/" "\\\\" phpExtensionPath "${phpExtensionPath}")
29 STRING(REGEX REPLACE "/" "\\\\" phpPath "${phpPath}")
30 STRING(REGEX REPLACE "/" "\\\\" phpIncludePath "${phpIncludePath}")
31 ENDIF (WIN32)
32
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)
30 MESSAGE(STATUS "Configuration file: " ${CMAKE_CURRENT_BINARY_DIR}/php.ini)
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)
32 MESSAGE(STATUS "Simple configuration file: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
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)
34 MESSAGE(STATUS "PHP test file configured: " ${CMAKE_CURRENT_BINARY_DIR}/test.php)36
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
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)
39 ENDIF (NOT WIN32)
40
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)
38
39 MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/test.php)
40
41 42
42 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/simple.php ${CMAKE_CURRENT_BINARY_DIR}/test.php43 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/simple.php ${CMAKE_CURRENT_BINARY_DIR}/test.php
43 COMPONENT "php_examples"44 COMPONENT "php_examples"
4445
=== modified file 'doc/php/examples/php.ini.in'
--- doc/php/examples/php.ini.in 2013-02-07 17:24:36 +0000
+++ doc/php/examples/php.ini.in 2013-03-27 00:40:33 +0000
@@ -1,3 +1,3 @@
1enable_dl=On1enable_dl=On
2extension_dir=@phpExtensionPath@2extension_dir=@phpExtensionPath@
3include_path=".:@phpIncludePath@"
4\ No newline at end of file3\ No newline at end of file
4include_path="@phpIncludePath@"
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'doc/php/examples/simple.php.in'
--- doc/php/examples/simple.php.in 2013-02-07 17:24:36 +0000
+++ doc/php/examples/simple.php.in 2013-03-27 00:40:33 +0000
@@ -14,7 +14,7 @@
14 * See the License for the specific language governing permissions and14 * See the License for the specific language governing permissions and
15 * limitations under the License.15 * limitations under the License.
16 */16 */
17require '@phpPath@/Zorba/zorba_api_wrapper.php';17require 'zorba_api_wrapper.php';
1818
19function example_1(Zorba $aZorba)19function example_1(Zorba $aZorba)
20{20{
2121
=== modified file 'doc/php/examples/test.php.in'
--- doc/php/examples/test.php.in 2012-01-18 08:31:25 +0000
+++ doc/php/examples/test.php.in 2013-03-27 00:40:33 +0000
@@ -14,7 +14,7 @@
14 * See the License for the specific language governing permissions and14 * See the License for the specific language governing permissions and
15 * limitations under the License.15 * limitations under the License.
16 */16 */
17require '@phpPath@/Zorba/XQueryProcessor.php';17require 'XQueryProcessor.php';
1818
19function omitXMLDecl($xml)19function omitXMLDecl($xml)
20{20{
2121
=== removed file 'doc/php/examples/zorba_api.php'
--- doc/php/examples/zorba_api.php 2013-02-07 17:24:36 +0000
+++ doc/php/examples/zorba_api.php 1970-01-01 00:00:00 +0000
@@ -1,178 +0,0 @@
1<?php
2/*
3 * Copyright 2006-2012 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18// Try to load our extension if it's not already loaded.
19if (!extension_loaded("zorba_api")) {
20 if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
21 if (!dl('zorba_api.dll')) return;
22 } else {
23 // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'.
24 // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'.
25 if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
26 if (!dl('zorba_api.so')) return;
27 } else {
28 if (!dl('zorba_api.'.PHP_SHLIB_SUFFIX)) return;
29 }
30 }
31}
32
33class Item {
34 public $_cPtr=null;
35
36 static function createEmptyItem() {
37 $r=Item_createEmptyItem();
38 return is_resource($r) ? new Item($r) : $r;
39 }
40
41 function getStringValue() {
42 return Item_getStringValue($this->_cPtr);
43 }
44
45 function __construct() {
46 $this->_cPtr=new_Item();
47 }
48}
49
50class Iterator {
51 public $_cPtr=null;
52
53 function open() {
54 Iterator_open($this->_cPtr);
55 }
56
57 function next($arg1) {
58 return Iterator_next($this->_cPtr,$arg1);
59 }
60
61 function close() {
62 Iterator_close($this->_cPtr);
63 }
64
65 function destroy() {
66 Iterator_destroy($this->_cPtr);
67 }
68
69 function __construct($cPtr) {
70 $this->_cPtr=$cPtr;
71 }
72
73 public function __destruct() {
74 $this->destroy();
75 }
76}
77
78class XQuery {
79 public $_cPtr=null;
80
81 function execute() {
82 return XQuery_execute($this->_cPtr);
83 }
84
85 function isUpdateQuery() {
86 return XQuery_isUpdateQuery($this->_cPtr);
87 }
88
89 function applyUpdates() {
90 XQuery_applyUpdates($this->_cPtr);
91 }
92
93 function destroy() {
94 XQuery_destroy($this->_cPtr);
95 }
96
97 function iterator() {
98 $r=XQuery_iterator($this->_cPtr);
99 return is_resource($r) ? new Iterator($r) : $r;
100 }
101
102 function __construct($cPtr) {
103 $this->_cPtr=$cPtr;
104 }
105
106 function __destruct() {
107 $this->destroy();
108 }
109}
110
111class Store {
112 //public $_cPtr=null;
113
114 //function __construct() {
115 // $this->_cPtr=new_Store();
116 //}
117}
118
119class InMemoryStore extends Store {
120 public $_cPtr=null;
121
122 static function getInstance() {
123 $r=InMemoryStore_getInstance();
124 return is_resource($r) ? new InMemoryStore($r) : $r;
125 }
126
127 static function shutdown($arg1) {
128 InMemoryStore_shutdown($arg1);
129 }
130
131 private function __construct($cPtr) {
132 $this->_cPtr=$cPtr;
133 }
134}
135
136class XmlDataManager {
137 public $_cPtr=null;
138
139 function loadDocument($aName,$aContent) {
140 XmlDataManager_loadDocument($this->_cPtr,$aName,$aContent);
141 }
142
143 function deleteDocument($aName) {
144 return XmlDataManager_deleteDocument($this->_cPtr,$aName);
145 }
146
147 function __construct($cPtr) {
148 $this->_cPtr=$cPtr;
149 }
150}
151
152class Zorba {
153 public $_cPtr=null;
154
155 static function getInstance($arg1) {
156 $r=Zorba_getInstance($arg1->_cPtr);
157 return is_resource($r) ? new Zorba($r) : $r;
158 }
159
160 function compileQuery($aStr) {
161 $r=Zorba_compileQuery($this->_cPtr,$aStr);
162 return is_resource($r) ? new XQuery($r) : $r;
163 }
164
165 function getXmlDataManager() {
166 $r=Zorba_getXmlDataManager($this->_cPtr);
167 return is_resource($r) ? new XmlDataManager($r) : $r;
168 }
169
170 function shutdown() {
171 Zorba_shutdown($this->_cPtr);
172 }
173
174 private function __construct($cPtr) {
175 $this->_cPtr=$cPtr;
176 }
177}
178?>
1790
=== modified file 'include/zorba/internal/diagnostic.h'
--- include/zorba/internal/diagnostic.h 2013-02-26 04:12:43 +0000
+++ include/zorba/internal/diagnostic.h 2013-03-27 00:40:33 +0000
@@ -201,6 +201,7 @@
201 column_type column_end_;201 column_type column_end_;
202202
203 friend bool operator==( location const&, location const& );203 friend bool operator==( location const&, location const& );
204 friend bool operator!=( location const&, location const& );
204205
205 // for plan serialization206 // for plan serialization
206 friend void serialization::operator&( serialization::Archiver&, location& );207 friend void serialization::operator&( serialization::Archiver&, location& );
@@ -224,9 +225,7 @@
224 * @param j The second location.225 * @param j The second location.
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.
226 */227 */
227inline bool operator!=( location const &i, location const &j ) {228bool operator!=( location const &i, location const &j );
228 return !(i == j);
229}
230229
231///////////////////////////////////////////////////////////////////////////////230///////////////////////////////////////////////////////////////////////////////
232231
233232
=== modified file 'include/zorba/xquery_exception.h'
--- include/zorba/xquery_exception.h 2013-02-26 04:12:43 +0000
+++ include/zorba/xquery_exception.h 2013-03-27 00:40:33 +0000
@@ -295,7 +295,7 @@
295 * @return Returns \a true only if stack traces will be included.295 * @return Returns \a true only if stack traces will be included.
296 */296 */
297 static bool get_print_trace( std::ostream &o ) {297 static bool get_print_trace( std::ostream &o ) {
298 return static_cast<print_trace>( o.iword( get_ios_trace_index() ) );298 return !!( o.iword( get_ios_trace_index() ) );
299 }299 }
300300
301 /**301 /**
@@ -404,7 +404,7 @@
404 */404 */
405inline std::ostream& operator<<( std::ostream &o,405inline std::ostream& operator<<( std::ostream &o,
406 XQueryException::print_trace t ) {406 XQueryException::print_trace t ) {
407 XQueryException::set_print_trace( o, t );407 XQueryException::set_print_trace( o, !!t );
408 return o;408 return o;
409}409}
410410
411411
=== modified file 'src/diagnostics/diagnostic.cpp'
--- src/diagnostics/diagnostic.cpp 2013-02-26 04:12:43 +0000
+++ src/diagnostics/diagnostic.cpp 2013-03-27 00:40:33 +0000
@@ -177,6 +177,10 @@
177177
178location const location::empty;178location const location::empty;
179179
180bool operator!=( location const &i, location const &j ) {
181 return !(i == j);
182}
183
180bool operator==( location const &i, location const &j ) {184bool operator==( location const &i, location const &j ) {
181 return i.file_ == j.file_185 return i.file_ == j.file_
182 && i.line_ == j.line_186 && i.line_ == j.line_
183187
=== modified file 'src/precompiled/stdafx.h'
--- src/precompiled/stdafx.h 2013-02-07 17:24:36 +0000
+++ src/precompiled/stdafx.h 2013-03-27 00:40:33 +0000
@@ -44,7 +44,6 @@
44 #include "compiler/parser/parse_constants.h"44 #include "compiler/parser/parse_constants.h"
45 #include "zorbautils/checked_vector.h"45 #include "zorbautils/checked_vector.h"
46 #include "compiler/parser/xquery_driver.h"46 #include "compiler/parser/xquery_driver.h"
47 #include "util/sorter.h"
48 #include "compiler/xqueryx/xqueryx_to_xquery.h"47 #include "compiler/xqueryx/xqueryx_to_xquery.h"
49 #include <zorba/store_manager.h>48 #include <zorba/store_manager.h>
50 #include <zorba/xquery.h>49 #include <zorba/xquery.h>
5150
=== modified file 'src/unit_tests/test_mem_sizeof.cpp'
--- src/unit_tests/test_mem_sizeof.cpp 2013-02-05 04:00:09 +0000
+++ src/unit_tests/test_mem_sizeof.cpp 2013-03-27 00:40:33 +0000
@@ -14,6 +14,7 @@
14 * limitations under the License.14 * limitations under the License.
15 */15 */
1616
17#include "stdafx.h"
17#include <iostream>18#include <iostream>
18#include <string>19#include <string>
1920
2021
=== modified file 'swig/Config.h'
--- swig/Config.h 2012-08-06 22:08:44 +0000
+++ swig/Config.h 2013-03-27 00:40:33 +0000
@@ -18,5 +18,4 @@
1818
19#define ZORBA_STREAM_BUFFER_SIZE @ZORBA_STREAM_BUFFER_SIZE@19#define ZORBA_STREAM_BUFFER_SIZE @ZORBA_STREAM_BUFFER_SIZE@
2020
21
22#endif21#endif
23\ No newline at end of file22\ No newline at end of file
2423
=== modified file 'swig/DiagnosticHandler.i'
--- swig/DiagnosticHandler.i 2013-02-07 17:24:36 +0000
+++ swig/DiagnosticHandler.i 2013-03-27 00:40:33 +0000
@@ -20,11 +20,11 @@
2020
21 void DiagnosticHandler::error (const zorba::ZorbaException &ze) 21 void DiagnosticHandler::error (const zorba::ZorbaException &ze)
22 {22 {
23 if ( zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze ) ) {23 if (zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze )) {
24 const XQueryException xe2(xe);24 const XQueryException xe2(xe);
25 error(xe2); 25 error(xe2);
26 }26 }
27 if ( zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze ) ) {27 if (zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze )) {
28 const UserException ue2(ue);28 const UserException ue2(ue);
29 error(ue2); 29 error(ue2);
30 }30 }
3131
=== modified file 'swig/DynamicContext.h'
--- swig/DynamicContext.h 2013-02-07 17:24:36 +0000
+++ swig/DynamicContext.h 2013-03-27 00:40:33 +0000
@@ -36,14 +36,14 @@
36 DynamicContext(const DynamicContext& aCtx):theContext(aCtx.theContext) {}36 DynamicContext(const DynamicContext& aCtx):theContext(aCtx.theContext) {}
37 DynamicContext(zorba::DynamicContext* aCtx):theContext(aCtx) {}37 DynamicContext(zorba::DynamicContext* aCtx):theContext(aCtx) {}
3838
39 bool getContextItem (Item& aItem);39 bool getContextItem (Item& aItem);
4040
41 /** \brief Retrieve the dateTime Item used at the time the query is executed41 /** \brief Retrieve the dateTime Item used at the time the query is executed
42 * (see setCurrentDateTime()).42 * (see setCurrentDateTime()).
43 *43 *
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.
45 */45 */
46 Item getCurrentDateTime ();46 Item getCurrentDateTime ();
4747
48 /** \brief Return the value of the default collection that is used when calling the48 /** \brief Return the value of the default collection that is used when calling the
49 * fn:collection function without a parameter.49 * fn:collection function without a parameter.
@@ -51,7 +51,7 @@
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.
52 * @throw ZorbaException if an error occured.52 * @throw ZorbaException if an error occured.
53 */53 */
54 Item getDefaultCollection ();54 Item getDefaultCollection ();
5555
56 /** \brief Retrieve the implicit timezone used in comparisons or arithmetic operations56 /** \brief Retrieve the implicit timezone used in comparisons or arithmetic operations
57 * of date, time, or dateTime values.57 * of date, time, or dateTime values.
@@ -60,7 +60,7 @@
60 * and an DiagnosticHandler is used.60 * and an DiagnosticHandler is used.
61 * @throw ZorbaException if an error occured.61 * @throw ZorbaException if an error occured.
62 */62 */
63 int getImplicitTimezone ();63 int getImplicitTimezone ();
6464
65 /** \brief Returns the current value of an external65 /** \brief Returns the current value of an external
66 * variable. Exactly one of the two return values (aItem or66 * variable. Exactly one of the two return values (aItem or
@@ -78,7 +78,7 @@
78 * @return true if the variable has been retrieved successfully, false otherwise.78 * @return true if the variable has been retrieved successfully, false otherwise.
79 * @throw ZorbaException if an error occured.79 * @throw ZorbaException if an error occured.
80 */80 */
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);
82 82
83 /** \brief Defines the context item.83 /** \brief Defines the context item.
84 *84 *
8585
=== modified file 'swig/DynamicContext.i'
--- swig/DynamicContext.i 2013-02-07 17:24:36 +0000
+++ swig/DynamicContext.i 2013-03-27 00:40:33 +0000
@@ -25,10 +25,10 @@
25 Item DynamicContext::getDefaultCollection () {25 Item DynamicContext::getDefaultCollection () {
26 return Item(theContext->getDefaultCollection());26 return Item(theContext->getDefaultCollection());
27 }27 }
28 int DynamicContext::getImplicitTimezone (){28 int DynamicContext::getImplicitTimezone (){
29 return theContext->getImplicitTimezone();29 return theContext->getImplicitTimezone();
30 }30 }
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) {
32 return theContext->getVariable(aNamespace, aLocalname, aItem.theItem, aIterator.theIterator);32 return theContext->getVariable(aNamespace, aLocalname, aItem.theItem, aIterator.theIterator);
33 }33 }
3434
3535
=== modified file 'swig/Exceptions.i'
--- swig/Exceptions.i 2013-02-07 17:24:36 +0000
+++ swig/Exceptions.i 2013-03-27 00:40:33 +0000
@@ -115,9 +115,9 @@
115 private:115 private:
116 XQueryException();116 XQueryException();
117 public:117 public:
118 virtual unsigned int getColumnBegin () const;118 virtual unsigned int getColumnBegin () const;
119 virtual unsigned int getLineBegin () const;119 virtual unsigned int getLineBegin () const;
120 virtual std::string getQueryURI () const;120 virtual std::string getQueryURI () const;
121};121};
122122
123/* vim:set et sw=2 ts=2: */123/* vim:set et sw=2 ts=2: */
124124
=== modified file 'swig/Item.h'
--- swig/Item.h 2013-02-07 17:24:36 +0000
+++ swig/Item.h 2013-03-27 00:40:33 +0000
@@ -159,7 +159,7 @@
159 * @return Item the int value of the Item.159 * @return Item the int value of the Item.
160 * @throw ZorbaException if an error occured.160 * @throw ZorbaException if an error occured.
161 */161 */
162 double getDoubleValue () const;162 double getDoubleValue () const;
163163
164 /** \brief Get the long value of the Item.164 /** \brief Get the long value of the Item.
165 *165 *
@@ -211,7 +211,7 @@
211 * @return element or document parent node of this node.211 * @return element or document parent node of this node.
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.
213 */213 */
214 Item getParent () const;214 Item getParent () const;
215215
216 /** \brief Get the (optional) value of a QName's prefix.216 /** \brief Get the (optional) value of a QName's prefix.
217 *217 *
218218
=== modified file 'swig/Item.i'
--- swig/Item.i 2013-02-07 17:24:36 +0000
+++ swig/Item.i 2013-03-27 00:40:33 +0000
@@ -60,7 +60,7 @@
60 int Item::getIntValue () const60 int Item::getIntValue () const
61 { return theItem.getIntValue(); }61 { return theItem.getIntValue(); }
6262
63 double Item::getDoubleValue () const63 double Item::getDoubleValue () const
64 { return theItem.getDoubleValue(); }64 { return theItem.getDoubleValue(); }
6565
66 long long Item::getLongValue () const66 long long Item::getLongValue () const
@@ -89,7 +89,7 @@
89 bool Item::getNodeName (Item &aNodeName) const89 bool Item::getNodeName (Item &aNodeName) const
90 { return theItem.getNodeName( aNodeName.theItem ); }90 { return theItem.getNodeName( aNodeName.theItem ); }
9191
92 Item Item::getParent () const92 Item Item::getParent () const
93 { return theItem.getParent(); }93 { return theItem.getParent(); }
9494
95 std::string Item::getPrefix () const95 std::string Item::getPrefix () const
9696
=== modified file 'swig/ItemFactory.h'
--- swig/ItemFactory.h 2013-02-07 17:24:36 +0000
+++ swig/ItemFactory.h 2013-03-27 00:40:33 +0000
@@ -40,7 +40,7 @@
40 * @param aURI String representation of the AnyURI.40 * @param aURI String representation of the AnyURI.
41 * @return The AnyURI Item.41 * @return The AnyURI Item.
42 */42 */
43 Item createAnyURI (const std::string &aURI);43 Item createAnyURI (const std::string &aURI);
4444
45 /**45 /**
46 * Create a new attribute node N and place it among the46 * Create a new attribute node N and place it among the
@@ -57,10 +57,9 @@
57 * @param aTypedValue The typed value of the new node.57 * @param aTypedValue The typed value of the new node.
58 * @return The new node N created by this method58 * @return The new node N created by this method
59 */59 */
60 Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue);60 Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue);
61#ifndef SWIGRUBY61
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);
63#endif
6463
65 /** \brief Creates a Base64Binary Item64 /** \brief Creates a Base64Binary Item
66 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]65 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
@@ -69,7 +68,7 @@
69 * @param aLength the length of the base64 binary data.68 * @param aLength the length of the base64 binary data.
70 * @return The Base64Binary Item.69 * @return The Base64Binary Item.
71 */70 */
72 Item createBase64Binary (const char *aBinData, size_t aLength);71 Item createBase64Binary (const char *aBinData, size_t aLength);
7372
74 /** \brief Creates a Base64Binary Item73 /** \brief Creates a Base64Binary Item
75 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]74 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
@@ -77,7 +76,7 @@
77 * @param aStream A stream containing the Base64 encoded data.76 * @param aStream A stream containing the Base64 encoded data.
78 * @return the Base64Binary Item.77 * @return the Base64Binary Item.
79 */78 */
80 Item createBase64Binary (std::istream &aStream);79 Item createBase64Binary (std::istream &aStream);
8180
82 /** \brief Creates a Base64Binary Item81 /** \brief Creates a Base64Binary Item
83 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]82 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
@@ -86,7 +85,7 @@
86 * @param aLength the length of the data85 * @param aLength the length of the data
87 * @return the Base64Binary Item.86 * @return the Base64Binary Item.
88 */87 */
89 Item createBase64Binary (const unsigned char *aBinData, size_t aLength);88 Item createBase64Binary (const unsigned char *aBinData, size_t aLength);
9089
91 /** \brief Creates a Boolean Item90 /** \brief Creates a Boolean Item
92 * see [http://www.w3.org/TR/xmlschema-2/#bool]91 * see [http://www.w3.org/TR/xmlschema-2/#bool]
@@ -94,7 +93,7 @@
94 * @param aValue bool representation of the Boolean.93 * @param aValue bool representation of the Boolean.
95 * @return The Boolean Item.94 * @return The Boolean Item.
96 */95 */
97 Item createBoolean (bool aValue);96 Item createBoolean (bool aValue);
9897
99 /** \brief Creates a Byte Item98 /** \brief Creates a Byte Item
100 * see [http://www.w3.org/TR/xmlschema-2/#byte]99 * see [http://www.w3.org/TR/xmlschema-2/#byte]
@@ -102,7 +101,7 @@
102 * @param aByte char representation of the Byte.101 * @param aByte char representation of the Byte.
103 * @return The Byte Item.102 * @return The Byte Item.
104 */103 */
105 Item createByte (char aByte);104 Item createByte (char aByte);
106105
107 /**106 /**
108 * Create a new comment node N and place it as the last child of a given107 * Create a new comment node N and place it as the last child of a given
@@ -113,7 +112,7 @@
113 * @param aContent The content of the new node.112 * @param aContent The content of the new node.
114 * @return The new node N created by this method113 * @return The new node N created by this method
115 */114 */
116 Item createCommentNode (Item &aParent, const std::string &aContent);115 Item createCommentNode (Item &aParent, const std::string &aContent);
117116
118 /** \brief Creates a Date Item117 /** \brief Creates a Date Item
119 * see [http://www.w3.org/TR/xmlschema-2/#date]118 * see [http://www.w3.org/TR/xmlschema-2/#date]
@@ -121,7 +120,7 @@
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).
122 * @return The Date Item.121 * @return The Date Item.
123 */122 */
124 Item createDate (const std::string &aDate);123 Item createDate (const std::string &aDate);
125124
126 /** \brief Creates a Date Item125 /** \brief Creates a Date Item
127 * see [http://www.w3.org/TR/xmlschema-2/#date]126 * see [http://www.w3.org/TR/xmlschema-2/#date]
@@ -131,7 +130,7 @@
131 * @param aDay short-valued representation of the day.130 * @param aDay short-valued representation of the day.
132 * @return The Date Item.131 * @return The Date Item.
133 */132 */
134 Item createDate (short aYear, short aMonth, short aDay);133 Item createDate (short aYear, short aMonth, short aDay);
135134
136 /** \brief Creates a DateTime Item135 /** \brief Creates a DateTime Item
137 * see [http://www.w3.org/TR/xmlschema-2/#dateTime]136 * see [http://www.w3.org/TR/xmlschema-2/#dateTime]
@@ -140,7 +139,7 @@
140 * (for example, 2002-10-10T12:00:00-05:00).139 * (for example, 2002-10-10T12:00:00-05:00).
141 * @return The DateTime Item.140 * @return The DateTime Item.
142 */141 */
143 Item createDateTime (const std::string &aDateTimeValue);142 Item createDateTime (const std::string &aDateTimeValue);
144143
145 /** \brief Creates a DateTime Item144 /** \brief Creates a DateTime Item
146 * see [http://www.w3.org/TR/xmlschema-2/#dateTime]145 * see [http://www.w3.org/TR/xmlschema-2/#dateTime]
@@ -154,7 +153,7 @@
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.
155 * @return The DateTime Item.154 * @return The DateTime Item.
156 */155 */
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);
158157
159 /** \brief Creates a Decimal Item158 /** \brief Creates a Decimal Item
160 * see [http://www.w3.org/TR/xmlschema-2/#decimal]159 * see [http://www.w3.org/TR/xmlschema-2/#decimal]
@@ -162,7 +161,7 @@
162 * @param aValue String representation of the Decimal (e.g. 12678967.543233).161 * @param aValue String representation of the Decimal (e.g. 12678967.543233).
163 * @return The Decimal Item.162 * @return The Decimal Item.
164 */163 */
165 Item createDecimal (const std::string &aValue);164 Item createDecimal (const std::string &aValue);
166165
167 /** \brief Creates a Decimal Item166 /** \brief Creates a Decimal Item
168 * see [http://www.w3.org/TR/xmlschema-2/#decimal]167 * see [http://www.w3.org/TR/xmlschema-2/#decimal]
@@ -170,7 +169,7 @@
170 * @param aValue double representation of the Decimal.169 * @param aValue double representation of the Decimal.
171 * @return The Decimal Item.170 * @return The Decimal Item.
172 */171 */
173 Item createDecimalFromDouble (double aValue);172 Item createDecimalFromDouble (double aValue);
174173
175 /** \brief Creates a Decimal Item174 /** \brief Creates a Decimal Item
176 * see [http://www.w3.org/TR/xmlschema-2/#decimal]175 * see [http://www.w3.org/TR/xmlschema-2/#decimal]
@@ -178,7 +177,7 @@
178 * @param aValue unsigned long representation of the Decimal.177 * @param aValue unsigned long representation of the Decimal.
179 * @return The Decimal Item.178 * @return The Decimal Item.
180 */179 */
181 Item createDecimalFromLong (unsigned long aValue);180 Item createDecimalFromLong (unsigned long aValue);
182181
183 /** \brief Creates a Double Item182 /** \brief Creates a Double Item
184 * see [http://www.w3.org/TR/xmlschema-2/#double]183 * see [http://www.w3.org/TR/xmlschema-2/#double]
@@ -186,7 +185,7 @@
186 * @param aValue String representation of the Double.185 * @param aValue String representation of the Double.
187 * @return The Double Item.186 * @return The Double Item.
188 */187 */
189 Item createDouble (const std::string &aValue);188 Item createDouble (const std::string &aValue);
190189
191 /** \brief Creates a Double Item190 /** \brief Creates a Double Item
192 * see [http://www.w3.org/TR/xmlschema-2/#double]191 * see [http://www.w3.org/TR/xmlschema-2/#double]
@@ -194,7 +193,7 @@
194 * @param aValue double representation of the Double.193 * @param aValue double representation of the Double.
195 * @return The Double Item.194 * @return The Double Item.
196 */195 */
197 Item createDouble (double aValue);196 Item createDouble (double aValue);
198197
199 /** \brief Creates a Duration Item198 /** \brief Creates a Duration Item
200 * see [http://www.w3.org/TR/xmlschema-2/#duration]199 * see [http://www.w3.org/TR/xmlschema-2/#duration]
@@ -202,7 +201,7 @@
202 * @param aValue String representation of the NCName.201 * @param aValue String representation of the NCName.
203 * @return The Duration Item.202 * @return The Duration Item.
204 */203 */
205 Item createDuration (const std::string &aValue);204 Item createDuration (const std::string &aValue);
206205
207 /** \brief Creates a Duration Item206 /** \brief Creates a Duration Item
208 * see [http://www.w3.org/TR/xmlschema-2/#duration]207 * see [http://www.w3.org/TR/xmlschema-2/#duration]
@@ -215,7 +214,7 @@
215 * @param aSeconds double-valued representation of the seconds and fractional seconds.214 * @param aSeconds double-valued representation of the seconds and fractional seconds.
216 * @return The Duration Item.215 * @return The Duration Item.
217 */216 */
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);
219218
220 /** \brief Creates a dayTimeDuration Item219 /** \brief Creates a dayTimeDuration Item
221 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]220 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
@@ -223,7 +222,7 @@
223 * @param aValue String lexical representation of the duration.222 * @param aValue String lexical representation of the duration.
224 * @return the dayTimeDuration Item.223 * @return the dayTimeDuration Item.
225 */224 */
226 Item createDayTimeDuration (const std::string &aValue);225 Item createDayTimeDuration (const std::string &aValue);
227226
228 /** \brief Creates a yearMonthDuration Item227 /** \brief Creates a yearMonthDuration Item
229 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]228 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
@@ -231,7 +230,7 @@
231 * @param aValue String lexical representation of the duration.230 * @param aValue String lexical representation of the duration.
232 * @return the yearMonthDuration Item.231 * @return the yearMonthDuration Item.
233 */232 */
234 Item createYearMonthDuration (const std::string &aValue);233 Item createYearMonthDuration (const std::string &aValue);
235234
236 /** \brief Creates a documentNode Item235 /** \brief Creates a documentNode Item
237 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]236 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
@@ -240,8 +239,8 @@
240 * @param aDocUri String representation of the Document URI.239 * @param aDocUri String representation of the Document URI.
241 * @return the documentNode Item.240 * @return the documentNode Item.
242 */241 */
243 Item createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri);242 Item createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri);
244#ifndef SWIGRUBY243
245 /**244 /**
246 * @brief Creates a new element node.245 * @brief Creates a new element node.
247 *246 *
@@ -264,8 +263,7 @@
264 * property of P.263 * property of P.
265 * @return The new node N created by this method264 * @return The new node N created by this method
266 */265 */
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);
268#endif
269267
270 /**268 /**
271 * @brief Creates a new element node.269 * @brief Creates a new element node.
@@ -286,7 +284,7 @@
286 * complex type with empty content.284 * complex type with empty content.
287 * @return The new node N created by this method285 * @return The new node N created by this method
288 */286 */
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);
290288
291 /** \brief creates a float item289 /** \brief creates a float item
292 * see [http://www.w3.org/tr/xmlschema-2/#float]290 * see [http://www.w3.org/tr/xmlschema-2/#float]
@@ -294,7 +292,7 @@
294 * @param aValue string representation of the float.292 * @param aValue string representation of the float.
295 * @return the float item.293 * @return the float item.
296 */294 */
297 Item createFloat (const std::string &aValue);295 Item createFloat (const std::string &aValue);
298296
299 /** \brief creates a float item297 /** \brief creates a float item
300 * see [http://www.w3.org/tr/xmlschema-2/#float]298 * see [http://www.w3.org/tr/xmlschema-2/#float]
@@ -302,7 +300,7 @@
302 * @param aValue float representation of the float.300 * @param aValue float representation of the float.
303 * @return the float item.301 * @return the float item.
304 */302 */
305 Item createFloat (float aValue);303 Item createFloat (float aValue);
306304
307 /** \brief Creates a gDay Item305 /** \brief Creates a gDay Item
308 * see [http://www.w3.org/TR/xmlschema-2/#gDay]306 * see [http://www.w3.org/TR/xmlschema-2/#gDay]
@@ -310,7 +308,7 @@
310 * @param aValue String representation of the gDay.308 * @param aValue String representation of the gDay.
311 * @return The gDay Item.309 * @return The gDay Item.
312 */310 */
313 Item createGDay (const std::string &aValue);311 Item createGDay (const std::string &aValue);
314312
315 /** \brief Creates a gDay Item313 /** \brief Creates a gDay Item
316 * see [http://www.w3.org/TR/xmlschema-2/#gDay]314 * see [http://www.w3.org/TR/xmlschema-2/#gDay]
@@ -318,7 +316,7 @@
318 * @param aDay short representation of the gDay.316 * @param aDay short representation of the gDay.
319 * @return The gDay Item.317 * @return The gDay Item.
320 */318 */
321 Item createGDay (short aDay);319 Item createGDay (short aDay);
322320
323 /** \brief Creates a gMonth Item321 /** \brief Creates a gMonth Item
324 * see [http://www.w3.org/TR/xmlschema-2/#gMonth]322 * see [http://www.w3.org/TR/xmlschema-2/#gMonth]
@@ -326,7 +324,7 @@
326 * @param aValue String representation of the gMonth.324 * @param aValue String representation of the gMonth.
327 * @return The gMonth Item.325 * @return The gMonth Item.
328 */326 */
329 Item createGMonth (const std::string &aValue);327 Item createGMonth (const std::string &aValue);
330328
331 /** \brief Creates a gMonth Item329 /** \brief Creates a gMonth Item
332 * see [http://www.w3.org/TR/xmlschema-2/#gMonth]330 * see [http://www.w3.org/TR/xmlschema-2/#gMonth]
@@ -334,7 +332,7 @@
334 * @param aMonth short representation of the gMonth.332 * @param aMonth short representation of the gMonth.
335 * @return The gMonth Item.333 * @return The gMonth Item.
336 */334 */
337 Item createGMonth (short aMonth);335 Item createGMonth (short aMonth);
338336
339 /** \brief Creates a gMonthDay Item337 /** \brief Creates a gMonthDay Item
340 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]338 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]
@@ -342,7 +340,7 @@
342 * @param aValue String representation of the gMonthDay.340 * @param aValue String representation of the gMonthDay.
343 * @return The gMonthDay Item.341 * @return The gMonthDay Item.
344 */342 */
345 Item createGMonthDay (const std::string &aValue);343 Item createGMonthDay (const std::string &aValue);
346344
347 /** \brief Creates a gMonthDay Item345 /** \brief Creates a gMonthDay Item
348 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]346 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]
@@ -351,7 +349,7 @@
351 * @param aDay short representation of the day.349 * @param aDay short representation of the day.
352 * @return The gMonthDay Item.350 * @return The gMonthDay Item.
353 */351 */
354 Item createGMonthDay (short aMonth, short aDay);352 Item createGMonthDay (short aMonth, short aDay);
355353
356 /** \brief Creates a gYear Item354 /** \brief Creates a gYear Item
357 * see [http://www.w3.org/TR/xmlschema-2/#gYear]355 * see [http://www.w3.org/TR/xmlschema-2/#gYear]
@@ -359,7 +357,7 @@
359 * @param aYear short representation of the gYear.357 * @param aYear short representation of the gYear.
360 * @return The gYear Item.358 * @return The gYear Item.
361 */359 */
362 Item createGYear (short aYear);360 Item createGYear (short aYear);
363361
364 /** \brief Creates a gYear Item362 /** \brief Creates a gYear Item
365 * see [http://www.w3.org/TR/xmlschema-2/#gYear]363 * see [http://www.w3.org/TR/xmlschema-2/#gYear]
@@ -367,7 +365,7 @@
367 * @param aValue String representation of the gYear.365 * @param aValue String representation of the gYear.
368 * @return The gYear Item.366 * @return The gYear Item.
369 */367 */
370 Item createGYear (const std::string &aValue);368 Item createGYear (const std::string &aValue);
371369
372 /** \brief Creates a gYearMonth Item370 /** \brief Creates a gYearMonth Item
373 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]371 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]
@@ -375,7 +373,7 @@
375 * @param aValue String representation of the gYearMonth.373 * @param aValue String representation of the gYearMonth.
376 * @return The gYearMonth Item.374 * @return The gYearMonth Item.
377 */375 */
378 Item createGYearMonth (const std::string &aValue);376 Item createGYearMonth (const std::string &aValue);
379377
380 /** \brief Creates a gYearMonth Item378 /** \brief Creates a gYearMonth Item
381 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]379 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]
@@ -384,7 +382,7 @@
384 * @param aMonth short representation of the month.382 * @param aMonth short representation of the month.
385 * @return The gYearMonth Item.383 * @return The gYearMonth Item.
386 */384 */
387 Item createGYearMonth (short aYear, short aMonth);385 Item createGYearMonth (short aYear, short aMonth);
388386
389 /** \brief Creates a HexBinary Item387 /** \brief Creates a HexBinary Item
390 * see [http://www.w3.org/TR/xmlschema-2/#hexBinary]388 * see [http://www.w3.org/TR/xmlschema-2/#hexBinary]
@@ -393,7 +391,7 @@
393 * @param aSize size of the hexdata.391 * @param aSize size of the hexdata.
394 * @return The HexBinary Item.392 * @return The HexBinary Item.
395 */393 */
396 Item createHexBinary (const char *aHexData, size_t aSize);394 Item createHexBinary (const char *aHexData, size_t aSize);
397395
398 /** \brief Creates a Int Item396 /** \brief Creates a Int Item
399 * see [http://www.w3.org/TR/xmlschema-2/#int]397 * see [http://www.w3.org/TR/xmlschema-2/#int]
@@ -401,7 +399,7 @@
401 * @param aInt int representation of the Int.399 * @param aInt int representation of the Int.
402 * @return The NCName Item.400 * @return The NCName Item.
403 */401 */
404 Item createInt (int aInt);402 Item createInt (int aInt);
405403
406 /** \brief Creates an Integer Item404 /** \brief Creates an Integer Item
407 * see [http://www.w3.org/TR/xmlschema-2/#integer]405 * see [http://www.w3.org/TR/xmlschema-2/#integer]
@@ -409,7 +407,7 @@
409 * @param aInteger String representation of the Integer.407 * @param aInteger String representation of the Integer.
410 * @return The Integer Item.408 * @return The Integer Item.
411 */409 */
412 Item createInteger (const std::string &aInteger);410 Item createInteger (const std::string &aInteger);
413411
414 /** \brief Creates an Integer Item412 /** \brief Creates an Integer Item
415 * see [http://www.w3.org/TR/xmlschema-2/#integer]413 * see [http://www.w3.org/TR/xmlschema-2/#integer]
@@ -417,7 +415,7 @@
417 * @param aInteger unsigned long representation of the Integer.415 * @param aInteger unsigned long representation of the Integer.
418 * @return The Integer Item.416 * @return The Integer Item.
419 */417 */
420 Item createInteger (long long aInteger);418 Item createInteger (long long aInteger);
421419
422 /** \brief Creates a Long Item420 /** \brief Creates a Long Item
423 * see [http://www.w3.org/TR/xmlschema-2/#long]421 * see [http://www.w3.org/TR/xmlschema-2/#long]
@@ -425,7 +423,7 @@
425 * @param aLong long long representation of the Long.423 * @param aLong long long representation of the Long.
426 * @return The Long Item.424 * @return The Long Item.
427 */425 */
428 Item createLong (long long aLong);426 Item createLong (long long aLong);
429427
430 /** \brief Creates a NCName Item428 /** \brief Creates a NCName Item
431 * see [http://www.w3.org/TR/xmlschema-2/#NCName]429 * see [http://www.w3.org/TR/xmlschema-2/#NCName]
@@ -433,7 +431,7 @@
433 * @param aValue String representation of the NCName.431 * @param aValue String representation of the NCName.
434 * @return The NCName Item.432 * @return The NCName Item.
435 */433 */
436 Item createNCName (const std::string &aValue);434 Item createNCName (const std::string &aValue);
437435
438 /** \brief Creates a negativeInteger Item436 /** \brief Creates a negativeInteger Item
439 * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger]437 * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger]
@@ -441,7 +439,7 @@
441 * @param aValue long long representation of the negativeInteger.439 * @param aValue long long representation of the negativeInteger.
442 * @return The negativeInteger Item.440 * @return The negativeInteger Item.
443 */441 */
444 Item createNegativeInteger (long long aValue);442 Item createNegativeInteger (long long aValue);
445443
446 /** \brief Creates a nonNegativeInteger Item444 /** \brief Creates a nonNegativeInteger Item
447 * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger]445 * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger]
@@ -449,7 +447,7 @@
449 * @param aValue unsigned long representation of the nonNegativeInteger.447 * @param aValue unsigned long representation of the nonNegativeInteger.
450 * @return The nonNegativeInteger Item.448 * @return The nonNegativeInteger Item.
451 */449 */
452 Item createNonNegativeInteger (unsigned long long aValue);450 Item createNonNegativeInteger (unsigned long long aValue);
453451
454 /** \brief Creates a nonPositiveInteger Item452 /** \brief Creates a nonPositiveInteger Item
455 * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger]453 * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger]
@@ -457,7 +455,7 @@
457 * @param aValue long long representation of the NCName.455 * @param aValue long long representation of the NCName.
458 * @return The nonPositiveInteger Item.456 * @return The nonPositiveInteger Item.
459 */457 */
460 Item createNonPositiveInteger (long long aValue);458 Item createNonPositiveInteger (long long aValue);
461459
462 /**460 /**
463 * Create a new Processing Instruction node N and place it among the461 * Create a new Processing Instruction node N and place it among the
@@ -470,7 +468,7 @@
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.
471 * @return The new node N created by this method469 * @return The new node N created by this method
472 */470 */
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);
474472
475 /** \brief Creates a positiveInteger\ Item473 /** \brief Creates a positiveInteger\ Item
476 * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger]474 * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger]
@@ -478,7 +476,7 @@
478 * @param aValue unsigned long representation of the positiveInteger.476 * @param aValue unsigned long representation of the positiveInteger.
479 * @return The positiveInteger Item.477 * @return The positiveInteger Item.
480 */478 */
481 Item createPositiveInteger (unsigned long long aValue);479 Item createPositiveInteger (unsigned long long aValue);
482480
483 /** \brief Creates a QName Item481 /** \brief Creates a QName Item
484 * see [http://www.w3.org/TR/xmlschema-2/#QName]482 * see [http://www.w3.org/TR/xmlschema-2/#QName]
@@ -489,7 +487,7 @@
489 *487 *
490 * @return The QName Item.488 * @return The QName Item.
491 */489 */
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);
493491
494 /** \brief Creates a QName Item492 /** \brief Creates a QName Item
495 * see [http://www.w3.org/TR/xmlschema-2/#QName]493 * see [http://www.w3.org/TR/xmlschema-2/#QName]
@@ -498,7 +496,7 @@
498 * @param aLocalname String representation of the localname. *496 * @param aLocalname String representation of the localname. *
499 * @return The QName Item.497 * @return The QName Item.
500 */498 */
501 Item createQName (const std::string &aNamespace, const std::string &aLocalname);499 Item createQName (const std::string &aNamespace, const std::string &aLocalname);
502500
503 /** \brief Creates a QName Item501 /** \brief Creates a QName Item
504 * see [http://www.w3.org/TR/xmlschema-2/#QName]502 * see [http://www.w3.org/TR/xmlschema-2/#QName]
@@ -509,7 +507,7 @@
509 * @param aQNameString String in the QName notation by James Clark.507 * @param aQNameString String in the QName notation by James Clark.
510 * @return The QName Item.508 * @return The QName Item.
511 */509 */
512 Item createQName (const std::string &aQNameString);510 Item createQName (const std::string &aQNameString);
513511
514 /** \brief Creates a Short Item512 /** \brief Creates a Short Item
515 * see [http://www.w3.org/TR/xmlschema-2/#short]513 * see [http://www.w3.org/TR/xmlschema-2/#short]
@@ -517,8 +515,8 @@
517 * @param aShort short representation of the Short.515 * @param aShort short representation of the Short.
518 * @return The Short Item.516 * @return The Short Item.
519 */517 */
520 Item createShort (short aShort);518 Item createShort (short aShort);
521 //Item createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false);519 //Item createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false);
522520
523 /** \brief Creates a String Item521 /** \brief Creates a String Item
524 * see [http://www.w3.org/TR/xmlschema-2/#string]522 * see [http://www.w3.org/TR/xmlschema-2/#string]
@@ -526,7 +524,7 @@
526 * @param aString String representation of the String Item.524 * @param aString String representation of the String Item.
527 * @return The String Item525 * @return The String Item
528 */526 */
529 Item createString (const std::string &aString);527 Item createString (const std::string &aString);
530528
531 /**529 /**
532 * Create a new text node N and place it among the530 * Create a new text node N and place it among the
@@ -537,7 +535,7 @@
537 * @param aContent The content of the new node.535 * @param aContent The content of the new node.
538 * @return The new node N created by this method536 * @return The new node N created by this method
539 */537 */
540 Item createTextNode (Item &aParent, const std::string &aContent);538 Item createTextNode (Item &aParent, const std::string &aContent);
541539
542 /** \brief Creates a Time Item540 /** \brief Creates a Time Item
543 * see [http://www.w3.org/TR/xmlschema-2/#time]541 * see [http://www.w3.org/TR/xmlschema-2/#time]
@@ -548,7 +546,7 @@
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.
549 * @return The Time Item.547 * @return The Time Item.
550 */548 */
551 Item createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours);549 Item createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours);
552550
553 /** \brief Creates a Time Item551 /** \brief Creates a Time Item
554 * see [http://www.w3.org/TR/xmlschema-2/#time]552 * see [http://www.w3.org/TR/xmlschema-2/#time]
@@ -558,7 +556,7 @@
558 * @param aSecond double representation of the seconds and fractional seconds.556 * @param aSecond double representation of the seconds and fractional seconds.
559 * @return The Time Item.557 * @return The Time Item.
560 */558 */
561 Item createTime (short aHour, short aMinute, double aSecond);559 Item createTime (short aHour, short aMinute, double aSecond);
562560
563 /** \brief Creates a Time Item561 /** \brief Creates a Time Item
564 * see [http://www.w3.org/TR/xmlschema-2/#time]562 * see [http://www.w3.org/TR/xmlschema-2/#time]
@@ -566,7 +564,7 @@
566 * @param aValue String representation of the Time.564 * @param aValue String representation of the Time.
567 * @return The Time Item565 * @return The Time Item
568 */566 */
569 Item createTime (const std::string &aValue);567 Item createTime (const std::string &aValue);
570568
571 /** \brief Creates an Unsigned Byte Item569 /** \brief Creates an Unsigned Byte Item
572 * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte]570 * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte]
@@ -574,7 +572,7 @@
574 * @param aValue unsignedByte unsigned char representation of the unsigned byte.572 * @param aValue unsignedByte unsigned char representation of the unsigned byte.
575 * @return The Unsigned Byte Item.573 * @return The Unsigned Byte Item.
576 */574 */
577 Item createUnsignedByte (const unsigned char aValue);575 Item createUnsignedByte (const unsigned char aValue);
578576
579 /** \brief Creates an unsigned int Item577 /** \brief Creates an unsigned int Item
580 * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt]578 * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt]
@@ -582,7 +580,7 @@
582 * @param aValue unsigned int representation of the unsignedInt.580 * @param aValue unsigned int representation of the unsignedInt.
583 * @return The unsignedInt Item.581 * @return The unsignedInt Item.
584 */582 */
585 Item createUnsignedInt (unsigned int aValue);583 Item createUnsignedInt (unsigned int aValue);
586584
587 /** \brief Creates an unsignedLong Item585 /** \brief Creates an unsignedLong Item
588 * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong]586 * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong]
@@ -590,7 +588,7 @@
590 * @param aValue unsignedLong long long representation of the unsignedLong.588 * @param aValue unsignedLong long long representation of the unsignedLong.
591 * @return The unsignedLong Item.589 * @return The unsignedLong Item.
592 */590 */
593 Item createUnsignedLong (unsigned long long aValue);591 Item createUnsignedLong (unsigned long long aValue);
594592
595 /** \brief Creates a unsignedShort Item593 /** \brief Creates a unsignedShort Item
596 * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort]594 * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort]
@@ -598,7 +596,55 @@
598 * @param aValue unsigned short representation of the unsignedShort.596 * @param aValue unsigned short representation of the unsignedShort.
599 * @return The unsignedShort Item.597 * @return The unsignedShort Item.
600 */598 */
601 Item createUnsignedShort (unsigned short aValue);599 Item createUnsignedShort (unsigned short aValue);
600
601 /**
602 * \brief Create a JSON null item.
603 */
604 Item createJSONNull();
605
606 /**
607 * \brief Create a JSON Number item from a string.
608 * This will actually be
609 * an xs:integer, xs:double, or xs:decimal, depending on the content
610 * of the string.
611 *
612 * @param aString The input string.
613 */
614 Item createJSONNumber(std::string aString);
615
616 /**
617 * \brief Create a JSON Object containing the specified JSON Pairs.
618 *
619 * @param aNames A vector containing the name and value of each pair.
620 */
621 Item createJSONObject(std::vector<std::pair<Item, Item> >& aNames);
622
623 /**
624 * \brief Create a JSON Object containing the specified string Pairs.
625 *
626 * @param aNames A vector containing the name and value of each pair.
627 */
628 Item createJSONObject(std::vector<std::pair<std::string, std::string> >& aNames);
629
630 /**
631 * \brief Create a JSON Array containing the specified items.
632 *
633 * @param aItems a Vector<Item> containing Items which may
634 * be stored in a JSON Array (namely JSON Arrays, JSON Objects,
635 * JSON nulls, valid JSON numeric types, or xs:strings).
636 */
637 Item createJSONArray(std::vector<Item>& aItems);
638
639 /**
640 * \brief Create a JSON Array containing the specified items.
641 *
642 * @param aItems a Vector<String> containing strings which may
643 * be stored in a JSON Array.
644 */
645 Item createJSONArray(std::vector<std::string>& aItems);
646
647
602}; // class ItemFactory648}; // class ItemFactory
603649
604#endif650#endif
605\ No newline at end of file651\ No newline at end of file
606652
=== modified file 'swig/ItemFactory.i'
--- swig/ItemFactory.i 2013-02-07 17:24:36 +0000
+++ swig/ItemFactory.i 2013-03-27 00:40:33 +0000
@@ -3,16 +3,15 @@
33
44
5 5
6 Item ItemFactory::createAnyURI (const std::string &aURI){6 Item ItemFactory::createAnyURI (const std::string &aURI){
7 return Item(theItemFactory->createAnyURI(aURI));7 return Item(theItemFactory->createAnyURI(aURI));
8 }8 }
9 9
10 Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue){10 Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue){
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 ));
12 }12 }
13 13
14#ifndef SWIGRUBY14 Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue){
15 Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue){
1615
17 std::vector< zorba::Item > typedValue;16 std::vector< zorba::Item > typedValue;
18 typedValue.reserve(aTypedValue.size());17 typedValue.reserve(aTypedValue.size());
@@ -22,71 +21,70 @@
22 }21 }
23 return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue ));22 return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue ));
24 }23 }
25#endif
26 24
27 Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){25 Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){
28 return Item( theItemFactory->createBase64Binary(aBinData, aLength));26 return Item( theItemFactory->createBase64Binary(aBinData, aLength));
29 }27 }
30 Item ItemFactory::createBase64Binary (std::istream &aStream){28 Item ItemFactory::createBase64Binary (std::istream &aStream){
31 return Item( theItemFactory->createBase64Binary(aStream));29 return Item( theItemFactory->createBase64Binary(aStream));
32 }30 }
33 Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){31 Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){
34 return Item( theItemFactory->createBase64Binary(aBinData, aLength));32 return Item( theItemFactory->createBase64Binary(aBinData, aLength));
35 }33 }
36 Item ItemFactory::createBoolean (bool aValue){34 Item ItemFactory::createBoolean (bool aValue){
37 return Item( theItemFactory->createBoolean(aValue));35 return Item( theItemFactory->createBoolean(aValue));
38 }36 }
39 Item ItemFactory::createByte (char aByte){37 Item ItemFactory::createByte (char aByte){
40 return Item( theItemFactory->createByte(aByte));38 return Item( theItemFactory->createByte(aByte));
41 }39 }
42 Item ItemFactory::createCommentNode (Item &aParent, const std::string &aContent){40 Item ItemFactory::createCommentNode (Item &aParent, const std::string &aContent){
43 zorba::String lContent = zorba::String(aContent);41 zorba::String lContent = zorba::String(aContent);
44 return Item( theItemFactory->createCommentNode (aParent.theItem, lContent));42 return Item( theItemFactory->createCommentNode (aParent.theItem, lContent));
45 }43 }
46 Item ItemFactory::createDate (const std::string &aDate){44 Item ItemFactory::createDate (const std::string &aDate){
47 return Item( theItemFactory->createDate(aDate));45 return Item( theItemFactory->createDate(aDate));
48 }46 }
49 Item ItemFactory::createDate (short aYear, short aMonth, short aDay){47 Item ItemFactory::createDate (short aYear, short aMonth, short aDay){
50 return Item( theItemFactory->createDate (aYear, aMonth, aDay));48 return Item( theItemFactory->createDate (aYear, aMonth, aDay));
51 }49 }
52 Item ItemFactory::createDateTime (const std::string &aDateTimeValue){50 Item ItemFactory::createDateTime (const std::string &aDateTimeValue){
53 return Item( theItemFactory->createDateTime (aDateTimeValue));51 return Item( theItemFactory->createDateTime (aDateTimeValue));
54 }52 }
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){
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));
57 }55 }
58 Item ItemFactory::createDecimal (const std::string &aValue){56 Item ItemFactory::createDecimal (const std::string &aValue){
59 return Item( theItemFactory->createDecimal (aValue));57 return Item( theItemFactory->createDecimal (aValue));
60 }58 }
61 Item ItemFactory::createDecimalFromDouble (double aValue){59 Item ItemFactory::createDecimalFromDouble (double aValue){
62 return Item( theItemFactory->createDecimalFromDouble (aValue));60 return Item( theItemFactory->createDecimalFromDouble (aValue));
63 }61 }
64 Item ItemFactory::createDecimalFromLong (unsigned long aValue){62 Item ItemFactory::createDecimalFromLong (unsigned long aValue){
65 return Item( theItemFactory->createDecimalFromLong (aValue));63 return Item( theItemFactory->createDecimalFromLong (aValue));
66 }64 }
67 Item ItemFactory::createDouble (const std::string &aValue){65 Item ItemFactory::createDouble (const std::string &aValue){
68 return Item( theItemFactory->createDouble (aValue));66 return Item( theItemFactory->createDouble (aValue));
69 }67 }
70 Item ItemFactory::createDouble (double aValue){68 Item ItemFactory::createDouble (double aValue){
71 return Item( theItemFactory->createDouble (aValue));69 return Item( theItemFactory->createDouble (aValue));
72 }70 }
73 Item ItemFactory::createDuration (const std::string &aValue){71 Item ItemFactory::createDuration (const std::string &aValue){
74 return Item( theItemFactory->createDuration (aValue));72 return Item( theItemFactory->createDuration (aValue));
75 }73 }
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){
77 return Item( theItemFactory->createDuration (aYear, aMonths, aDays, aHours, aMinutes, aSeconds));75 return Item( theItemFactory->createDuration (aYear, aMonths, aDays, aHours, aMinutes, aSeconds));
78 }76 }
79 Item ItemFactory::createDayTimeDuration (const std::string &aValue){77 Item ItemFactory::createDayTimeDuration (const std::string &aValue){
80 return Item( theItemFactory->createDayTimeDuration (aValue));78 return Item( theItemFactory->createDayTimeDuration (aValue));
81 }79 }
82 Item ItemFactory::createYearMonthDuration (const std::string &aValue){80 Item ItemFactory::createYearMonthDuration (const std::string &aValue){
83 return Item( theItemFactory->createYearMonthDuration (aValue));81 return Item( theItemFactory->createYearMonthDuration (aValue));
84 }82 }
85 Item ItemFactory::createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri){83 Item ItemFactory::createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri){
86 return Item( theItemFactory->createDocumentNode (aBaseUri, aDocUri));84 return Item( theItemFactory->createDocumentNode (aBaseUri, aDocUri));
87 }85 }
88#ifndef SWIGRUBY86
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){
90 std::vector< std::pair< zorba::String, zorba::String > > items;88 std::vector< std::pair< zorba::String, zorba::String > > items;
91 items.reserve(aNsBindings.size());89 items.reserve(aNsBindings.size());
92 std::vector< std::pair< std::string, std::string > >::iterator iter;90 std::vector< std::pair< std::string, std::string > >::iterator iter;
@@ -98,128 +96,184 @@
98 }96 }
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));
100 }98 }
101#endif99
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){
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> >()));
104 }102 }
105 Item ItemFactory::createFloat (const std::string &aValue){103 Item ItemFactory::createFloat (const std::string &aValue){
106 return Item( theItemFactory->createFloat (aValue));104 return Item( theItemFactory->createFloat (aValue));
107 }105 }
108 Item ItemFactory::createFloat (float aValue){106 Item ItemFactory::createFloat (float aValue){
109 return Item( theItemFactory->createFloat (aValue));107 return Item( theItemFactory->createFloat (aValue));
110 }108 }
111 Item ItemFactory::createGDay (const std::string &aValue){109 Item ItemFactory::createGDay (const std::string &aValue){
112 return Item( theItemFactory->createGDay (aValue));110 return Item( theItemFactory->createGDay (aValue));
113 }111 }
114 Item ItemFactory::createGDay (short aDay){112 Item ItemFactory::createGDay (short aDay){
115 return Item( theItemFactory->createGDay (aDay));113 return Item( theItemFactory->createGDay (aDay));
116 }114 }
117 Item ItemFactory::createGMonth (const std::string &aValue){115 Item ItemFactory::createGMonth (const std::string &aValue){
118 return Item( theItemFactory->createGMonth (aValue));116 return Item( theItemFactory->createGMonth (aValue));
119 }117 }
120 Item ItemFactory::createGMonth (short aMonth){118 Item ItemFactory::createGMonth (short aMonth){
121 return Item( theItemFactory->createGMonth (aMonth));119 return Item( theItemFactory->createGMonth (aMonth));
122 }120 }
123 Item ItemFactory::createGMonthDay (const std::string &aValue){121 Item ItemFactory::createGMonthDay (const std::string &aValue){
124 return Item( theItemFactory->createGMonthDay (aValue));122 return Item( theItemFactory->createGMonthDay (aValue));
125 }123 }
126 Item ItemFactory::createGMonthDay (short aMonth, short aDay){124 Item ItemFactory::createGMonthDay (short aMonth, short aDay){
127 return Item( theItemFactory->createGMonthDay (aMonth, aDay));125 return Item( theItemFactory->createGMonthDay (aMonth, aDay));
128 }126 }
129 Item ItemFactory::createGYear (short aYear){127 Item ItemFactory::createGYear (short aYear){
130 return Item( theItemFactory->createGYear (aYear));128 return Item( theItemFactory->createGYear (aYear));
131 }129 }
132 Item ItemFactory::createGYear (const std::string &aValue){130 Item ItemFactory::createGYear (const std::string &aValue){
133 return Item( theItemFactory->createGYear (aValue));131 return Item( theItemFactory->createGYear (aValue));
134 }132 }
135 Item ItemFactory::createGYearMonth (const std::string &aValue){133 Item ItemFactory::createGYearMonth (const std::string &aValue){
136 return Item( theItemFactory->createGYearMonth (aValue));134 return Item( theItemFactory->createGYearMonth (aValue));
137 }135 }
138 Item ItemFactory::createGYearMonth (short aYear, short aMonth){136 Item ItemFactory::createGYearMonth (short aYear, short aMonth){
139 return Item( theItemFactory->createGYearMonth (aYear, aMonth));137 return Item( theItemFactory->createGYearMonth (aYear, aMonth));
140 }138 }
141 Item ItemFactory::createHexBinary (const char *aHexData, size_t aSize){139 Item ItemFactory::createHexBinary (const char *aHexData, size_t aSize){
142 return Item( theItemFactory->createHexBinary (aHexData, aSize));140 return Item( theItemFactory->createHexBinary (aHexData, aSize));
143 }141 }
144 Item ItemFactory::createInt (int aInt){142 Item ItemFactory::createInt (int aInt){
145 return Item( theItemFactory->createInt (aInt));143 return Item( theItemFactory->createInt (aInt));
146 }144 }
147 Item ItemFactory::createInteger (const std::string &aInteger){145 Item ItemFactory::createInteger (const std::string &aInteger){
148 return Item( theItemFactory->createInteger (aInteger));146 return Item( theItemFactory->createInteger (aInteger));
149 }147 }
150 Item ItemFactory::createInteger (long long aInteger){148 Item ItemFactory::createInteger (long long aInteger){
151 return Item( theItemFactory->createInteger (aInteger));149 return Item( theItemFactory->createInteger (aInteger));
152 }150 }
153 Item ItemFactory::createLong (long long aLong){151 Item ItemFactory::createLong (long long aLong){
154 return Item( theItemFactory->createLong (aLong));152 return Item( theItemFactory->createLong (aLong));
155 }153 }
156 Item ItemFactory::createNCName (const std::string &aValue){154 Item ItemFactory::createNCName (const std::string &aValue){
157 return Item( theItemFactory->createNCName (aValue));155 return Item( theItemFactory->createNCName (aValue));
158 }156 }
159 Item ItemFactory::createNegativeInteger (long long aValue){157 Item ItemFactory::createNegativeInteger (long long aValue){
160 return Item( theItemFactory->createNegativeInteger (aValue));158 return Item( theItemFactory->createNegativeInteger (aValue));
161 }159 }
162 Item ItemFactory::createNonNegativeInteger (unsigned long long aValue){160 Item ItemFactory::createNonNegativeInteger (unsigned long long aValue){
163 return Item( theItemFactory->createNonNegativeInteger (aValue));161 return Item( theItemFactory->createNonNegativeInteger (aValue));
164 }162 }
165 Item ItemFactory::createNonPositiveInteger (long long aValue){163 Item ItemFactory::createNonPositiveInteger (long long aValue){
166 return Item( theItemFactory->createNonPositiveInteger (aValue));164 return Item( theItemFactory->createNonPositiveInteger (aValue));
167 }165 }
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){
169 zorba::String lTarget = zorba::String(aTarget);167 zorba::String lTarget = zorba::String(aTarget);
170 zorba::String lContent = zorba::String(aContent);168 zorba::String lContent = zorba::String(aContent);
171 zorba::String lBaseUri = zorba::String(aBaseUri);169 zorba::String lBaseUri = zorba::String(aBaseUri);
172 return Item( theItemFactory->createPiNode (aParent.theItem, lTarget, lContent, lBaseUri));170 return Item( theItemFactory->createPiNode (aParent.theItem, lTarget, lContent, lBaseUri));
173 }171 }
174 Item ItemFactory::createPositiveInteger (unsigned long long aValue){172 Item ItemFactory::createPositiveInteger (unsigned long long aValue){
175 return Item( theItemFactory->createPositiveInteger (aValue));173 return Item( theItemFactory->createPositiveInteger (aValue));
176 }174 }
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){
178 return Item( theItemFactory->createQName (aNamespace, aPrefix, aLocalname));176 return Item( theItemFactory->createQName (aNamespace, aPrefix, aLocalname));
179 }177 }
180 Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aLocalname){178 Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aLocalname){
181 return Item( theItemFactory->createQName (aNamespace, aLocalname));179 return Item( theItemFactory->createQName (aNamespace, aLocalname));
182 }180 }
183 Item ItemFactory::createQName (const std::string &aQNameString){181 Item ItemFactory::createQName (const std::string &aQNameString){
184 return Item( theItemFactory->createQName (aQNameString));182 return Item( theItemFactory->createQName (aQNameString));
185 }183 }
186 Item ItemFactory::createShort (short aShort){184 Item ItemFactory::createShort (short aShort){
187 return Item( theItemFactory->createShort (aShort));185 return Item( theItemFactory->createShort (aShort));
188 }186 }
189 /*187 /*
190 Item ItemFactory::createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false){188 Item ItemFactory::createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false){
191 return Item( theItemFactory->createStreamableString (std::istream &stream, StreamReleaser streamReleaser, seekable));189 return Item( theItemFactory->createStreamableString (std::istream &stream, StreamReleaser streamReleaser, seekable));
192 }190 }
193 */191 */
194 Item ItemFactory::createString (const std::string &aString){192 Item ItemFactory::createString (const std::string &aString){
195 return Item( theItemFactory->createString (aString));193 return Item( theItemFactory->createString (aString));
196 }194 }
197 Item ItemFactory::createTextNode (Item &aParent, const std::string &aContent){195 Item ItemFactory::createTextNode (Item &aParent, const std::string &aContent){
198 zorba::String lContent = zorba::String(aContent);196 zorba::String lContent = zorba::String(aContent);
199 return Item( theItemFactory->createTextNode (aParent.theItem, lContent));197 return Item( theItemFactory->createTextNode (aParent.theItem, lContent));
200 }198 }
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){
202 return Item( theItemFactory->createTime (aHour, aMinute, aSecond, aTimeZone_hours));200 return Item( theItemFactory->createTime (aHour, aMinute, aSecond, aTimeZone_hours));
203 }201 }
204 Item ItemFactory::createTime (short aHour, short aMinute, double aSecond){202 Item ItemFactory::createTime (short aHour, short aMinute, double aSecond){
205 return Item( theItemFactory->createTime (aHour, aMinute, aSecond));203 return Item( theItemFactory->createTime (aHour, aMinute, aSecond));
206 }204 }
207 Item ItemFactory::createTime (const std::string &aValue){205 Item ItemFactory::createTime (const std::string &aValue){
208 return Item( theItemFactory->createTime (aValue));206 return Item( theItemFactory->createTime (aValue));
209 }207 }
210 Item ItemFactory::createUnsignedByte (const unsigned char aValue){208 Item ItemFactory::createUnsignedByte (const unsigned char aValue){
211 return Item( theItemFactory->createUnsignedByte (aValue));209 return Item( theItemFactory->createUnsignedByte (aValue));
212 }210 }
213 Item ItemFactory::createUnsignedInt (unsigned int aValue){211 Item ItemFactory::createUnsignedInt (unsigned int aValue){
214 return Item( theItemFactory->createUnsignedInt (aValue));212 return Item( theItemFactory->createUnsignedInt (aValue));
215 }213 }
216 Item ItemFactory::createUnsignedLong (unsigned long long aValue){214 Item ItemFactory::createUnsignedLong (unsigned long long aValue){
217 return Item( theItemFactory->createUnsignedLong (aValue));215 return Item( theItemFactory->createUnsignedLong (aValue));
218 }216 }
219 Item ItemFactory::createUnsignedShort (unsigned short aValue){217 Item ItemFactory::createUnsignedShort (unsigned short aValue){
220 return Item( theItemFactory->createUnsignedShort (aValue));218 return Item( theItemFactory->createUnsignedShort (aValue));
221 }219 }
222220
221 Item ItemFactory::createJSONNull() {
222 return Item( theItemFactory->createJSONNull() );
223 }
224
225 Item ItemFactory::createJSONNumber(std::string aString) {
226 return Item( theItemFactory->createJSONNumber(aString));
227 }
228
229 Item ItemFactory::createJSONObject(std::vector<std::pair<Item, Item> >& aNames) {
230 std::vector< std::pair< zorba::Item, zorba::Item > > names;
231 names.reserve(aNames.size());
232
233 for(std::vector< std::pair< Item, Item > >::iterator iter = aNames.begin(); iter != aNames.end(); iter++) {
234 std::pair< zorba::Item, zorba::Item > pair;
235 pair.first = (*iter).first.theItem;
236 pair.second = (*iter).second.theItem;
237 names.push_back(pair);
238 }
239 return Item( theItemFactory->createJSONObject (names) );
240 }
241
242 Item ItemFactory::createJSONObject(std::vector<std::pair<std::string, std::string> >& aNames) {
243 std::vector< std::pair< zorba::Item, zorba::Item > > names;
244 names.reserve(aNames.size());
245
246 for(std::vector<std::pair<std::string, std::string> >::iterator iter = aNames.begin(); iter != aNames.end(); iter++) {
247 std::pair< zorba::Item, zorba::Item > pair;
248 pair.first = theItemFactory->createString( (*iter).first );
249 pair.second = theItemFactory->createString( (*iter).second );
250 names.push_back(pair);
251 }
252 return Item( theItemFactory->createJSONObject (names) );
253 }
254
255 Item ItemFactory::createJSONArray(std::vector<Item>& aItems) {
256 std::vector< zorba::Item > items;
257 items.reserve(aItems.size());
258
259 for(std::vector< Item >::iterator iter = aItems.begin(); iter != aItems.end(); iter++) {
260 zorba::Item item = (*iter).theItem;
261 items.push_back(item);
262 }
263 return Item( theItemFactory->createJSONArray (items) );
264 }
265
266 Item ItemFactory::createJSONArray(std::vector<std::string>& aItems) {
267 std::vector< zorba::Item > items;
268 items.reserve(aItems.size());
269
270 for(std::vector< std::string >::iterator iter = aItems.begin(); iter != aItems.end(); iter++) {
271 zorba::Item item = theItemFactory->createString(*iter);
272 items.push_back(item);
273 }
274 return Item( theItemFactory->createJSONArray (items) );
275 }
276
223277
224%} // end Implementation278%} // end Implementation
225279
226280
=== modified file 'swig/StaticContext.i'
--- swig/StaticContext.i 2013-02-07 17:24:36 +0000
+++ swig/StaticContext.i 2013-03-27 00:40:33 +0000
@@ -35,13 +35,13 @@
35bool StaticContext::containsFunction(const std::string &aFnNameUri, const std::string &aFnNameLocal, int arity) const 35bool StaticContext::containsFunction(const std::string &aFnNameUri, const std::string &aFnNameLocal, int arity) const
36 { return theStaticContext->containsFunction(aFnNameUri, aFnNameLocal, arity); }36 { return theStaticContext->containsFunction(aFnNameUri, aFnNameLocal, arity); }
3737
38StaticContext StaticContext::createChildContext() const38StaticContext StaticContext::createChildContext() const
39 { return StaticContext(theStaticContext->createChildContext()); }39 { return StaticContext(theStaticContext->createChildContext()); }
40 40
41void StaticContext::declareOption (const Item &aQName, const std::string &aOptionVal)41void StaticContext::declareOption (const Item &aQName, const std::string &aOptionVal)
42 { return theStaticContext->declareOption(aQName.theItem, aOptionVal); }42 { return theStaticContext->declareOption(aQName.theItem, aOptionVal); }
4343
44void StaticContext::disableFunction (const Item &aQName, int arity)44void StaticContext::disableFunction (const Item &aQName, int arity)
45 { theStaticContext->disableFunction( aQName.theItem, arity); }45 { theStaticContext->disableFunction( aQName.theItem, arity); }
4646
47std::string StaticContext::getBaseURI () const47std::string StaticContext::getBaseURI () const
@@ -65,7 +65,7 @@
65 result = ZorbaConstants::PRESERVE_CONSTRUCTION;65 result = ZorbaConstants::PRESERVE_CONSTRUCTION;
66 }66 }
67 return result;67 return result;
68 } 68 }
6969
70ZorbaConstants::PreserveMode StaticContext::getCopyNamespacesModePreserve()70ZorbaConstants::PreserveMode StaticContext::getCopyNamespacesModePreserve()
71 { 71 {
7272
=== modified file 'swig/TypeIdentifier.i'
--- swig/TypeIdentifier.i 2012-03-27 00:56:11 +0000
+++ swig/TypeIdentifier.i 2013-03-27 00:40:33 +0000
@@ -19,7 +19,7 @@
19 zorba::IdentTypes::quantifier_t 19 zorba::IdentTypes::quantifier_t
20 TypeIdentifier::convertQuantifier(IdentTypes::Quantifier quantifier)20 TypeIdentifier::convertQuantifier(IdentTypes::Quantifier quantifier)
21 {21 {
22 zorba::IdentTypes::quantifier_t result;22 zorba::IdentTypes::quantifier_t result = zorba::IdentTypes::QUANT_ONE;
23 switch (quantifier) {23 switch (quantifier) {
24 case IdentTypes::QUANT_ONE:24 case IdentTypes::QUANT_ONE:
25 result = zorba::IdentTypes::QUANT_ONE;25 result = zorba::IdentTypes::QUANT_ONE;
@@ -44,7 +44,7 @@
44 IdentTypes::Kind TypeIdentifier::getKind()44 IdentTypes::Kind TypeIdentifier::getKind()
45 {45 {
46 zorba::IdentTypes::kind_t lKind = theTypeIdentifier->getKind();46 zorba::IdentTypes::kind_t lKind = theTypeIdentifier->getKind();
47 IdentTypes::Kind result;47 IdentTypes::Kind result = IdentTypes::ANY_NODE_TYPE;
48 switch (lKind) {48 switch (lKind) {
49 case zorba::IdentTypes::NAMED_TYPE:49 case zorba::IdentTypes::NAMED_TYPE:
50 result = IdentTypes::NAMED_TYPE;50 result = IdentTypes::NAMED_TYPE;
@@ -92,7 +92,7 @@
92 IdentTypes::Quantifier TypeIdentifier::getQuantifier()92 IdentTypes::Quantifier TypeIdentifier::getQuantifier()
93 {93 {
94 zorba::IdentTypes::quantifier_t lQuantifier = theTypeIdentifier->getQuantifier();94 zorba::IdentTypes::quantifier_t lQuantifier = theTypeIdentifier->getQuantifier();
95 IdentTypes::Quantifier result;95 IdentTypes::Quantifier result = IdentTypes::QUANT_ONE;
96 switch (lQuantifier) {96 switch (lQuantifier) {
97 case zorba::IdentTypes::QUANT_ONE:97 case zorba::IdentTypes::QUANT_ONE:
98 result = IdentTypes::QUANT_ONE;98 result = IdentTypes::QUANT_ONE;
9999
=== modified file 'swig/ZorbaStreamBuffer.i'
--- swig/ZorbaStreamBuffer.i 2012-09-06 23:54:47 +0000
+++ swig/ZorbaStreamBuffer.i 2013-03-27 00:40:33 +0000
@@ -82,7 +82,7 @@
8282
83std::streamsize ZorbaStreamBuffer::xsputn ( const char * BYTE, std::streamsize len ) {83std::streamsize ZorbaStreamBuffer::xsputn ( const char * BYTE, std::streamsize len ) {
84 // Wrapping to virtual function84 // Wrapping to virtual function
85 streamWrapper->write(BYTE, len);85 streamWrapper->write(BYTE, static_cast<size_t>(len));
86 return len;86 return len;
87}87}
8888
8989
=== modified file 'swig/csharp/tests/CMakeLists.txt'
--- swig/csharp/tests/CMakeLists.txt 2012-07-27 22:56:27 +0000
+++ swig/csharp/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000
@@ -21,6 +21,8 @@
21STRING(REGEX REPLACE "/" "\\\\" CSharpPath "${CSharpPath}")21STRING(REGEX REPLACE "/" "\\\\" CSharpPath "${CSharpPath}")
22STRING(REGEX REPLACE "/" "\\\\" CSharpBuildPath "${CSharpBuildPath}")22STRING(REGEX REPLACE "/" "\\\\" CSharpBuildPath "${CSharpBuildPath}")
2323
24CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY)
25
24FILE(GLOB CSHARP_EXAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.in")26FILE(GLOB CSHARP_EXAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.in")
25FOREACH(CSHARP_EXAMPLE ${CSHARP_EXAMPLES})27FOREACH(CSHARP_EXAMPLE ${CSHARP_EXAMPLES})
26 STRING(REPLACE ".in" "" CSHARP_EXAMPLE_DEST ${CSHARP_EXAMPLE})28 STRING(REPLACE ".in" "" CSHARP_EXAMPLE_DEST ${CSHARP_EXAMPLE})
2729
=== added file 'swig/csharp/tests/satellites.json'
--- swig/csharp/tests/satellites.json 1970-01-01 00:00:00 +0000
+++ swig/csharp/tests/satellites.json 2013-03-27 00:40:33 +0000
@@ -0,0 +1,17 @@
1{
2 "creator" : "Satellites plugin version 0.6.4",
3 "satellites" : {
4 "AAU CUBESAT" : {
5 "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768",
6 "visible" : false
7 },
8 "AJISAI (EGS)" : {
9 "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696",
10 "visible" : true
11 },
12 "AKARI (ASTRO-F)" : {
13 "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294",
14 "visible" : true
15 }
16 }
17}
018
=== modified file 'swig/csharp/tests/test01.cs'
--- swig/csharp/tests/test01.cs 2012-07-20 21:21:21 +0000
+++ swig/csharp/tests/test01.cs 2013-03-27 00:40:33 +0000
@@ -14,8 +14,6 @@
14 * limitations under the License.14 * limitations under the License.
15 */15 */
16using System;16using System;
17using System.Collections.Generic;
18using System.Linq;
19using System.Text;17using System.Text;
20using org.zorbaxquery.api;18using org.zorbaxquery.api;
2119
2220
=== added file 'swig/csharp/tests/test09.cs'
--- swig/csharp/tests/test09.cs 1970-01-01 00:00:00 +0000
+++ swig/csharp/tests/test09.cs 2013-03-27 00:40:33 +0000
@@ -0,0 +1,95 @@
1/*
2 * Copyright 2006-2012 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16using System;
17using System.Text;
18using org.zorbaxquery.api;
19
20namespace ZorbaApplication
21{
22
23 class MyDiagnosticHandler : DiagnosticHandler {
24 public override void error(ZorbaException exception) {
25 System.Console.WriteLine("Exception catched in MyDiagnosticHandler");
26 System.Console.WriteLine("Description: " + exception.getDescription());
27 }
28 }
29
30 class Program
31 {
32 static String test(String query) {
33 MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler();
34
35 InMemoryStore store = InMemoryStore.getInstance();
36 Zorba zorba = Zorba.getInstance(store);
37
38 XQuery xquery = zorba.compileQuery(query, diagnosticHandler);
39
40 StringBuilder sbuilder = new StringBuilder();
41 sbuilder.Append(xquery.execute());
42
43 xquery.destroy();
44 xquery.Dispose();
45
46 zorba.shutdown();
47 InMemoryStore.shutdown(store);
48
49 return sbuilder.ToString();
50 }
51
52 static void Main(string[] args)
53 {
54 System.Console.WriteLine("Running: Compile query string using JSONiq");
55
56 String query = @"
57 let $sats:=jn:json-doc('@CSharpPath@/tests/satellites.json')('satellites')
58 return {
59 'visible' : [
60 for $sat in jn:keys($sats)
61 where $sats($sat)('visible')
62 return $sat
63 ],
64 'invisible' : [
65 for $sat in jn:keys($sats)
66 where not($sats($sat)('visible'))
67 return $sat
68 ]
69 }
70 ";
71
72 String testResult = "{ \"visible\" : [ \"AJISAI (EGS)\", \"AKARI (ASTRO-F)\" ], \"invisible\" : [ \"AAU CUBESAT\" ] }";
73 System.Console.WriteLine("Query: " + query);
74 String result;
75 try {
76 result = test(query);
77 } catch(Exception e) {
78 System.Console.WriteLine("Failed");
79 Console.WriteLine("{0} Exception caught.", e);
80 return;
81 }
82
83 System.Console.WriteLine("Expecting: " + testResult);
84 System.Console.WriteLine("Result: " + result);
85
86 if (result.Equals(testResult)) {
87 System.Console.WriteLine("Success");
88 } else {
89 System.Console.WriteLine("Failed");
90 }
91
92
93 }
94 }
95}
096
=== added file 'swig/csharp/tests/test10.cs'
--- swig/csharp/tests/test10.cs 1970-01-01 00:00:00 +0000
+++ swig/csharp/tests/test10.cs 2013-03-27 00:40:33 +0000
@@ -0,0 +1,86 @@
1/*
2 * Copyright 2006-2012 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16using System;
17using System.Text;
18using org.zorbaxquery.api;
19
20namespace ZorbaApplication
21{
22
23 class MyDiagnosticHandler : DiagnosticHandler {
24 public override void error(ZorbaException exception) {
25 System.Console.WriteLine("Exception catched in MyDiagnosticHandler");
26 System.Console.WriteLine("Description: " + exception.getDescription());
27 }
28 }
29
30 class Program
31 {
32 static String test() {
33 MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler();
34
35 InMemoryStore store = InMemoryStore.getInstance();
36 Zorba zorba = Zorba.getInstance(store);
37
38 ItemFactory itemFactory = zorba.getItemFactory();
39 Item iNull = itemFactory.createJSONNull();
40 System.Console.WriteLine( "Creating JSON Item null: " + iNull.serialize());
41 iNull.Dispose();
42
43 Item iNumber = itemFactory.createJSONNumber("5");
44 System.Console.WriteLine( "Creating JSON Item number: " + iNumber.serialize() );
45 iNumber.Dispose();
46
47 StringVector sv = new StringVector();
48 sv.Add("Hello");
49 sv.Add("Zorba");
50 sv.Add("Hello");
51 sv.Add("Zorba");
52 Item iArray = itemFactory.createJSONArray(sv);
53 sv.Dispose();
54 System.Console.WriteLine( "Creating JSON Item array: " + iArray.serialize() );
55 iArray.Dispose();
56
57 zorba.shutdown();
58 InMemoryStore.shutdown(store);
59
60 return "ok";
61 }
62
63 static void Main(string[] args)
64 {
65 System.Console.WriteLine("Running: Compile query string using Diagnostic Handler");
66
67 String testResult = "ok";
68 String result;
69 try {
70 result = test();
71 } catch(Exception e) {
72 System.Console.WriteLine("Failed");
73 Console.WriteLine("{0} Exception caught.", e);
74 return;
75 }
76
77 if (result.Equals(testResult)) {
78 System.Console.WriteLine("Success");
79 } else {
80 System.Console.WriteLine("Failed");
81 }
82
83
84 }
85 }
86}
087
=== modified file 'swig/java/CMakeLists.txt'
--- swig/java/CMakeLists.txt 2013-02-07 17:24:36 +0000
+++ swig/java/CMakeLists.txt 2013-03-27 00:40:33 +0000
@@ -32,21 +32,21 @@
3232
33 SET( CMAKE_SWIG_FLAGS -package org.zorbaxquery.api)33 SET( CMAKE_SWIG_FLAGS -package org.zorbaxquery.api)
3434
35 SWIG_ADD_MODULE( lib_zorba_java_api java zorba_api.i )35 SWIG_ADD_MODULE( zorba_api_java java zorba_api.i )
36 SWIG_LINK_LIBRARIES( lib_zorba_java_api zorba_simplestore ${JAVA_LIBRARY} )36 SWIG_LINK_LIBRARIES( zorba_api_java zorba_simplestore ${JAVA_LIBRARY} )
37 IF (WIN32)37 IF (WIN32)
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")
39 ELSE (WIN32)39 ELSE (WIN32)
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")
41 ENDIF (WIN32)41 ENDIF (WIN32)
42 IF ( APPLE )42 IF ( APPLE )
43 SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES SUFFIX .jnilib )43 SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES SUFFIX .jnilib )
44 ENDIF ( APPLE )44 ENDIF ( APPLE )
4545
46 # The following fix was added because of the changes in CMake 2.8, which have the46 # The following fix was added because of the changes in CMake 2.8, which have the
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"
48 IF (LINUX OR CYGWIN OR APPLE)48 IF (LINUX OR CYGWIN OR APPLE)
49 SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES PREFIX "" )49 SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES PREFIX "" )
50 ENDIF (LINUX OR CYGWIN OR APPLE)50 ENDIF (LINUX OR CYGWIN OR APPLE)
5151
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")
@@ -60,7 +60,7 @@
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}")
61 ENDFOREACH(ZORBA_JAVA_EXTRA ${ZORBA_JAVA_EXTRAS})61 ENDFOREACH(ZORBA_JAVA_EXTRA ${ZORBA_JAVA_EXTRAS})
62 62
63 ADD_CUSTOM_COMMAND(TARGET lib_zorba_java_api63 ADD_CUSTOM_COMMAND(TARGET zorba_api_java
64 POST_BUILD64 POST_BUILD
65 COMMAND cmake -E echo "Compiling Java files..."65 COMMAND cmake -E echo "Compiling Java files..."
66 COMMAND ${Java_JAVAC_EXECUTABLE} *.java -d ${CMAKE_CURRENT_BINARY_DIR}66 COMMAND ${Java_JAVAC_EXECUTABLE} *.java -d ${CMAKE_CURRENT_BINARY_DIR}
@@ -79,12 +79,12 @@
7979
80 IF ( APPLE )80 IF ( APPLE )
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})
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})
83 ELSE ( APPLE )83 ELSE ( APPLE )
84 IF(NOT WIN32)84 IF(NOT WIN32)
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})
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})
87 ELSE(NOT WIN32)87 ELSE(NOT WIN32)
88 IF (MSVC_IDE)88 IF (MSVC_IDE)
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
90 DESTINATION share/java90 DESTINATION share/java
@@ -100,7 +100,7 @@
100 DESTINATION share/java100 DESTINATION share/java
101 COMPONENT "java_swig")101 COMPONENT "java_swig")
102 ENDIF (MSVC_IDE)102 ENDIF (MSVC_IDE)
103 ENDIF(NOT WIN32)103 ENDIF(NOT WIN32)
104 ENDIF ( APPLE )104 ENDIF ( APPLE )
105105
106 106
107107
=== modified file 'swig/php/CMakeLists.txt'
--- swig/php/CMakeLists.txt 2013-02-07 17:24:36 +0000
+++ swig/php/CMakeLists.txt 2013-03-27 00:40:33 +0000
@@ -24,25 +24,32 @@
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)
25 ENDIF (WIN32)25 ENDIF (WIN32)
2626
27 SWIG_ADD_MODULE (zorba_api php5 zorba_api.i)27 SWIG_ADD_MODULE (zorba_api_php php5 zorba_api.i)
2828
29 IF (APPLE)29 IF (APPLE)
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})
31 ELSE (APPLE)31 ELSE (APPLE)
32 SWIG_LINK_LIBRARIES (zorba_api zorba_simplestore)32 SWIG_LINK_LIBRARIES (zorba_api_php zorba_simplestore)
33 ENDIF (APPLE)33 ENDIF (APPLE)
3434
35 #fix for library path, using windows backslash causes error
35 IF (WIN32)36 IF (WIN32)
36 STRING(REGEX REPLACE "\\\\" "/" PHP5_LIBRARY "${PHP5_LIBRARY}")37 STRING(REGEX REPLACE "\\\\" "/" PHP5_LIBRARY "${PHP5_LIBRARY}")
37 SWIG_LINK_LIBRARIES (zorba_api ${PHP5_LIBRARY})38 SWIG_LINK_LIBRARIES (zorba_api_php ${PHP5_LIBRARY})
38 ENDIF (WIN32)39 ENDIF (WIN32)
3940
40 #Copy test to the build folder41 #Copy test to the build folder
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)
42 43
43 #Copy44 #Copy alternate files
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)
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
47 ADD_CUSTOM_COMMAND(
48 TARGET zorba_api_php
49 POST_BUILD
50 COMMAND cmake -E echo "Fixing PHP wrapper..."
51 COMMAND cmake -P "${CMAKE_CURRENT_SOURCE_DIR}/postfix.cmake"
52 )
4653
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")
48 FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})55 FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
@@ -51,10 +58,14 @@
5158
52 # The following fix was added because of the changes in CMake 2.8, which have the59 # The following fix was added because of the changes in CMake 2.8, which have the
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"
54 SET_TARGET_PROPERTIES( ${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PROJECT_LABEL "PHP" FOLDER "APIs")
55 IF (LINUX OR CYGWIN OR APPLE)61 IF (LINUX OR CYGWIN OR APPLE)
56 SET_TARGET_PROPERTIES (${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "")62 SET_TARGET_PROPERTIES (${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "")
57 ENDIF (LINUX OR CYGWIN OR APPLE)63 ENDIF (LINUX OR CYGWIN OR APPLE)
64
65 #set project folder location for IDEs
66 SET_TARGET_PROPERTIES(zorba_api_php PROPERTIES PROJECT_LABEL "PHP" FOLDER "APIs")
67
68 SET_TARGET_PROPERTIES(zorba_api_php PROPERTIES OUTPUT_NAME "zorba_api")
5869
59 IF (NOT WIN32 OR CYGWIN)70 IF (NOT WIN32 OR CYGWIN)
60 STRING (REPLACE ${CMAKE_INSTALL_PREFIX} "" PHP5_INSTALL_PATH ${PHP5_EXTENSION_DIR})71 STRING (REPLACE ${CMAKE_INSTALL_PREFIX} "" PHP5_INSTALL_PATH ${PHP5_EXTENSION_DIR})
@@ -67,7 +78,7 @@
67 ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}zorba_api.so78 ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}zorba_api.so
68 DESTINATION ${PHP5_INSTALL_PATH}79 DESTINATION ${PHP5_INSTALL_PATH}
69 )80 )
70 ELSE (NOT WIN32 OR CYGWIN)81 ELSE (NOT WIN32 OR CYGWIN)
71 IF (MSVC_IDE)82 IF (MSVC_IDE)
72 INSTALL ( FILES 83 INSTALL ( FILES
73 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php84 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php
@@ -79,7 +90,7 @@
79 INSTALL ( FILES 90 INSTALL ( FILES
80 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php91 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php
81 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php92 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php
82 ${CMAKE_CURRENT_BINARY_DIR}/php_zorba_api.dll93 ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.dll
83 COMPONENT "php_swig"94 COMPONENT "php_swig"
84 DESTINATION share/php )95 DESTINATION share/php )
85 ENDIF (MSVC_IDE)96 ENDIF (MSVC_IDE)
8697
=== modified file 'swig/php/XQueryProcessor.php'
--- swig/php/XQueryProcessor.php 2012-01-17 13:30:49 +0000
+++ swig/php/XQueryProcessor.php 2013-03-27 00:40:33 +0000
@@ -1,5 +1,5 @@
1<?php1<?php
2require_once 'Zorba/zorba_api_wrapper.php';2require_once 'zorba_api_wrapper.php';
33
4class XQueryCompilerException extends Exception{}4class XQueryCompilerException extends Exception{}
5class XQueryProcessorException extends Exception{}5class XQueryProcessorException extends Exception{}
66
=== added file 'swig/php/postfix.cmake'
--- swig/php/postfix.cmake 1970-01-01 00:00:00 +0000
+++ swig/php/postfix.cmake 2013-03-27 00:40:33 +0000
@@ -0,0 +1,8 @@
1
2FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" FILE_CONTENT)
3STRING(REGEX REPLACE "php_zorba_api.dll" "zorba_api.dll" MODIFIED_FILE_CONTENT "${FILE_CONTENT}")
4STRING(REGEX REPLACE "zorba_api.so" "libzorba_api.so" MODIFIED_FILE_CONTENT "${MODIFIED_FILE_CONTENT}")
5STRING(REGEX REPLACE "'zorba_api.'" "'libzorba_api.'" MODIFIED_FILE_CONTENT "${MODIFIED_FILE_CONTENT}")
6FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" "${MODIFIED_FILE_CONTENT}")
7
8CONFIGURE_FILE("${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php" COPYONLY)
09
=== modified file 'swig/php/tests/CMakeLists.txt'
--- swig/php/tests/CMakeLists.txt 2013-02-07 17:24:36 +0000
+++ swig/php/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000
@@ -1,4 +1,4 @@
1# Copyright 2006-2011 The FLWOR Foundation.1# Copyright 2006-2013 The FLWOR Foundation.
2# 2#
3# Licensed under the Apache License, Version 2.0 (the "License");3# Licensed under the Apache License, Version 2.0 (the "License");
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.
@@ -18,69 +18,29 @@
18ELSE (MSVC_IDE)18ELSE (MSVC_IDE)
19 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php)19 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php)
20ENDIF (MSVC_IDE)20ENDIF (MSVC_IDE)
21SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php)21SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php/Zorba)
22
23IF (WIN32)
24 STRING(REGEX REPLACE "/" "\\\\" phpExtensionPath "${phpExtensionPath}")
25 STRING(REGEX REPLACE "/" "\\\\" phpPath "${phpPath}")
26 STRING(REGEX REPLACE "/" "\\\\" phpIncludePath "${phpIncludePath}")
27ENDIF (WIN32)
2228
23CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini)29CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini)
24
25CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)30CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)
26CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY)31CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY)
2732
28CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.php ${CMAKE_CURRENT_BINARY_DIR}/test01.php)33#copy tests
29ADD_TEST("php_test01" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test01.php)34FILE(GLOB ZORBA_PHP_TESTS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.php")
30SET_TESTS_PROPERTIES("php_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success")35FOREACH(ZORBA_PHP_TEST ${ZORBA_PHP_TESTS})
3136 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_PHP_TEST}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_PHP_TEST}")
32CONFIGURE_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}")
33ADD_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})
34SET_TESTS_PROPERTIES("php_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success")39 SET_TESTS_PROPERTIES("php_${ZORBA_PHP_TEST_NAME}" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
3540ENDFOREACH(ZORBA_PHP_TEST ${ZORBA_PHP_TESTS})
36#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.php ${CMAKE_CURRENT_BINARY_DIR}/test03.php)41
37#ADD_TEST("php_test03" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test03.php)42#copy additional .xq files
38#SET_TESTS_PROPERTIES("php_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success")43FILE(GLOB ZORBA_PHP_XQS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.xq")
3944FOREACH(ZORBA_PHP_XQ ${ZORBA_PHP_XQS})
40CONFIGURE_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)
41ADD_TEST("php_test04" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test04.php)46ENDFOREACH(ZORBA_PHP_XQ ${ZORBA_PHP_XQS})
42CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY)
43SET_TESTS_PROPERTIES("php_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
44
45CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.php ${CMAKE_CURRENT_BINARY_DIR}/test05.php)
46ADD_TEST("php_test05" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test05.php)
47CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY)
48SET_TESTS_PROPERTIES("php_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
49
50CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.php ${CMAKE_CURRENT_BINARY_DIR}/test06.php)
51ADD_TEST("php_test06" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test06.php)
52CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY)
53SET_TESTS_PROPERTIES("php_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
54
55CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.php ${CMAKE_CURRENT_BINARY_DIR}/test07.php)
56ADD_TEST("php_test07" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test07.php)
57SET_TESTS_PROPERTIES("php_test07" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
58
59CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.php ${CMAKE_CURRENT_BINARY_DIR}/test08.php)
60ADD_TEST("php_test08" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test08.php)
61SET_TESTS_PROPERTIES("php_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
62
63#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test09.php ${CMAKE_CURRENT_BINARY_DIR}/test09.php)
64#ADD_TEST("php_test09" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test09.php)
65#SET_TESTS_PROPERTIES("php_test09" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
66
67CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.php ${CMAKE_CURRENT_BINARY_DIR}/test10.php)
68ADD_TEST("php_test10" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test10.php)
69SET_TESTS_PROPERTIES("php_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
70
71#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.php ${CMAKE_CURRENT_BINARY_DIR}/test11.php)
72#ADD_TEST("php_test11" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test11.php)
73#SET_TESTS_PROPERTIES("php_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
74
75#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.php ${CMAKE_CURRENT_BINARY_DIR}/test12.php)
76#ADD_TEST("php_test12" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test12.php)
77#SET_TESTS_PROPERTIES("php_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
78
79#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.php ${CMAKE_CURRENT_BINARY_DIR}/test13.php)
80#ADD_TEST("php_test13" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test13.php)
81#SET_TESTS_PROPERTIES("php_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
82
83#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.php ${CMAKE_CURRENT_BINARY_DIR}/test14.php)
84#ADD_TEST("php_test14" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test14.php)
85#SET_TESTS_PROPERTIES("php_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
86
8747
=== modified file 'swig/php/tests/php.ini.in'
--- swig/php/tests/php.ini.in 2012-03-27 00:56:11 +0000
+++ swig/php/tests/php.ini.in 2013-03-27 00:40:33 +0000
@@ -1,3 +1,3 @@
1enable_dl=On1enable_dl=On
2extension_dir=@phpExtensionPath@2extension_dir=@phpExtensionPath@
3include_path=".:@phpIncludePath@"
4\ No newline at end of file3\ No newline at end of file
4include_path="@phpIncludePath@"
5\ No newline at end of file5\ No newline at end of file
66
=== added file 'swig/php/tests/satellites.json'
--- swig/php/tests/satellites.json 1970-01-01 00:00:00 +0000
+++ swig/php/tests/satellites.json 2013-03-27 00:40:33 +0000
@@ -0,0 +1,17 @@
1{
2 "creator" : "Satellites plugin version 0.6.4",
3 "satellites" : {
4 "AAU CUBESAT" : {
5 "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768",
6 "visible" : false
7 },
8 "AJISAI (EGS)" : {
9 "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696",
10 "visible" : true
11 },
12 "AKARI (ASTRO-F)" : {
13 "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294",
14 "visible" : true
15 }
16 }
17}
018
=== modified file 'swig/php/tests/test01.php'
--- swig/php/tests/test01.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test01.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20print "Running: Get zorba instance and shutdown\n";20print "Running: Get zorba instance and shutdown\n";
2121
2222
=== modified file 'swig/php/tests/test02.php'
--- swig/php/tests/test02.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test02.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20function test(Zorba $aZorba) {
21 $lQuery = $aZorba->compileQuery("(1,2,3,4,5)");21 $lQuery = $aZorba->compileQuery("(1,2,3,4,5)");
2222
=== removed file 'swig/php/tests/test03.php'
--- swig/php/tests/test03.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test03.php 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
1<?
2/*
3 * Copyright 2006-2012 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18require '@phpPath@/Zorba/zorba_api_wrapper.php';
19
20class MyDiagnosticHandler(DiagnosticHandler handler) {
21 funtion error(self, *args) {
22 print "Error args: ", args;
23 }
24}
25
26function test(Zorba $aZorba)
27{
28 diagnosticHandler = MyDiagnosticHandler()
29 try {
30 xquery = zorba.compileQuery("1 div 0", diagnosticHandler);
31 print xquery.execute()
32 } catch (Exception e) {
33 print "Caught error: ";
34 }
35 return
36}
37
38$store = InMemoryStore::getInstance();
39$zorba = Zorba::getInstance($store);
40
41print "Running: Compile query string using Diagnostic Handler"
42test($zorba);
43print "Success";
44
45$zorba->shutdown();
46InMemoryStore::shutdown($store);
47
48?>
49\ No newline at end of file0\ No newline at end of file
501
=== added file 'swig/php/tests/test03.php.disabled'
--- swig/php/tests/test03.php.disabled 1970-01-01 00:00:00 +0000
+++ swig/php/tests/test03.php.disabled 2013-03-27 00:40:33 +0000
@@ -0,0 +1,52 @@
1<?
2/*
3 * Copyright 2006-2013 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18require 'zorba_api_wrapper.php';
19
20class MyDiagnosticHandler extends DiagnosticHandler {
21 public function error($args) {
22 print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n";
23 }
24}
25
26function test(Zorba $aZorba)
27{
28 $diagnosticHandler = new MyDiagnosticHandler();
29 try {
30 $xquery = $aZorba->compileQuery("1 div 0", $diagnosticHandler);
31 $xquery->execute();
32 } catch (ZorbaException $e) {
33 print "Caught unexpected Zorba error: " . $e->getDescription();
34 exit();
35 } catch (Exception $e) {
36 print "Caught error: " . $e;
37 exit();
38 }
39 return;
40}
41
42$store = InMemoryStore::getInstance();
43$zorba = Zorba::getInstance($store);
44
45print "Running: Compile query string using Diagnostic Handler\n";
46test($zorba);
47print "Success\n";
48
49$zorba->shutdown();
50InMemoryStore::shutdown($store);
51
52?>
053
=== modified file 'swig/php/tests/test04.php'
--- swig/php/tests/test04.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test04.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20function test(Zorba $aZorba) {
21 #Read and write result21 #Read and write result
2222
=== modified file 'swig/php/tests/test05.php'
--- swig/php/tests/test05.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test05.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20function test(Zorba $aZorba) {
21 #Read and write result21 #Read and write result
2222
=== modified file 'swig/php/tests/test06.php'
--- swig/php/tests/test06.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test06.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20function test(Zorba $aZorba) {
21 #Read and write result21 #Read and write result
2222
=== modified file 'swig/php/tests/test07.php'
--- swig/php/tests/test07.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test07.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20function test(Zorba $aZorba) {
21 $filename = 'books.xml';21 $filename = 'books.xml';
2222
=== modified file 'swig/php/tests/test08.php'
--- swig/php/tests/test08.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test08.php 2013-03-27 00:40:33 +0000
@@ -15,7 +15,7 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function println($string) {20function println($string) {
21 print $string."\n";21 print $string."\n";
2222
=== modified file 'swig/php/tests/test09.php'
--- swig/php/tests/test09.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test09.php 2013-03-27 00:40:33 +0000
@@ -15,66 +15,29 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20function test(Zorba $aZorba) {
21 $xquery = $aZorba->compileQuery("<a>text-a1<b at1='att1' at2='{1+2}'>text-b1</b>text-a2</a>");21 $filename = 'books.xml';
22 22 $f = fopen($filename, 'r');
23 23 $contents = fread($f, filesize($filename));
24 $saxHandler = new SAX2ContentHandlerProxy();24 fclose($f);
25 $saxHandler->setStartDocumentHandler(startDocumentHandler);25
26 $saxHandler->setEndDocumentHandler(endDocumentHandler);26 $dataManager = $aZorba->getXmlDataManager();
27 $saxHandler->setStartElementHandler(startElementHandler);27 $docIter = $dataManager->parseXML($contents);
28 $saxHandler->setEndElementHandler(endElementHandler);28 $docIter->open();
29 $saxHandler->setCharactersHandler(charactersHandler);29
30 $saxHandler->setProcessingInstructionHandler(processingInstructionHandler);30 $doc = Item::createEmptyItem();
31 $saxHandler->setIgnorableWhitespaceHandler(ignorableWhitespaceHandler);31 $docIter->next($doc);
32 $saxHandler->setStartPrefixMappingHandler(startPrefixMappingHandler);32
33 $saxHandler->setEndPrefixMappingHandler(endPrefixMappingHandler);33 $docIter->close();
34 $saxHandler->setSkippedEntityHandler(skippedEntityHandler);34 $docIter->destroy();
35 $xquery->executeSAX($saxHandler);35
3636 $xquery = $aZorba->compileQuery(".");
37 return;37 $dynCtx = $xquery->getDynamicContext();
38}38 $dynCtx->setContextItem($doc);
3939 print $xquery->execute()."\n";
40function startDocumentHandler() {40
41 print "Start Document";
42 return;
43}
44function endDocumentHandler() {
45 print "End Document";
46 return;
47}
48function startElementHandler($URI, $localName, $QName, $SAXAttributes) {
49 print "Start Element - " . $QName;
50 return;
51}
52function endElementHandler($URI, $localName, $QName) {
53 print "End Element - " . $QName;
54 return;
55}
56function charactersHandler($text) {
57 print "Characters - " . $text;
58 return;
59}
60function processingInstructionHandler($target, $data) {
61 print "Processing Instruction";
62 return;
63}
64function ignorableWhitespaceHandler($text) {
65 print "Ignorable Whitespace - " . $text;
66 return;
67}
68function startPrefixMappingHandler($prefix, $URI) {
69 print "Start Prefix Mapping - " . $prefix;
70 return;
71}
72function endPrefixMappingHandler($prefix) {
73 print "End Prefix Mapping - " . $prefix;
74 return;
75}
76function skippedEntityHandler($name) {
77 print "Skipped Entity - " . $name;
78 return;41 return;
79}42}
8043
@@ -82,7 +45,7 @@
82$store = InMemoryStore::getInstance();45$store = InMemoryStore::getInstance();
83$zorba = Zorba::getInstance($store);46$zorba = Zorba::getInstance($store);
8447
85print "Running: XQuery execute - executeSAX\n";48print "Running: XQuery execute - Get Iterator and print info from its items\n";
86test($zorba);49test($zorba);
87print "Success";50print "Success";
8851
8952
=== modified file 'swig/php/tests/test10.php'
--- swig/php/tests/test10.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test10.php 2013-03-27 00:40:33 +0000
@@ -1,6 +1,6 @@
1<?1<?
2/*2/*
3 * Copyright 2006-2012 The FLWOR Foundation.3 * Copyright 2006-2013 The FLWOR Foundation.
4 *4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");5 * Licensed under the Apache License, Version 2.0 (the "License");
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.
@@ -15,41 +15,53 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20function test(Zorba $aZorba) {20class MyDiagnosticHandler extends DiagnosticHandler {
21 $filename = 'books.xml';21 public function error($args) {
22 $f = fopen($filename, 'r');22 print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n";
23 $contents = fread($f, filesize($filename));23 }
24 fclose($f);24}
2525
26 $dataManager = $aZorba->getXmlDataManager();26function test(Zorba $aZorba, $query)
27 $docIter = $dataManager->parseXML($contents);27{
28 $docIter->open();28 $diagnosticHandler = new MyDiagnosticHandler();
2929 $xquery = $aZorba->compileQuery($query, $diagnosticHandler);
30 $doc = Item::createEmptyItem();30 try {
31 $docIter->next($doc);31 print $xquery->execute();
3232 } catch (Exception $e) {
33 $docIter->close();33 print "Caught error: " . $e;
34 $docIter->destroy();34 exit();
3535 }
36 $xquery = $aZorba->compileQuery(".");36 $xquery->destroy();
37 $dynCtx = $xquery->getDynamicContext();
38 $dynCtx->setContextItem($doc);
39 print $xquery->execute()."\n";
40
41 return;37 return;
42}38}
4339
44
45$store = InMemoryStore::getInstance();40$store = InMemoryStore::getInstance();
46$zorba = Zorba::getInstance($store);41$zorba = Zorba::getInstance($store);
4742
48print "Running: XQuery execute - Get Iterator and print info from its items\n";43print "Running: Compile query string using JSONiq \n";
49test($zorba);44
50print "Success";45$query = <<<'eoquery'
46 let $sats:=jn:json-doc("@phpPath@/tests/satellites.json")('satellites')
47 return {
48 'visible' : [
49 for $sat in jn:keys($sats)
50 where $sats($sat)('visible')
51 return $sat
52 ],
53 'invisible' : [
54 for $sat in jn:keys($sats)
55 where not($sats($sat)('visible'))
56 return $sat
57 ]
58 }
59eoquery;
60
61test($zorba, $query);
62print "Success\n";
5163
52$zorba->shutdown();64$zorba->shutdown();
53InMemoryStore::shutdown($store);65InMemoryStore::shutdown($store);
5466
55?>
56\ No newline at end of file67\ No newline at end of file
68?>
5769
=== modified file 'swig/php/tests/test11.php'
--- swig/php/tests/test11.php 2013-02-07 17:24:36 +0000
+++ swig/php/tests/test11.php 2013-03-27 00:40:33 +0000
@@ -1,6 +1,6 @@
1<?1<?
2/*2/*
3 * Copyright 2006-2012 The FLWOR Foundation.3 * Copyright 2006-2013 The FLWOR Foundation.
4 *4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");5 * Licensed under the Apache License, Version 2.0 (the "License");
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.
@@ -15,34 +15,45 @@
15 * limitations under the License.15 * limitations under the License.
16 */16 */
1717
18require '@phpPath@/Zorba/zorba_api_wrapper.php';18require 'zorba_api_wrapper.php';
1919
20class MyDiagnosticHandler(DiagnosticHandler handler) {20class MyDiagnosticHandler extends DiagnosticHandler {
21 funtion error(self, *args) {21 public function error($args) {
22 print "Error args: ", args;22 print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n";
23 }23 }
24}24}
2525
26function test(Zorba $aZorba)26function test(Zorba $aZorba)
27{27{
28 diagnosticHandler = MyDiagnosticHandler()28 $diagnosticHandler = new MyDiagnosticHandler();
29 try {29 try {
30 xquery = zorba.compileQuery("1 div 0", diagnosticHandler);30 $itemFactory = $aZorba->getItemFactory();
31 print xquery.execute()31 print "Creating JSON Item null: ". $itemFactory->createJSONNull()->serialize() . "\n";
32 } catch (Exception e) {32 print "Creating JSON Item number: ". $itemFactory->createJSONNumber("5")->serialize() . "\n";
33 print "Caught error: ";33 $sv = new StringVector(4);
34 $sv->set(0, "Hello");
35 $sv->set(1, "Zorba");
36 $sv->set(2, "Hello");
37 $sv->set(3, "Zorba");
38 print "Creating JSON Item array: ". $itemFactory->createJSONArray($sv)->serialize() . "\n";
39 print "Success";
40 } catch (ZorbaException $e) {
41 print "Caught unexpected Zorba error: " . $e->getDescription() . "\n" ;
42 exit();
43 } catch (Exception $e) {
44 print "Caught error: " . $e . "\n";
45 exit();
34 }46 }
35 return47 return;
36}48}
3749
38$store = InMemoryStore::getInstance();50$store = InMemoryStore::getInstance();
39$zorba = Zorba::getInstance($store);51$zorba = Zorba::getInstance($store);
4052
41print "Running: Compile query string using Diagnostic Handler"53print "Running: Compile query string using Diagnostic Handler\n";
42test($zorba);54test($zorba);
43print "Success";
4455
45$zorba->shutdown();56$zorba->shutdown();
46InMemoryStore::shutdown($store);57InMemoryStore::shutdown($store);
4758
48?>
49\ No newline at end of file59\ No newline at end of file
60?>
5061
=== removed file 'swig/php/tests/test12.php'
--- swig/php/tests/test12.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test12.php 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
1<?
2/*
3 * Copyright 2006-2012 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18//require '@phpPath@/Zorba/zorba_api_wrapper.php';
19require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
20
21class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
22 def error(self, *args):
23 print "Error args: ", args
24
25def test(zorba):
26 #Read and write result
27 print 'Executing: compilerHints.xq'
28 f = open('compilerHints.xq', 'r')
29 lines = f.read()
30 f.close()
31 diagnosticHandler = MyDiagnosticHandler()
32 compilerHints = zorba_api.CompilerHints()
33 compilerHints.setOptimizationLevel(1)
34 xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
35
36 result = xquery.execute()
37 print result
38 return
39
40
41store = zorba_api.InMemoryStore_getInstance()
42zorba = zorba_api.Zorba_getInstance(store)
43
44print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1"
45test(zorba)
46print "Success"
47
48
49zorba.shutdown()
50zorba_api.InMemoryStore_shutdown(store)
51
52?>
53\ No newline at end of file0\ No newline at end of file
541
=== removed file 'swig/php/tests/test13.php'
--- swig/php/tests/test13.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test13.php 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1<?
2/*
3 * Copyright 2006-2012 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18//require '@phpPath@/Zorba/zorba_api_wrapper.php';
19require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
20
21class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
22 def error(self, *args):
23 print "Error args: ", args
24
25def test(zorba):
26 #Read and write result
27 print 'Executing: compilerHints.xq'
28 f = open('compilerHints.xq', 'r')
29 lines = f.read()
30 f.close()
31 diagnosticHandler = MyDiagnosticHandler()
32 compilerHints = zorba_api.CompilerHints()
33 compilerHints.setLibModule(True)
34 compilerHints.setOptimizationLevel(0)
35 xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
36
37 result = xquery.execute()
38 print result
39 return
40
41
42store = zorba_api.InMemoryStore_getInstance()
43zorba = zorba_api.Zorba_getInstance(store)
44
45print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 0 - setLibModule(True)"
46test(zorba)
47print "Success"
48
49
50zorba.shutdown()
51zorba_api.InMemoryStore_shutdown(store)
52
53?>
54\ No newline at end of file0\ No newline at end of file
551
=== removed file 'swig/php/tests/test14.php'
--- swig/php/tests/test14.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/test14.php 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1<?
2/*
3 * Copyright 2006-2012 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18//require '@phpPath@/Zorba/zorba_api_wrapper.php';
19require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
20
21class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
22 def error(self, *args):
23 print "Error args: ", args
24
25def test(zorba):
26 #Read and write result
27 print 'Executing: compilerHints.xq'
28 f = open('compilerHints.xq', 'r')
29 lines = f.read()
30 f.close()
31 diagnosticHandler = MyDiagnosticHandler()
32 compilerHints = zorba_api.CompilerHints()
33 compilerHints.setLibModule(True)
34 compilerHints.setOptimizationLevel(1)
35 xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
36
37 result = xquery.execute()
38 print result
39 return
40
41
42store = zorba_api.InMemoryStore_getInstance()
43zorba = zorba_api.Zorba_getInstance(store)
44
45print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1 - setLibModule(True)"
46test(zorba)
47print "Success"
48
49
50zorba.shutdown()
51zorba_api.InMemoryStore_shutdown(store)
52
53?>
54\ No newline at end of file0\ No newline at end of file
551
=== removed file 'swig/php/tests/zorba_api.php'
--- swig/php/tests/zorba_api.php 2012-03-27 00:56:11 +0000
+++ swig/php/tests/zorba_api.php 1970-01-01 00:00:00 +0000
@@ -1,178 +0,0 @@
1<?php
2/*
3 * Copyright 2006-2012 The FLWOR Foundation.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18// Try to load our extension if it's not already loaded.
19if (!extension_loaded("zorba_api")) {
20 if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
21 if (!dl('zorba_api.dll')) return;
22 } else {
23 // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'.
24 // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'.
25 if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
26 if (!dl('zorba_api.so')) return;
27 } else {
28 if (!dl('zorba_api.'.PHP_SHLIB_SUFFIX)) return;
29 }
30 }
31}
32
33class Item {
34 public $_cPtr=null;
35
36 static function createEmptyItem() {
37 $r=Item_createEmptyItem();
38 return is_resource($r) ? new Item($r) : $r;
39 }
40
41 function getStringValue() {
42 return Item_getStringValue($this->_cPtr);
43 }
44
45 function __construct() {
46 $this->_cPtr=new_Item();
47 }
48}
49
50class Iterator {
51 public $_cPtr=null;
52
53 function open() {
54 Iterator_open($this->_cPtr);
55 }
56
57 function next($arg1) {
58 return Iterator_next($this->_cPtr,$arg1);
59 }
60
61 function close() {
62 Iterator_close($this->_cPtr);
63 }
64
65 function destroy() {
66 Iterator_destroy($this->_cPtr);
67 }
68
69 function __construct($cPtr) {
70 $this->_cPtr=$cPtr;
71 }
72
73 public function __destruct() {
74 $this->destroy();
75 }
76}
77
78class XQuery {
79 public $_cPtr=null;
80
81 function execute() {
82 return XQuery_execute($this->_cPtr);
83 }
84
85 function isUpdateQuery() {
86 return XQuery_isUpdateQuery($this->_cPtr);
87 }
88
89 function applyUpdates() {
90 XQuery_applyUpdates($this->_cPtr);
91 }
92
93 function destroy() {
94 XQuery_destroy($this->_cPtr);
95 }
96
97 function iterator() {
98 $r=XQuery_iterator($this->_cPtr);
99 return is_resource($r) ? new Iterator($r) : $r;
100 }
101
102 function __construct($cPtr) {
103 $this->_cPtr=$cPtr;
104 }
105
106 function __destruct() {
107 $this->destroy();
108 }
109}
110
111class Store {
112 //public $_cPtr=null;
113
114 //function __construct() {
115 // $this->_cPtr=new_Store();
116 //}
117}
118
119class InMemoryStore extends Store {
120 public $_cPtr=null;
121
122 static function getInstance() {
123 $r=InMemoryStore_getInstance();
124 return is_resource($r) ? new InMemoryStore($r) : $r;
125 }
126
127 static function shutdown($arg1) {
128 InMemoryStore_shutdown($arg1);
129 }
130
131 private function __construct($cPtr) {
132 $this->_cPtr=$cPtr;
133 }
134}
135
136class XmlDataManager {
137 public $_cPtr=null;
138
139 function loadDocument($aName,$aContent) {
140 XmlDataManager_loadDocument($this->_cPtr,$aName,$aContent);
141 }
142
143 function deleteDocument($aName) {
144 return XmlDataManager_deleteDocument($this->_cPtr,$aName);
145 }
146
147 function __construct($cPtr) {
148 $this->_cPtr=$cPtr;
149 }
150}
151
152class Zorba {
153 public $_cPtr=null;
154
155 static function getInstance($arg1) {
156 $r=Zorba_getInstance($arg1->_cPtr);
157 return is_resource($r) ? new Zorba($r) : $r;
158 }
159
160 function compileQuery($aStr) {
161 $r=Zorba_compileQuery($this->_cPtr,$aStr);
162 return is_resource($r) ? new XQuery($r) : $r;
163 }
164
165 function getXmlDataManager() {
166 $r=Zorba_getXmlDataManager($this->_cPtr);
167 return is_resource($r) ? new XmlDataManager($r) : $r;
168 }
169
170 function shutdown() {
171 Zorba_shutdown($this->_cPtr);
172 }
173
174 private function __construct($cPtr) {
175 $this->_cPtr=$cPtr;
176 }
177}
178?>
1790
=== modified file 'swig/php/zorba_api.i'
--- swig/php/zorba_api.i 2013-02-07 17:24:36 +0000
+++ swig/php/zorba_api.i 2013-03-27 00:40:33 +0000
@@ -13,6 +13,9 @@
13 * See the License for the specific language governing permissions and13 * See the License for the specific language governing permissions and
14 * limitations under the License.14 * limitations under the License.
15 */15 */
16
17%rename (IteratorImpl) Iterator;
18
16%begin %{19%begin %{
17#include <iostream>20#include <iostream>
1821
@@ -36,8 +39,13 @@
36%{39%{
37#include "zend_exceptions.h"40#include "zend_exceptions.h"
38%}41%}
42
43TSRMLS_FETCH();
44
39%include ../zorba_api.i45%include ../zorba_api.i
46
40%{47%{
48
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); }
4250
43ZEND_API zval * mt_zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);51ZEND_API zval * mt_zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
4452
=== removed file 'swig/php/zorba_api_wrapper.php'
--- swig/php/zorba_api_wrapper.php 2013-02-07 17:24:36 +0000
+++ swig/php/zorba_api_wrapper.php 1970-01-01 00:00:00 +0000
@@ -1,1215 +0,0 @@
1<?php
2//Try to load the extension if it's not already loaded.
3if(!extension_loaded('zorba_api')) {
4 $zorbaExtNotLoaded = "Zorba extension couldn't loaded";
5 if(function_exists('dl')) {
6 if(strtolower(substr(PHP_OS, 0, 3)) === 'win') {
7 if(!dl('zorba_api.dll')) {
8 throw new Exception($zorbaExtNotLoaded);
9 }
10 } else {
11 $suffix = "so";
12 if(PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
13 $suffix = PHP_SHLIB_SUFFIX;
14 }
15 if(!dl('zorba_api.'.$suffix)) {
16 if(!dl('libzorba_api.'.$suffix)) {
17 throw new Exception($zorbaExtNotLoaded);
18 }
19 }
20 }
21 } else {
22 throw new Exception($zorbaExtNotLoaded);
23 }
24}
25
26class DynamicContext{
27 public $_cPtr=null;
28
29 public function __set($var, $value) {
30 $r = DynamicContext___set($this->_cPtr, $var, $value);
31 return $r;
32
33 }
34
35 public function __isset($var) {
36 $r = DynamicContext___isset($this->_cPtr, $var);
37 return $r;
38
39 }
40
41 public function __get($var) {
42 $r = DynamicContext___get($this->_cPtr, $var);
43 return $r;
44
45 }
46
47 public function setVariable($aNamespace, $aLocalname, $arg3) {
48 $r = DynamicContext_setVariable($this->_cPtr, $aNamespace, $aLocalname, $arg3);
49 return $r;
50
51 }
52
53 public function setContextItem($arg1) {
54 $r = DynamicContext_setContextItem($this->_cPtr, $arg1);
55 return $r;
56
57 }
58
59 public function __construct($ptr) {
60 $this->_cPtr = $ptr;
61 }
62
63}
64
65class Item{
66 public $_cPtr=null;
67
68 public function __set($var, $value) {
69 $r = Item___set($this->_cPtr, $var, $value);
70 return $r;
71
72 }
73
74 public function __isset($var) {
75 $r = Item___isset($this->_cPtr, $var);
76 return $r;
77
78 }
79
80 public function __get($var) {
81 $r = Item___get($this->_cPtr, $var);
82 return $r;
83
84 }
85
86 static public function createEmptyItem() {
87 $r = Item_createEmptyItem();
88 return is_resource($r) ? new Item($r) : $r;
89
90 }
91
92 public function getStringValue() {
93 $r = Item_getStringValue($this->_cPtr);
94 return $r;
95
96 }
97
98 public function serialize() {
99 $r = Item_serialize($this->_cPtr);
100 return $r;
101
102 }
103
104 public function getAtomizationValue() {
105 $r = Item_getAtomizationValue($this->_cPtr);
106 return is_resource($r) ? new IteratorImpl($r) : $r;
107
108 }
109
110 public function getAttributes() {
111 $r = Item_getAttributes($this->_cPtr);
112 return is_resource($r) ? new IteratorImpl($r) : $r;
113
114 }
115
116 public function getBooleanValue() {
117 $r = Item_getBooleanValue($this->_cPtr);
118 return $r;
119
120 }
121
122 public function getChildren() {
123 $r = Item_getChildren($this->_cPtr);
124 return is_resource($r) ? new IteratorImpl($r) : $r;
125
126 }
127
128 public function getEBV() {
129 $r = Item_getEBV($this->_cPtr);
130 return is_resource($r) ? new Item($r) : $r;
131
132 }
133
134 public function getIntValue() {
135 $r = Item_getIntValue($this->_cPtr);
136 return $r;
137
138 }
139
140 public function getLocalName() {
141 $r = Item_getLocalName($this->_cPtr);
142 return $r;
143
144 }
145
146 public function getNamespace() {
147 $r = Item_getNamespace($this->_cPtr);
148 return $r;
149
150 }
151
152 public function getNodeName($aNodeName) {
153 $r = Item_getNodeName($this->_cPtr, $aNodeName);
154 return $r;
155
156 }
157
158 public function getPrefix() {
159 $r = Item_getPrefix($this->_cPtr);
160 return $r;
161
162 }
163
164 public function getType() {
165 $r = Item_getType($this->_cPtr);
166 return is_resource($r) ? new Item($r) : $r;
167
168 }
169
170 public function getUnsignedIntValue() {
171 $r = Item_getUnsignedIntValue($this->_cPtr);
172 return $r;
173
174 }
175
176 public function getNodeKind() {
177 $r = Item_getNodeKind($this->_cPtr);
178 return $r;
179
180 }
181
182 public function isAtomic() {
183 $r = Item_isAtomic($this->_cPtr);
184 return $r;
185
186 }
187
188 public function isNaN() {
189 $r = Item_isNaN($this->_cPtr);
190 return $r;
191
192 }
193
194 public function isNode() {
195 $r = Item_isNode($this->_cPtr);
196 return $r;
197
198 }
199
200 public function isNull() {
201 $r = Item_isNull($this->_cPtr);
202 return $r;
203
204 }
205
206 public function isPosOrNegInf() {
207 $r = Item_isPosOrNegInf($this->_cPtr);
208 return $r;
209
210 }
211
212 public function __construct($ptr) {
213 $this->_cPtr = $ptr;
214 }
215
216}
217
218class IteratorImpl{
219 public $_cPtr=null;
220
221 public function __set($var, $value) {
222 $r = Iterator___set($this->_cPtr, $var, $value);
223 return $r;
224
225 }
226
227 public function __isset($var) {
228 $r = Iterator___isset($this->_cPtr, $var);
229 return $r;
230
231 }
232
233 public function __get($var) {
234 $r = Iterator___get($this->_cPtr, $var);
235 return $r;
236
237 }
238
239 public function open() {
240 $r = Iterator_open($this->_cPtr);
241 return $r;
242
243 }
244
245 public function next($arg1) {
246 $r = Iterator_next($this->_cPtr, $arg1);
247 return $r;
248
249 }
250
251 public function close() {
252 $r = Iterator_close($this->_cPtr);
253 return $r;
254
255 }
256
257 public function destroy() {
258 $r = Iterator_destroy($this->_cPtr);
259 return $r;
260
261 }
262
263 public function __construct($ptr) {
264 $this->_cPtr = $ptr;
265 }
266
267}
268
269class XQuery{
270 public $_cPtr=null;
271
272 public function __set($var, $value) {
273 $r = XQuery___set($this->_cPtr, $var, $value);
274 return $r;
275
276 }
277
278 public function __isset($var) {
279 $r = XQuery___isset($this->_cPtr, $var);
280 return $r;
281
282 }
283
284 public function __get($var) {
285 $r = XQuery___get($this->_cPtr, $var);
286 return $r;
287
288 }
289
290 public function execute() {
291 $r = XQuery_execute($this->_cPtr);
292 return $r;
293
294 }
295
296 public function printPlanAsXML() {
297 $r = XQuery_printPlanAsXML($this->_cPtr);
298 return $r;
299
300 }
301
302 public function printPlanAsDOT() {
303 $r = XQuery_printPlanAsDOT($this->_cPtr);
304 return $r;
305
306 }
307
308 public function compile($aQuery, $aStaticContext=null) {
309 switch(func_num_args()) {
310 case 1: $r = XQuery_compile($this->_cPtr, $aQuery);break;
311 case 2: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);break;
312 default: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);
313 }
314 return $r;
315
316 }
317
318 public function destroy() {
319 $r = XQuery_destroy($this->_cPtr);
320 return $r;
321
322 }
323
324 public function iterator() {
325 $r = XQuery_iterator($this->_cPtr);
326 return is_resource($r) ? new IteratorImpl($r) : $r;
327
328 }
329
330 public function getDynamicContext() {
331 $r = XQuery_getDynamicContext($this->_cPtr);
332 return is_resource($r) ? new DynamicContext($r) : $r;
333
334 }
335
336 public function __construct($ptr) {
337 $this->_cPtr = $ptr;
338 }
339
340}
341
342class Store{
343 public $_cPtr=null;
344
345 public function __set($var, $value) {
346 $r = Store___set($this->_cPtr, $var, $value);
347 return $r;
348
349 }
350
351 public function __isset($var) {
352 $r = Store___isset($this->_cPtr, $var);
353 return $r;
354
355 }
356
357 public function __get($var) {
358 $r = Store___get($this->_cPtr, $var);
359 return $r;
360
361 }
362
363 public function __construct($ptr) {
364 $this->_cPtr = $ptr;
365 }
366
367}
368
369class InMemoryStore extends Store{
370 public $_cPtr=null;
371
372 static public function getInstance() {
373 $r = InMemoryStore_getInstance();
374 return is_resource($r) ? new InMemoryStore($r) : $r;
375
376 }
377
378 static public function shutdown($arg1) {
379 $r = InMemoryStore_shutdown($arg1);
380 return $r;
381
382 }
383
384}
385
386class DocumentManager{
387 public $_cPtr=null;
388
389 public function __set($var, $value) {
390 $r = DocumentManager___set($this->_cPtr, $var, $value);
391 return $r;
392
393 }
394
395 public function __isset($var) {
396 $r = DocumentManager___isset($this->_cPtr, $var);
397 return $r;
398
399 }
400
401 public function __get($var) {
402 $r = DocumentManager___get($this->_cPtr, $var);
403 return $r;
404
405 }
406
407 public function put($aName, $aDoc) {
408 $r = DocumentManager_put($this->_cPtr, $aName, $aDoc);
409 return $r;
410
411 }
412
413 public function remove($aName) {
414 $r = DocumentManager_remove($this->_cPtr, $aName);
415 return $r;
416
417 }
418
419 public function document($aName) {
420 $r = DocumentManager_document($this->_cPtr, $aName);
421 return is_resource($r) ? new Item($r) : $r;
422
423 }
424
425 public function isAvailableDocument($aName) {
426 $r = DocumentManager_isAvailableDocument($this->_cPtr, $aName);
427 return $r;
428
429 }
430
431 public function __construct($ptr) {
432 $this->_cPtr = $ptr;
433 }
434
435}
436
437class XmlDataManager{
438 public $_cPtr=null;
439
440 public function __set($var, $value) {
441 $r = XmlDataManager___set($this->_cPtr, $var, $value);
442 return $r;
443
444 }
445
446 public function __isset($var) {
447 $r = XmlDataManager___isset($this->_cPtr, $var);
448 return $r;
449
450 }
451
452 public function __get($var) {
453 $r = XmlDataManager___get($this->_cPtr, $var);
454 return $r;
455
456 }
457
458 public function getDocumentManager() {
459 $r = XmlDataManager_getDocumentManager($this->_cPtr);
460 return is_resource($r) ? new DocumentManager($r) : $r;
461
462 }
463
464 public function parseXML($aDoc) {
465 $r = XmlDataManager_parseXML($this->_cPtr, $aDoc);
466 return is_resource($r) ? new IteratorImpl($r) : $r;
467
468 }
469
470 public function __construct($ptr) {
471 $this->_cPtr = $ptr;
472 }
473
474}
475
476class ZorbaException{
477 public $_cPtr=null;
478
479 public function __set($var, $value) {
480 $r = ZorbaException___set($this->_cPtr, $var, $value);
481 return $r;
482
483 }
484
485 public function __isset($var) {
486 $r = ZorbaException___isset($this->_cPtr, $var);
487 return $r;
488
489 }
490
491 public function __get($var) {
492 $r = ZorbaException___get($this->_cPtr, $var);
493 return $r;
494
495 }
496
497 public function __construct($ptr) {
498 $this->_cPtr = $ptr;
499 }
500
501 public function getDescription() {
502 $r = ZorbaException_getDescription($this->_cPtr);
503 return $r;
504
505 }
506
507 public function getErrorCode() {
508 $r = ZorbaException_getErrorCode($this->_cPtr);
509 return $r;
510
511 }
512
513 public function getFileLineNumber() {
514 $r = ZorbaException_getFileLineNumber($this->_cPtr);
515 return $r;
516
517 }
518
519 public function getFileName() {
520 $r = ZorbaException_getFileName($this->_cPtr);
521 return $r;
522
523 }
524
525 static public function getErrorCodeAsString($aErrorCode) {
526 $r = ZorbaException_getErrorCodeAsString($aErrorCode);
527 return $r;
528
529 }
530
531}
532
533class XQueryException extends ZorbaException{
534 public $_cPtr=null;
535
536 public function getColumnBegin() {
537 $r = XQueryException_getColumnBegin($this->_cPtr);
538 return $r;
539
540 }
541
542 public function getLineBegin() {
543 $r = XQueryException_getLineBegin($this->_cPtr);
544 return $r;
545
546 }
547
548 public function getQueryURI() {
549 $r = XQueryException_getQueryURI($this->_cPtr);
550 return $r;
551
552 }
553
554}
555
556class CompilerHints{
557 public $_cPtr=null;
558
559 public function __set($var, $value) {
560 $r = CompilerHints___set($this->_cPtr, $var, $value);
561 return $r;
562
563 }
564
565 public function __isset($var) {
566 $r = CompilerHints___isset($this->_cPtr, $var);
567 return $r;
568
569 }
570
571 public function __get($var) {
572 $r = CompilerHints___get($this->_cPtr, $var);
573 return $r;
574
575 }
576
577 public function getLibModule() {
578 $r = CompilerHints_getLibModule($this->_cPtr);
579 return $r;
580
581 }
582
583 public function setLibModule($aLibModule) {
584 $r = CompilerHints_setLibModule($this->_cPtr, $aLibModule);
585 return $r;
586
587 }
588
589 public function getOptimizationLevel() {
590 $r = CompilerHints_getOptimizationLevel($this->_cPtr);
591 return $r;
592
593 }
594
595 public function setOptimizationLevel($aOptLevel) {
596 $r = CompilerHints_setOptimizationLevel($this->_cPtr, $aOptLevel);
597 return $r;
598
599 }
600
601 public function __construct($ptr) {
602 $this->_cPtr = $ptr;
603 }
604
605}
606
607class StaticContext{
608 public $_cPtr=null;
609
610 public function __set($var, $value) {
611 $r = StaticContext___set($this->_cPtr, $var, $value);
612 return $r;
613
614 }
615
616 public function __isset($var) {
617 $r = StaticContext___isset($this->_cPtr, $var);
618 return $r;
619
620 }
621
622 public function __get($var) {
623 $r = StaticContext___get($this->_cPtr, $var);
624 return $r;
625
626 }
627
628 public function __construct($ptr) {
629 $this->_cPtr = $ptr;
630 }
631
632 public function addColation($aURI) {
633 $r = StaticContext_addColation($this->_cPtr, $aURI);
634 return $r;
635
636 }
637
638 public function addNamespace($aPrefix, $aURI) {
639 $r = StaticContext_addNamespace($this->_cPtr, $aPrefix, $aURI);
640 return $r;
641
642 }
643
644 public function addReference() {
645 $r = StaticContext_addReference($this->_cPtr);
646 return $r;
647
648 }
649
650 public function containsFunction($aFnNameUri, $aFnNameLocal, $arity) {
651 $r = StaticContext_containsFunction($this->_cPtr, $aFnNameUri, $aFnNameLocal, $arity);
652 return $r;
653
654 }
655
656 public function createChildContext() {
657 $r = StaticContext_createChildContext($this->_cPtr);
658 return is_resource($r) ? new StaticContext($r) : $r;
659
660 }
661
662 public function declareOption($aQName, $aOptionVal) {
663 $r = StaticContext_declareOption($this->_cPtr, $aQName, $aOptionVal);
664 return $r;
665
666 }
667
668 public function disableFunction($aQName, $arity) {
669 $r = StaticContext_disableFunction($this->_cPtr, $aQName, $arity);
670 return $r;
671
672 }
673
674 public function free() {
675 $r = StaticContext_free($this->_cPtr);
676 return $r;
677
678 }
679
680 public function getBaseURI() {
681 $r = StaticContext_getBaseURI($this->_cPtr);
682 return $r;
683
684 }
685
686 public function getBoundarySpacePolicy() {
687 $r = StaticContext_getBoundarySpacePolicy($this->_cPtr);
688 return $r;
689
690 }
691
692 public function getConstructionMode() {
693 $r = StaticContext_getConstructionMode($this->_cPtr);
694 return $r;
695
696 }
697
698 public function getCopyNamespacesMode($aPreserve, $aInherit) {
699 $r = StaticContext_getCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit);
700 return $r;
701
702 }
703
704 public function getDefaultCollation() {
705 $r = StaticContext_getDefaultCollation($this->_cPtr);
706 return $r;
707
708 }
709
710 public function getDefaultElementAndTypeNamespace() {
711 $r = StaticContext_getDefaultElementAndTypeNamespace($this->_cPtr);
712 return $r;
713
714 }
715
716 public function getDefaultFunctionNamespace() {
717 $r = StaticContext_getDefaultFunctionNamespace($this->_cPtr);
718 return $r;
719
720 }
721
722 public function getDefaultOrderForEmptySequences() {
723 $r = StaticContext_getDefaultOrderForEmptySequences($this->_cPtr);
724 return $r;
725
726 }
727
728 public function getNamespaceURIByPrefix($aPrefix) {
729 $r = StaticContext_getNamespaceURIByPrefix($this->_cPtr, $aPrefix);
730 return $r;
731
732 }
733
734 public function getOption($aQName, $aOptionValue) {
735 $r = StaticContext_getOption($this->_cPtr, $aQName, $aOptionValue);
736 return $r;
737
738 }
739
740 public function getOrderingMode() {
741 $r = StaticContext_getOrderingMode($this->_cPtr);
742 return $r;
743
744 }
745
746 public function getRefCount() {
747 $r = StaticContext_getRefCount($this->_cPtr);
748 return $r;
749
750 }
751
752 public function getRevalidationMode() {
753 $r = StaticContext_getRevalidationMode($this->_cPtr);
754 return $r;
755
756 }
757
758 public function getXPath1_0CompatibMode() {
759 $r = StaticContext_getXPath1_0CompatibMode($this->_cPtr);
760 return $r;
761
762 }
763
764 public function loadProlog($aProlog, $hints) {
765 $r = StaticContext_loadProlog($this->_cPtr, $aProlog, $hints);
766 return $r;
767
768 }
769
770 public function removeReference() {
771 $r = StaticContext_removeReference($this->_cPtr);
772 return $r;
773
774 }
775
776 public function resetTraceStream() {
777 $r = StaticContext_resetTraceStream($this->_cPtr);
778 return $r;
779
780 }
781
782 public function setBaseURI($aBaseURI) {
783 $r = StaticContext_setBaseURI($this->_cPtr, $aBaseURI);
784 return $r;
785
786 }
787
788 public function setBoundarySpacePolicy($aMode) {
789 $r = StaticContext_setBoundarySpacePolicy($this->_cPtr, $aMode);
790 return $r;
791
792 }
793
794 public function setConstructionMode($aMode) {
795 $r = StaticContext_setConstructionMode($this->_cPtr, $aMode);
796 return $r;
797
798 }
799
800 public function setCopyNamespacesMode($aPreserve, $aInherit) {
801 $r = StaticContext_setCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit);
802 return $r;
803
804 }
805
806 public function setDefaultCollation($aURI) {
807 $r = StaticContext_setDefaultCollation($this->_cPtr, $aURI);
808 return $r;
809
810 }
811
812 public function setDefaultElementAndTypeNamespace($aURI) {
813 $r = StaticContext_setDefaultElementAndTypeNamespace($this->_cPtr, $aURI);
814 return $r;
815
816 }
817
818 public function setDefaultFunctionNamespace($aURI) {
819 $r = StaticContext_setDefaultFunctionNamespace($this->_cPtr, $aURI);
820 return $r;
821
822 }
823
824 public function setDefaultOrderForEmptySequences($aMode) {
825 $r = StaticContext_setDefaultOrderForEmptySequences($this->_cPtr, $aMode);
826 return $r;
827
828 }
829
830 public function setOrderingMode($aMode) {
831 $r = StaticContext_setOrderingMode($this->_cPtr, $aMode);
832 return $r;
833
834 }
835
836 public function setRevalidationMode($aMode) {
837 $r = StaticContext_setRevalidationMode($this->_cPtr, $aMode);
838 return $r;
839
840 }
841
842 public function setXPath1_0CompatibMode($aMode) {
843 $r = StaticContext_setXPath1_0CompatibMode($this->_cPtr, $aMode);
844 return $r;
845
846 }
847
848 public function destroy() {
849 $r = StaticContext_destroy($this->_cPtr);
850 return $r;
851
852 }
853
854}
855
856class Zorba{
857 public $_cPtr=null;
858
859 public function __set($var, $value) {
860 $r = Zorba___set($this->_cPtr, $var, $value);
861 return $r;
862
863 }
864
865 public function __isset($var) {
866 $r = Zorba___isset($this->_cPtr, $var);
867 return $r;
868
869 }
870
871 public function __get($var) {
872 $r = Zorba___get($this->_cPtr, $var);
873 return $r;
874
875 }
876
877 static public function getInstance($arg1) {
878 $r = Zorba_getInstance($arg1);
879 return is_resource($r) ? new Zorba($r) : $r;
880
881 }
882
883 public function createStaticContext() {
884 $r = Zorba_createStaticContext($this->_cPtr);
885 return is_resource($r) ? new StaticContext($r) : $r;
886
887 }
888
889 public function createQuery() {
890 $r = Zorba_createQuery($this->_cPtr);
891 return is_resource($r) ? new XQuery($r) : $r;
892
893 }
894
895 public function compileQuery($aStr, $aStaticContext=null) {
896 switch(func_num_args()) {
897 case 1: $r = Zorba_compileQuery($this->_cPtr, $aStr);break;
898 case 2: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);break;
899 default: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);
900 }
901 return is_resource($r) ? new XQuery($r) : $r;
902
903 }
904
905 public function getItemFactory() {
906 $r = Zorba_getItemFactory($this->_cPtr);
907 return is_resource($r) ? new ItemFactory($r) : $r;
908
909 }
910
911 public function getXmlDataManager() {
912 $r = Zorba_getXmlDataManager($this->_cPtr);
913 return is_resource($r) ? new XmlDataManager($r) : $r;
914
915 }
916
917 public function shutdown() {
918 $r = Zorba_shutdown($this->_cPtr);
919 return $r;
920
921 }
922
923 public function __construct($ptr) {
924 $this->_cPtr = $ptr;
925 }
926
927}
928
929class ItemFactory{
930 public $_cPtr=null;
931
932 public function __set($var, $value) {
933 $r = ItemFactory___set($this->_cPtr, $var, $value);
934 return $r;
935
936 }
937
938 public function __isset($var) {
939 $r = ItemFactory___isset($this->_cPtr, $var);
940 return $r;
941
942 }
943
944 public function __get($var) {
945 $r = ItemFactory___get($this->_cPtr, $var);
946 return $r;
947
948 }
949
950 public function __construct($ptr) {
951 $this->_cPtr = $ptr;
952 }
953
954 public function createAnyURI($aURI) {
955 $r = ItemFactory_createAnyURI($this->_cPtr, $aURI);
956 return is_resource($r) ? new Item($r) : $r;
957
958 }
959
960 public function createAttributeNode($aParent, $aNodeName, $aTypeName, $aTypedValue) {
961 $r = ItemFactory_createAttributeNode($this->_cPtr, $aParent, $aNodeName, $aTypeName, $aTypedValue);
962 return is_resource($r) ? new Item($r) : $r;
963
964 }
965
966 public function createBase64Binary($aBinData_or_aStream, $aLength=null) {
967 switch(func_num_args()) {
968 case 1: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream);break;
969 case 2: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);break;
970 default: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);
971 }
972 return is_resource($r) ? new Item($r) : $r;
973
974 }
975
976 public function createBoolean($aValue) {
977 $r = ItemFactory_createBoolean($this->_cPtr, $aValue);
978 return is_resource($r) ? new Item($r) : $r;
979
980 }
981
982 public function createByte($aByte) {
983 $r = ItemFactory_createByte($this->_cPtr, $aByte);
984 return is_resource($r) ? new Item($r) : $r;
985
986 }
987
988 public function createDate($aDate_or_aYear, $aMonth=null, $aDay=null) {
989 switch(func_num_args()) {
990 case 1: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear);break;
991 case 2: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth);break;
992 case 3: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);break;
993 default: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);
994 }
995 return is_resource($r) ? new Item($r) : $r;
996
997 }
998
999 public function createDateTime($aDateTimeValue_or_aYear, $aMonth=null, $aDay=null, $aHour=null, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) {
1000 switch(func_num_args()) {
1001 case 1: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear);break;
1002 case 2: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth);break;
1003 case 3: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay);break;
1004 case 4: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour);break;
1005 case 5: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute);break;
1006 case 6: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond);break;
1007 case 7: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);break;
1008 default: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);
1009 }
1010 return is_resource($r) ? new Item($r) : $r;
1011
1012 }
1013
1014 public function createDecimal($aValue) {
1015 $r = ItemFactory_createDecimal($this->_cPtr, $aValue);
1016 return is_resource($r) ? new Item($r) : $r;
1017
1018 }
1019
1020 public function createDecimalFromDouble($aValue) {
1021 $r = ItemFactory_createDecimalFromDouble($this->_cPtr, $aValue);
1022 return is_resource($r) ? new Item($r) : $r;
1023
1024 }
1025
1026 public function createDecimalFromLong($aValue) {
1027 $r = ItemFactory_createDecimalFromLong($this->_cPtr, $aValue);
1028 return is_resource($r) ? new Item($r) : $r;
1029
1030 }
1031
1032 public function createDouble($aValue) {
1033 $r = ItemFactory_createDouble($this->_cPtr, $aValue);
1034 return is_resource($r) ? new Item($r) : $r;
1035
1036 }
1037
1038 public function createDuration($aValue_or_aYear, $aMonths=null, $aDays=null, $aHours=null, $aMinutes=null, $aSeconds=null) {
1039 switch(func_num_args()) {
1040 case 1: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear);break;
1041 case 2: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths);break;
1042 case 3: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays);break;
1043 case 4: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours);break;
1044 case 5: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes);break;
1045 case 6: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);break;
1046 default: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);
1047 }
1048 return is_resource($r) ? new Item($r) : $r;
1049
1050 }
1051
1052 public function createFloat($aValue) {
1053 $r = ItemFactory_createFloat($this->_cPtr, $aValue);
1054 return is_resource($r) ? new Item($r) : $r;
1055
1056 }
1057
1058 public function createGDay($aValue_or_aDay) {
1059 $r = ItemFactory_createGDay($this->_cPtr, $aValue_or_aDay);
1060 return is_resource($r) ? new Item($r) : $r;
1061
1062 }
1063
1064 public function createGMonth($aValue_or_aMonth) {
1065 $r = ItemFactory_createGMonth($this->_cPtr, $aValue_or_aMonth);
1066 return is_resource($r) ? new Item($r) : $r;
1067
1068 }
1069
1070 public function createGMonthDay($aValue_or_aMonth, $aDay=null) {
1071 switch(func_num_args()) {
1072 case 1: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth);break;
1073 case 2: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);break;
1074 default: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);
1075 }
1076 return is_resource($r) ? new Item($r) : $r;
1077
1078 }
1079
1080 public function createGYear($aYear_or_aValue) {
1081 $r = ItemFactory_createGYear($this->_cPtr, $aYear_or_aValue);
1082 return is_resource($r) ? new Item($r) : $r;
1083
1084 }
1085
1086 public function createGYearMonth($aValue_or_aYear, $aMonth=null) {
1087 switch(func_num_args()) {
1088 case 1: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear);break;
1089 case 2: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);break;
1090 default: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);
1091 }
1092 return is_resource($r) ? new Item($r) : $r;
1093
1094 }
1095
1096 public function createHexBinary($aHexData, $aSize) {
1097 $r = ItemFactory_createHexBinary($this->_cPtr, $aHexData, $aSize);
1098 return is_resource($r) ? new Item($r) : $r;
1099
1100 }
1101
1102 public function createInt($aInt) {
1103 $r = ItemFactory_createInt($this->_cPtr, $aInt);
1104 return is_resource($r) ? new Item($r) : $r;
1105
1106 }
1107
1108 public function createInteger($aInteger) {
1109 $r = ItemFactory_createInteger($this->_cPtr, (string)$aInteger);
1110 return is_resource($r) ? new Item($r) : $r;
1111
1112 }
1113
1114 public function createLong($aLong) {
1115 $r = ItemFactory_createLong($this->_cPtr, $aLong);
1116 return is_resource($r) ? new Item($r) : $r;
1117
1118 }
1119
1120 public function createNCName($aValue) {
1121 $r = ItemFactory_createNCName($this->_cPtr, $aValue);
1122 return is_resource($r) ? new Item($r) : $r;
1123
1124 }
1125
1126 public function createNegativeInteger($aValue) {
1127 $r = ItemFactory_createNegativeInteger($this->_cPtr, $aValue);
1128 return is_resource($r) ? new Item($r) : $r;
1129
1130 }
1131
1132 public function createNonNegativeInteger($aValue) {
1133 $r = ItemFactory_createNonNegativeInteger($this->_cPtr, $aValue);
1134 return is_resource($r) ? new Item($r) : $r;
1135
1136 }
1137
1138 public function createNonPositiveInteger($aValue) {
1139 $r = ItemFactory_createNonPositiveInteger($this->_cPtr, $aValue);
1140 return is_resource($r) ? new Item($r) : $r;
1141
1142 }
1143
1144 public function createPositiveInteger($aValue) {
1145 $r = ItemFactory_createPositiveInteger($this->_cPtr, $aValue);
1146 return is_resource($r) ? new Item($r) : $r;
1147
1148 }
1149
1150 public function createQName($aNamespace_or_aQNameString, $aPrefix_or_aLocalname=null, $aLocalname=null) {
1151 switch(func_num_args()) {
1152 case 1: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString);break;
1153 case 2: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname);break;
1154 case 3: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);break;
1155 default: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);
1156 }
1157 return is_resource($r) ? new Item($r) : $r;
1158
1159 }
1160
1161 public function createShort($aShort) {
1162 $r = ItemFactory_createShort($this->_cPtr, $aShort);
1163 return is_resource($r) ? new Item($r) : $r;
1164
1165 }
1166
1167 public function createString($aString) {
1168 $r = ItemFactory_createString($this->_cPtr, $aString);
1169 return is_resource($r) ? new Item($r) : $r;
1170
1171 }
1172
1173 public function createTextNode($parent, $content) {
1174 $r = ItemFactory_createTextNode($this->_cPtr, $parent, $content);
1175 return is_resource($r) ? new Item($r) : $r;
1176
1177 }
1178
1179 public function createTime($aHour_or_aValue, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) {
1180 switch(func_num_args()) {
1181 case 1: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue);break;
1182 case 2: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute);break;
1183 case 3: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond);break;
1184 case 4: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);break;
1185 default: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);
1186 }
1187 return is_resource($r) ? new Item($r) : $r;
1188
1189 }
1190
1191 public function createUnsignedByte($aValue) {
1192 $r = ItemFactory_createUnsignedByte($this->_cPtr, $aValue);
1193 return is_resource($r) ? new Item($r) : $r;
1194
1195 }
1196
1197 public function createUnsignedInt($aValue) {
1198 $r = ItemFactory_createUnsignedInt($this->_cPtr, $aValue);
1199 return is_resource($r) ? new Item($r) : $r;
1200
1201 }
1202
1203 public function createUnsignedLong($aValue) {
1204 $r = ItemFactory_createUnsignedLong($this->_cPtr, $aValue);
1205 return is_resource($r) ? new Item($r) : $r;
1206
1207 }
1208
1209 public function createUnsignedShort($aValue) {
1210 $r = ItemFactory_createUnsignedShort($this->_cPtr, $aValue);
1211 return is_resource($r) ? new Item($r) : $r;
1212
1213 }
1214
1215}
12160
=== modified file 'swig/python/tests/CMakeLists.txt'
--- swig/python/tests/CMakeLists.txt 2013-02-07 17:24:36 +0000
+++ swig/python/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000
@@ -14,65 +14,66 @@
14 14
15SET(pythonPath ${CMAKE_BINARY_DIR}/swig/python)15SET(pythonPath ${CMAKE_BINARY_DIR}/swig/python)
1616
17CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml.in ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)17CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)
18CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq.in ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY)18CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY)
1919
20CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.py.in ${CMAKE_CURRENT_BINARY_DIR}/test01.py)20CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.py ${CMAKE_CURRENT_BINARY_DIR}/test01.py)
21ADD_TEST("python_test01" ${PYTHON_EXECUTABLE} test01.py)21ADD_TEST("python_test01" ${PYTHON_EXECUTABLE} test01.py)
22SET_TESTS_PROPERTIES("python_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success")22SET_TESTS_PROPERTIES("python_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2323
24CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.py.in ${CMAKE_CURRENT_BINARY_DIR}/test02.py)24CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.py ${CMAKE_CURRENT_BINARY_DIR}/test02.py)
25ADD_TEST("python_test02" ${PYTHON_EXECUTABLE} test02.py)25ADD_TEST("python_test02" ${PYTHON_EXECUTABLE} test02.py)
26SET_TESTS_PROPERTIES("python_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success")26SET_TESTS_PROPERTIES("python_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2727
28CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.py.in ${CMAKE_CURRENT_BINARY_DIR}/test03.py)28CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.py ${CMAKE_CURRENT_BINARY_DIR}/test03.py)
29ADD_TEST("python_test03" ${PYTHON_EXECUTABLE} test03.py)29ADD_TEST("python_test03" ${PYTHON_EXECUTABLE} test03.py)
30SET_TESTS_PROPERTIES("python_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success")30SET_TESTS_PROPERTIES("python_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
3131
32CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.py.in ${CMAKE_CURRENT_BINARY_DIR}/test04.py)32CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.py ${CMAKE_CURRENT_BINARY_DIR}/test04.py)
33ADD_TEST("python_test04" ${PYTHON_EXECUTABLE} test04.py)33ADD_TEST("python_test04" ${PYTHON_EXECUTABLE} test04.py)
34CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY)34CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY)
35SET_TESTS_PROPERTIES("python_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success")35SET_TESTS_PROPERTIES("python_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
3636
37CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.py.in ${CMAKE_CURRENT_BINARY_DIR}/test05.py)37CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.py ${CMAKE_CURRENT_BINARY_DIR}/test05.py)
38ADD_TEST("python_test05" ${PYTHON_EXECUTABLE} test05.py)38ADD_TEST("python_test05" ${PYTHON_EXECUTABLE} test05.py)
39CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY)39CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY)
40SET_TESTS_PROPERTIES("python_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success")40SET_TESTS_PROPERTIES("python_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4141
42CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.py.in ${CMAKE_CURRENT_BINARY_DIR}/test06.py)42CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.py ${CMAKE_CURRENT_BINARY_DIR}/test06.py)
43ADD_TEST("python_test06" ${PYTHON_EXECUTABLE} test06.py)43ADD_TEST("python_test06" ${PYTHON_EXECUTABLE} test06.py)
44CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY)44CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY)
45SET_TESTS_PROPERTIES("python_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success")45SET_TESTS_PROPERTIES("python_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4646
47CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.1.py.in ${CMAKE_CURRENT_BINARY_DIR}/test07.1.py)47CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.1.py ${CMAKE_CURRENT_BINARY_DIR}/test07.1.py)
48ADD_TEST("python_test07.1" ${PYTHON_EXECUTABLE} test07.1.py)48ADD_TEST("python_test07.1" ${PYTHON_EXECUTABLE} test07.1.py)
49CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.2.py.in ${CMAKE_CURRENT_BINARY_DIR}/test07.2.py)49CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.2.py ${CMAKE_CURRENT_BINARY_DIR}/test07.2.py)
50ADD_TEST("python_test07.2" ${PYTHON_EXECUTABLE} test07.2.py)50ADD_TEST("python_test07.2" ${PYTHON_EXECUTABLE} test07.2.py)
51SET_TESTS_PROPERTIES("python_test07.1" PROPERTIES PASS_REGULAR_EXPRESSION "Success")51SET_TESTS_PROPERTIES("python_test07.1" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
52SET_TESTS_PROPERTIES("python_test07.2" PROPERTIES PASS_REGULAR_EXPRESSION "Success")52SET_TESTS_PROPERTIES("python_test07.2" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
5353
54CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.py.in ${CMAKE_CURRENT_BINARY_DIR}/test08.py)54CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.py ${CMAKE_CURRENT_BINARY_DIR}/test08.py)
55ADD_TEST("python_test08" ${PYTHON_EXECUTABLE} test08.py)55ADD_TEST("python_test08" ${PYTHON_EXECUTABLE} test08.py)
56SET_TESTS_PROPERTIES("python_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success")56SET_TESTS_PROPERTIES("python_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
5757
5858
59CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.py.in ${CMAKE_CURRENT_BINARY_DIR}/test10.py)59CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.py ${CMAKE_CURRENT_BINARY_DIR}/test10.py)
60ADD_TEST("python_test10" ${PYTHON_EXECUTABLE} test10.py)60ADD_TEST("python_test10" ${PYTHON_EXECUTABLE} test10.py)
61SET_TESTS_PROPERTIES("python_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success")61SET_TESTS_PROPERTIES("python_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
6262
63CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.py.in ${CMAKE_CURRENT_BINARY_DIR}/test11.py)63CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.py ${CMAKE_CURRENT_BINARY_DIR}/test11.py)
64ADD_TEST("python_test11" ${PYTHON_EXECUTABLE} test11.py)64ADD_TEST("python_test11" ${PYTHON_EXECUTABLE} test11.py)
65SET_TESTS_PROPERTIES("python_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success")65SET_TESTS_PROPERTIES("python_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
6666
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)
68#ADD_TEST("python_test12" ${PYTHON_EXECUTABLE} test12.py)68# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.py ${CMAKE_CURRENT_BINARY_DIR}/test12.py)
69#SET_TESTS_PROPERTIES("python_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success")69# ADD_TEST("python_test12" ${PYTHON_EXECUTABLE} test12.py)
7070# SET_TESTS_PROPERTIES("python_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
71#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.py.in ${CMAKE_CURRENT_BINARY_DIR}/test13.py)71
72#ADD_TEST("python_test13" ${PYTHON_EXECUTABLE} test13.py)72# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.py ${CMAKE_CURRENT_BINARY_DIR}/test13.py)
73#SET_TESTS_PROPERTIES("python_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success")73# ADD_TEST("python_test13" ${PYTHON_EXECUTABLE} test13.py)
7474# SET_TESTS_PROPERTIES("python_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
75#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.py.in ${CMAKE_CURRENT_BINARY_DIR}/test14.py)75
76#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.py ${CMAKE_CURRENT_BINARY_DIR}/test14.py)
76#ADD_TEST("python_test14" ${PYTHON_EXECUTABLE} test14.py)77#ADD_TEST("python_test14" ${PYTHON_EXECUTABLE} test14.py)
77#SET_TESTS_PROPERTIES("python_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success")78#SET_TESTS_PROPERTIES("python_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
7879
7980
=== added file 'swig/python/tests/books.xml'
--- swig/python/tests/books.xml 1970-01-01 00:00:00 +0000
+++ swig/python/tests/books.xml 2013-03-27 00:40:33 +0000
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2<books>
3 <book>
4 <title>Book 1</title>
5 <author>Author 1</author>
6 </book>
7 <book featured="YES">
8 <title>Book 2</title>
9 <author>Author 2</author>
10 </book>
11</books>
012
=== removed file 'swig/python/tests/books.xml.in'
--- swig/python/tests/books.xml.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/books.xml.in 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2<books>
3 <book>
4 <title>Book 1</title>
5 <author>Author 1</author>
6 </book>
7 <book featured="YES">
8 <title>Book 2</title>
9 <author>Author 2</author>
10 </book>
11</books>
120
=== added file 'swig/python/tests/compilerHints.xq'
--- swig/python/tests/compilerHints.xq 1970-01-01 00:00:00 +0000
+++ swig/python/tests/compilerHints.xq 2013-03-27 00:40:33 +0000
@@ -0,0 +1,4 @@
1for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
2 start at $s when fn:true()
3 only end at $e when $e - $s eq 2
4return avg($w)
05
=== removed file 'swig/python/tests/compilerHints.xq.in'
--- swig/python/tests/compilerHints.xq.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/compilerHints.xq.in 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
2 start at $s when fn:true()
3 only end at $e when $e - $s eq 2
4return avg($w)
50
=== added file 'swig/python/tests/satellites.json'
--- swig/python/tests/satellites.json 1970-01-01 00:00:00 +0000
+++ swig/python/tests/satellites.json 2013-03-27 00:40:33 +0000
@@ -0,0 +1,17 @@
1{
2 "creator" : "Satellites plugin version 0.6.4",
3 "satellites" : {
4 "AAU CUBESAT" : {
5 "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768",
6 "visible" : false
7 },
8 "AJISAI (EGS)" : {
9 "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696",
10 "visible" : true
11 },
12 "AKARI (ASTRO-F)" : {
13 "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294",
14 "visible" : true
15 }
16 }
17}
018
=== added file 'swig/python/tests/test01.py'
--- swig/python/tests/test01.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test01.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,26 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19print "Running: Get zorba instance and shutdown"
20
21store = zorba_api.InMemoryStore_getInstance()
22zorba = zorba_api.Zorba_getInstance(store)
23zorba.shutdown()
24zorba_api.InMemoryStore_shutdown(store)
25
26print "Success"
027
=== removed file 'swig/python/tests/test01.py.in'
--- swig/python/tests/test01.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test01.py.in 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19print "Running: Get zorba instance and shutdown"
20
21store = zorba_api.InMemoryStore_getInstance()
22zorba = zorba_api.Zorba_getInstance(store)
23zorba.shutdown()
24zorba_api.InMemoryStore_shutdown(store)
25
26print "Success"
270
=== added file 'swig/python/tests/test02.py'
--- swig/python/tests/test02.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test02.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,41 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 xquery = zorba.compileQuery("(1,2,3,4,5)")
22 iter = xquery.iterator()
23 iter.open()
24 item = zorba_api.Item_createEmptyItem()
25 while iter.next(item):
26 print item.getStringValue()
27 iter.close()
28 iter.destroy()
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: Compile query string"
36test(zorba)
37print "Success"
38
39zorba.shutdown()
40zorba_api.InMemoryStore_shutdown(store)
41
042
=== removed file 'swig/python/tests/test02.py.in'
--- swig/python/tests/test02.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test02.py.in 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 xquery = zorba.compileQuery("(1,2,3,4,5)")
22 iter = xquery.iterator()
23 iter.open()
24 item = zorba_api.Item_createEmptyItem()
25 while iter.next(item):
26 print item.getStringValue()
27 iter.close()
28 iter.destroy()
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: Compile query string"
36test(zorba)
37print "Success"
38
39zorba.shutdown()
40zorba_api.InMemoryStore_shutdown(store)
41
420
=== added file 'swig/python/tests/test03.py'
--- swig/python/tests/test03.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test03.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,43 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
20 def error(self, *args):
21 print "Error args: ", args
22
23def test(zorba):
24 diagnosticHandler = MyDiagnosticHandler()
25 try:
26 print "Compiling 1 div 0"
27 xquery = zorba.compileQuery("1 div 0", diagnosticHandler)
28 print xquery.execute()
29 except Exception, e:
30 print "Caught error: ", e
31 return
32
33
34store = zorba_api.InMemoryStore_getInstance()
35zorba = zorba_api.Zorba_getInstance(store)
36
37print "Running: Compile query string using Diagnostic Handler"
38test(zorba)
39print "Success"
40
41
42zorba.shutdown()
43zorba_api.InMemoryStore_shutdown(store)
044
=== removed file 'swig/python/tests/test03.py.in'
--- swig/python/tests/test03.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test03.py.in 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
20 def error(self, *args):
21 print "Error args: ", args
22
23def test(zorba):
24 diagnosticHandler = MyDiagnosticHandler()
25 try:
26 print "Compiling 1 div 0"
27 xquery = zorba.compileQuery("1 div 0", diagnosticHandler)
28 print xquery.execute()
29 except Exception, e:
30 print "Cought error: ", e
31 return
32
33
34store = zorba_api.InMemoryStore_getInstance()
35zorba = zorba_api.Zorba_getInstance(store)
36
37print "Running: Compile query string using Diagnostic Handler"
38test(zorba)
39print "Success"
40
41
42zorba.shutdown()
43zorba_api.InMemoryStore_shutdown(store)
440
=== added file 'swig/python/tests/test04.py'
--- swig/python/tests/test04.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test04.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,42 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 #Read and write result
22 print 'Executing: test04.xq'
23 f = open('test04.xq', 'r')
24 lines = f.read()
25 f.close()
26 xquery = zorba.compileQuery(lines)
27 result = xquery.execute()
28 print result
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: XQuery execute"
36test(zorba)
37print "Success"
38
39
40zorba.shutdown()
41zorba_api.InMemoryStore_shutdown(store)
42
043
=== removed file 'swig/python/tests/test04.py.in'
--- swig/python/tests/test04.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test04.py.in 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 #Read and write result
22 print 'Executing: test04.xq'
23 f = open('test04.xq', 'r')
24 lines = f.read()
25 f.close()
26 xquery = zorba.compileQuery(lines)
27 result = xquery.execute()
28 print result
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: XQuery execute"
36test(zorba)
37print "Success"
38
39
40zorba.shutdown()
41zorba_api.InMemoryStore_shutdown(store)
42
430
=== added file 'swig/python/tests/test04.xq'
--- swig/python/tests/test04.xq 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test04.xq 2013-03-27 00:40:33 +0000
@@ -0,0 +1,4 @@
1for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
2 start at $s when fn:true()
3 only end at $e when $e - $s eq 2
4return avg($w)
05
=== removed file 'swig/python/tests/test04.xq.in'
--- swig/python/tests/test04.xq.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test04.xq.in 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
2 start at $s when fn:true()
3 only end at $e when $e - $s eq 2
4return avg($w)
50
=== added file 'swig/python/tests/test05.py'
--- swig/python/tests/test05.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test05.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,42 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 #Read and write result
22 print 'Executing: test05.xq'
23 f = open('test05.xq', 'r')
24 lines = f.read()
25 f.close()
26 xquery = zorba.compileQuery(lines)
27 result = xquery.printPlanAsXML()
28 print result
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: XQuery execute - printPlanAsXML"
36test(zorba)
37print "Success"
38
39
40zorba.shutdown()
41zorba_api.InMemoryStore_shutdown(store)
42
043
=== removed file 'swig/python/tests/test05.py.in'
--- swig/python/tests/test05.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test05.py.in 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 #Read and write result
22 print 'Executing: test05.xq'
23 f = open('test05.xq', 'r')
24 lines = f.read()
25 f.close()
26 xquery = zorba.compileQuery(lines)
27 result = xquery.printPlanAsXML()
28 print result
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: XQuery execute - printPlanAsXML"
36test(zorba)
37print "Success"
38
39
40zorba.shutdown()
41zorba_api.InMemoryStore_shutdown(store)
42
430
=== added file 'swig/python/tests/test05.xq'
--- swig/python/tests/test05.xq 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test05.xq 2013-03-27 00:40:33 +0000
@@ -0,0 +1,7 @@
1for $x in (5,6,7,1,2,3,4)
2where $x < 4
3for $y in (4,9,6,8,2)
4let $z := $x * $y
5where $z > 20
6return
7<value x="{$x}" y="{$y}">{$z}</value>
0\ No newline at end of file8\ No newline at end of file
19
=== removed file 'swig/python/tests/test05.xq.in'
--- swig/python/tests/test05.xq.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test05.xq.in 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1for $x in (5,6,7,1,2,3,4)
2where $x < 4
3for $y in (4,9,6,8,2)
4let $z := $x * $y
5where $z > 20
6return
7<value x="{$x}" y="{$y}">{$z}</value>
8\ No newline at end of file0\ No newline at end of file
91
=== added file 'swig/python/tests/test06.py'
--- swig/python/tests/test06.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test06.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,42 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 #Read and write result
22 print 'Executing: test06.xq'
23 f = open('test06.xq', 'r')
24 lines = f.read()
25 f.close()
26 xquery = zorba.compileQuery(lines)
27 result = xquery.printPlanAsDOT()
28 print result
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: XQuery execute - printPlanAsXML"
36test(zorba)
37print "Success"
38
39
40zorba.shutdown()
41zorba_api.InMemoryStore_shutdown(store)
42
043
=== removed file 'swig/python/tests/test06.py.in'
--- swig/python/tests/test06.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test06.py.in 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 #Read and write result
22 print 'Executing: test06.xq'
23 f = open('test06.xq', 'r')
24 lines = f.read()
25 f.close()
26 xquery = zorba.compileQuery(lines)
27 result = xquery.printPlanAsDOT()
28 print result
29 return
30
31
32store = zorba_api.InMemoryStore_getInstance()
33zorba = zorba_api.Zorba_getInstance(store)
34
35print "Running: XQuery execute - printPlanAsXML"
36test(zorba)
37print "Success"
38
39
40zorba.shutdown()
41zorba_api.InMemoryStore_shutdown(store)
42
430
=== added file 'swig/python/tests/test06.xq'
--- swig/python/tests/test06.xq 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test06.xq 2013-03-27 00:40:33 +0000
@@ -0,0 +1,7 @@
1for $x in (5,6,7,1,2,3,4)
2where $x < 4
3for $y in (4,9,6,8,2)
4let $z := $x * $y
5where $z > 20
6return
7<value x="{$x}" y="{$y}">{$z}</value>
0\ No newline at end of file8\ No newline at end of file
19
=== removed file 'swig/python/tests/test06.xq.in'
--- swig/python/tests/test06.xq.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test06.xq.in 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1for $x in (5,6,7,1,2,3,4)
2where $x < 4
3for $y in (4,9,6,8,2)
4let $z := $x * $y
5where $z > 20
6return
7<value x="{$x}" y="{$y}">{$z}</value>
8\ No newline at end of file0\ No newline at end of file
91
=== added file 'swig/python/tests/test07.1.py'
--- swig/python/tests/test07.1.py 1970-01-01 00:00:00 +0000
+++ swig/python/tests/test07.1.py 2013-03-27 00:40:33 +0000
@@ -0,0 +1,54 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import sys
16sys.path.insert(0, '@pythonPath@')
17import zorba_api
18
19
20def test(zorba):
21 f = open('books.xml', 'r')
22 lines = f.read()
23 f.close()
24
25 dataManager = zorba.getXmlDataManager()
26 docIter = dataManager.parseXML(lines)
27 docIter.open();
28
29 doc = zorba_api.Item_createEmptyItem()
30 docIter.next(doc)
31
32 docIter.close()
33 docIter.destroy()
34
35 docManager = dataManager.getDocumentManager()
36 docManager.put("my_fake_books.xml", doc)
37 xquery = zorba.compileQuery("doc('my_fake_books.xml')")
38
39 result = xquery.execute()
40 print result
41
42 return
43
44store = zorba_api.InMemoryStore_getInstance()
45zorba = zorba_api.Zorba_getInstance(store)
46
47print "Running: XQuery execute - parsing XML"
48test(zorba)
49print "Success"
50
51
52zorba.shutdown()
53zorba_api.InMemoryStore_shutdown(store)
54
055
=== removed file 'swig/python/tests/test07.1.py.in'
--- swig/python/tests/test07.1.py.in 2013-02-07 17:24:36 +0000
+++ swig/python/tests/test07.1.py.in 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1# Copyright 2006-2011 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches