Merge lp:~zorba-coders/zorba/bug-1158052 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Merged at revision: 11545
Proposed branch: lp:~zorba-coders/zorba/bug-1158052
Merge into: lp:zorba
Diff against target: 1611 lines (+342/-569)
16 files modified
ChangeLog (+2/-1)
include/zorba/item_factory.h (+7/-14)
modules/ExternalModules.conf (+2/-2)
modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp (+1/-1)
src/api/itemfactoryimpl.cpp (+91/-109)
src/api/itemfactoryimpl.h (+1/-4)
src/store/naive/atomic_items.cpp (+3/-3)
src/store/naive/simple_item_factory.cpp (+2/-2)
src/types/casting.cpp (+3/-11)
src/zorbaserialization/serialize_zorba_types.cpp (+6/-26)
src/zorbatypes/binary.cpp (+88/-260)
src/zorbatypes/binary.h (+126/-116)
swig/ItemFactory.h (+4/-11)
swig/ItemFactory.i (+2/-5)
swig/xqj/ZorbaXQConnection.java (+2/-2)
test/api/itemfactory.cpp (+2/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1158052
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Paul J. Lucas Approve
Review via email: mp+170725@code.launchpad.net

Commit message

Cleaned up both public and internal API.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
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/bug-1158052 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:281 (message):
  Validation queue job bug-1158052-2013-06-21T01-46-49.193Z 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 :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

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/bug-1158052 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:281 (message):
  Validation queue job bug-1158052-2013-06-21T03-54-45.43Z 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/bug-1158052 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:281 (message):
  Validation queue job bug-1158052-2013-06-21T04-31-56.775Z 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/bug-1158052 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:281 (message):
  Validation queue job bug-1158052-2013-06-21T14-07-53.658Z is finished. The
  final status was:

  5 tests did not succeed - changes not commited.

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 :

Validation queue job bug-1158052-2013-06-21T20-56-53.491Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve.

lp:~zorba-coders/zorba/bug-1158052 updated
11538. By Paul J. Lucas

Merge from trunk.

11539. By Paul J. Lucas

Merge from trunk.

11540. By Paul J. Lucas

Merge from trunk.

11541. By Chris Hillery

Revert to non-core modules from trunks.

Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2013-06-28 02:33:07 +0000
+++ ChangeLog 2013-06-28 04:21:28 +0000
@@ -32,10 +32,11 @@
32 * Fixed bug #1189798 (Update core module "errors")32 * Fixed bug #1189798 (Update core module "errors")
33 * Fixed bug #1187537 (Eliminate (or at least reduce) use of MAX_PATH)33 * Fixed bug #1187537 (Eliminate (or at least reduce) use of MAX_PATH)
34 * Fixed bug #1180220 (Consolidate redundant path/file public APIs)34 * Fixed bug #1180220 (Consolidate redundant path/file public APIs)
35 * Fixed bug #1158052 (createBase64Binary() API too subtle)
35 * Fixed bug #1103115 (Timezone units as hours are wrong)36 * Fixed bug #1103115 (Timezone units as hours are wrong)
36 * Fixed bug #1188280 (casting xs:id to xs:ncname)37 * Fixed bug #1188280 (casting xs:id to xs:ncname)
37 * Fixed bug in casting to xs:NCName38 * Fixed bug in casting to xs:NCName
38 * Check that namespace uri used in default namespace declaration is a valid one39 * Check that the namespace URI used in default namespace declaration is valid
39 * Fixed bug in error conditions for computed PI constructor40 * Fixed bug in error conditions for computed PI constructor
40 * Fixed implementation of fn:deep-equal according to latest W3C spec.41 * Fixed implementation of fn:deep-equal according to latest W3C spec.
41 * Must apply document ordering on the domain expression of a FOR clause, if42 * Must apply document ordering on the domain expression of a FOR clause, if
4243
=== modified file 'include/zorba/item_factory.h'
--- include/zorba/item_factory.h 2013-06-18 23:53:59 +0000
+++ include/zorba/item_factory.h 2013-06-28 04:21:28 +0000
@@ -141,32 +141,25 @@
141 /** \brief Creates a Base64Binary Item141 /** \brief Creates a Base64Binary Item
142 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]142 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
143 *143 *
144 * @param aBinData a pointer to the base64 encoded data. The data is copied from aBinData.144 * @param aData a pointer to the data.
145 * @param aLength the length of the base64 encoded data.145 * @param aLength the length of the data (in bytes).
146 * @param aIsBase64 If \c true, \a aData is already Base-64 encoded; if
147 * \c false, \a aData is binary data that will first be Base-64 encoded.
146 * @return The Base64Binary Item.148 * @return The Base64Binary Item.
147 */149 */
148 virtual Item150 virtual Item
149 createBase64Binary(const char* aBinData, size_t aLength) = 0;151 createBase64Binary(const char* aData, size_t aLength, bool aIsBase64) = 0;
150152
151 /** \brief Creates a Base64Binary Item153 /** \brief Creates a Base64Binary Item
152 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]154 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
153 *155 *
154 * @param aStream A stream containing the Base64 encoded data. The data is copied from aStream imediately.156 * @param aStream A stream containing the Base64 encoded data.
157 * The data is copied from aStream immediately.
155 * @return the Base64Binary Item.158 * @return the Base64Binary Item.
156 */159 */
157 virtual Item160 virtual Item
158 createBase64Binary(std::istream& aStream) = 0;161 createBase64Binary(std::istream& aStream) = 0;
159162
160 /** \brief Creates a Base64Binary Item
161 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
162 *
163 * @param aBinData the data in binary form (not encoded). The data is copied from aBinData.
164 * @param aLength the length of the binary data
165 * @return the Base64Binary Item.
166 */
167 virtual Item
168 createBase64Binary(const unsigned char* aBinData, size_t aLength) = 0;
169
170 /** \brief Creates a streamable Base64Binary Item163 /** \brief Creates a streamable Base64Binary Item
171 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]164 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
172 *165 *
173166
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf 2013-06-28 00:31:51 +0000
+++ modules/ExternalModules.conf 2013-06-28 04:21:28 +0000
@@ -32,14 +32,14 @@
32data-formatting bzr lp:zorba/data-formatting-module32data-formatting bzr lp:zorba/data-formatting-module
33excel bzr lp:zorba/excel-module zorba-2.933excel bzr lp:zorba/excel-module zorba-2.9
34info-extraction bzr lp:zorba/info-extraction-module zorba-2.934info-extraction bzr lp:zorba/info-extraction-module zorba-2.9
35geo bzr lp:zorba/geo-module zorba-2.935geo bzr lp:zorba/geo-module
36geoproj bzr lp:zorba/geoproj-module zorba-2.936geoproj bzr lp:zorba/geoproj-module zorba-2.9
37graphviz bzr lp:zorba/graphviz-module zorba-2.937graphviz bzr lp:zorba/graphviz-module zorba-2.9
38html bzr lp:zorba/html-module zorba-2.938html bzr lp:zorba/html-module zorba-2.9
39http-client bzr lp:zorba/http-client-module zorba-2.939http-client bzr lp:zorba/http-client-module zorba-2.9
40image bzr lp:zorba/image-module40image bzr lp:zorba/image-module
41jdbc bzr lp:zorba/jdbc-module41jdbc bzr lp:zorba/jdbc-module
42languages bzr lp:zorba/languages-module zorba-2.942languages bzr lp:zorba/languages-module
43oracle-nosql-db bzr lp:zorba/oracle-nosql-db-module43oracle-nosql-db bzr lp:zorba/oracle-nosql-db-module
44oauth bzr lp:zorba/oauth-module zorba-2.944oauth bzr lp:zorba/oauth-module zorba-2.9
45process bzr lp:zorba/process-module45process bzr lp:zorba/process-module
4646
=== modified file 'modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp'
--- modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp 2013-06-25 03:55:20 +0000
+++ modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp 2013-06-28 04:21:28 +0000
@@ -329,7 +329,7 @@
329 // changed. This required a Base64 encoding stream since the item factory329 // changed. This required a Base64 encoding stream since the item factory
330 // work only builds base64binary and assumes the data is already encoded.330 // work only builds base64binary and assumes the data is already encoded.
331 String lEncoded = base64::encode(aStream);331 String lEncoded = base64::encode(aStream);
332 return lFactory->createBase64Binary(lEncoded.data(), lEncoded.size());332 return lFactory->createBase64Binary(lEncoded.data(), lEncoded.size(), true);
333 }333 }
334334
335 zorba::Item HttpResponseParser::createXmlItem( std::istream& aStream )335 zorba::Item HttpResponseParser::createXmlItem( std::istream& aStream )
336336
=== modified file 'src/api/itemfactoryimpl.cpp'
--- src/api/itemfactoryimpl.cpp 2013-06-18 23:53:59 +0000
+++ src/api/itemfactoryimpl.cpp 2013-06-28 04:21:28 +0000
@@ -1,12 +1,12 @@
1/*1/*
2 * Copyright 2006-2008 The FLWOR Foundation.2 * Copyright 2006-2008 The FLWOR Foundation.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.08 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,25 +45,25 @@
4545
4646
47namespace zorba {47namespace zorba {
48 48
49ItemFactoryImpl::ItemFactoryImpl()49ItemFactoryImpl::ItemFactoryImpl()
50{50{
51 theItemFactory = GENV_ITEMFACTORY;51 theItemFactory = GENV_ITEMFACTORY;
52}52}
5353
5454
55ItemFactoryImpl::~ItemFactoryImpl() 55ItemFactoryImpl::~ItemFactoryImpl()
56{56{
57}57}
5858
5959
60Item ItemFactoryImpl::createString(const String& aString)60Item ItemFactoryImpl::createString(const String& aString)
61{61{
62 zstring lString = Unmarshaller::getInternalString(aString); 62 zstring lString = Unmarshaller::getInternalString(aString);
63 store::Item_t lItem;63 store::Item_t lItem;
64 64
65 theItemFactory->createString(lItem, lString);65 theItemFactory->createString(lItem, lString);
66 66
67 return &*lItem;67 return &*lItem;
68}68}
6969
@@ -94,14 +94,14 @@
94Item ItemFactoryImpl::createAnyURI(const String& aURI)94Item ItemFactoryImpl::createAnyURI(const String& aURI)
95{95{
96 zstring lString = Unmarshaller::getInternalString(aURI);96 zstring lString = Unmarshaller::getInternalString(aURI);
97 97
98 store::Item_t lItem;98 store::Item_t lItem;
99 theItemFactory->createAnyURI(lItem, lString);99 theItemFactory->createAnyURI(lItem, lString);
100 100
101 return &*lItem;101 return &*lItem;
102}102}
103103
104 104
105Item ItemFactoryImpl::createDate( const String& aDateValue )105Item ItemFactoryImpl::createDate( const String& aDateValue )
106{106{
107 zstring const &lString = Unmarshaller::getInternalString( aDateValue );107 zstring const &lString = Unmarshaller::getInternalString( aDateValue );
@@ -133,19 +133,19 @@
133 zstring const &lNamespace = Unmarshaller::getInternalString( aNamespace );133 zstring const &lNamespace = Unmarshaller::getInternalString( aNamespace );
134 zstring const &lPrefix = Unmarshaller::getInternalString( aPrefix );134 zstring const &lPrefix = Unmarshaller::getInternalString( aPrefix );
135 zstring const &lLocalname = Unmarshaller::getInternalString( aLocalname );135 zstring const &lLocalname = Unmarshaller::getInternalString( aLocalname );
136 136
137 if (!GenericCast::instance()->castableToNCName(lLocalname.c_str()))137 if (!GenericCast::instance()->castableToNCName(lLocalname.c_str()))
138 {138 {
139 RAISE_ERROR_NO_LOC(err::FORG0001, 139 RAISE_ERROR_NO_LOC(err::FORG0001,
140 ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname));140 ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname));
141 }141 }
142142
143 if (lPrefix.size() && !GenericCast::instance()->castableToNCName(lPrefix.c_str()))143 if (lPrefix.size() && !GenericCast::instance()->castableToNCName(lPrefix.c_str()))
144 {144 {
145 RAISE_ERROR_NO_LOC(err::FORG0001, 145 RAISE_ERROR_NO_LOC(err::FORG0001,
146 ERROR_PARAMS(ZED(FORG0001_PrefixNotNCName_2), lPrefix));146 ERROR_PARAMS(ZED(FORG0001_PrefixNotNCName_2), lPrefix));
147 }147 }
148 148
149 store::Item_t lItem;149 store::Item_t lItem;
150 theItemFactory->createQName(lItem, lNamespace, lPrefix, lLocalname);150 theItemFactory->createQName(lItem, lNamespace, lPrefix, lLocalname);
151 return &*lItem;151 return &*lItem;
@@ -161,15 +161,15 @@
161161
162 if (!GenericCast::instance()->castableToNCName(lLocalname.c_str()))162 if (!GenericCast::instance()->castableToNCName(lLocalname.c_str()))
163 {163 {
164 RAISE_ERROR_NO_LOC(err::FORG0001, 164 RAISE_ERROR_NO_LOC(err::FORG0001,
165 ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname));165 ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname));
166 }166 }
167 167
168 store::Item_t lItem;168 store::Item_t lItem;
169 theItemFactory->createQName(lItem, lNamespace, zstring(), lLocalname);169 theItemFactory->createQName(lItem, lNamespace, zstring(), lLocalname);
170 return &*lItem;170 return &*lItem;
171}171}
172 172
173173
174Item174Item
175ItemFactoryImpl::createQName(const String& aQNameString)175ItemFactoryImpl::createQName(const String& aQNameString)
@@ -180,7 +180,7 @@
180 size_t lOpen = lQNameString.find("{");180 size_t lOpen = lQNameString.find("{");
181 size_t lClose = lQNameString.find("}");181 size_t lClose = lQNameString.find("}");
182182
183 if (lOpen == 0 && lClose != std::string::npos) 183 if (lOpen == 0 && lClose != std::string::npos)
184 {184 {
185 zstring const &lNamespace = lQNameString.substr(1, lClose - 1);185 zstring const &lNamespace = lQNameString.substr(1, lClose - 1);
186 zstring const &lLocalname = lQNameString.substr(lClose+1);186 zstring const &lLocalname = lQNameString.substr(lClose+1);
@@ -188,7 +188,7 @@
188188
189 if (!GenericCast::instance()->castableToNCName(lLocalname.c_str()))189 if (!GenericCast::instance()->castableToNCName(lLocalname.c_str()))
190 {190 {
191 RAISE_ERROR_NO_LOC(err::FORG0001, 191 RAISE_ERROR_NO_LOC(err::FORG0001,
192 ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname));192 ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname));
193 }193 }
194 }194 }
@@ -205,54 +205,36 @@
205 RAISE_ERROR_NO_LOC(err::FORG0001,205 RAISE_ERROR_NO_LOC(err::FORG0001,
206 ERROR_PARAMS(ZED(FORG0001_NameNotNCName_2), lString));206 ERROR_PARAMS(ZED(FORG0001_NameNotNCName_2), lString));
207 }207 }
208 208
209 store::Item_t lItem;209 store::Item_t lItem;
210 theItemFactory->createNCName(lItem, lString);210 theItemFactory->createNCName(lItem, lString);
211 return &*lItem;211 return &*lItem;
212}212}
213213
214 214
215Item ItemFactoryImpl::createBase64Binary(const char* aBinData, size_t aLength)215Item ItemFactoryImpl::createBase64Binary(const char* aData, size_t aLength,
216{216 bool aIsBase64)
217 store::Item_t lItem;217{
218 xs_base64Binary n;218 try {
219 std::string lMessage;219 store::Item_t result;
220 if (xs_base64Binary::parseString(aBinData, aLength, n, lMessage))220 xs_base64Binary b64( aData, aLength, aIsBase64 );
221 {221 theItemFactory->createBase64Binary( result, b64 );
222 theItemFactory->createBase64Binary(lItem, n);222 return &*result;
223 }223 }
224 else224 catch ( std::exception const &e ) {
225 {225 throw ZORBA_EXCEPTION(
226 throw ZORBA_EXCEPTION(zerr::ZSTR0040_TYPE_ERROR, ERROR_PARAMS(lMessage));226 zerr::ZSTR0040_TYPE_ERROR, ERROR_PARAMS( e.what() )
227 }227 );
228 return &*lItem;228 }
229}
230
231
232Item ItemFactoryImpl::createBase64Binary(const unsigned char* aBinData, size_t aLength)
233{
234 store::Item_t lItem;
235 xs_base64Binary n;
236 std::string lMessage;
237 xs_base64Binary::encode(aBinData, aLength, n);
238 theItemFactory->createBase64Binary(lItem, n);
239 return &*lItem;
240}229}
241230
242231
243Item ItemFactoryImpl::createBase64Binary(std::istream& aEncodedStream)232Item ItemFactoryImpl::createBase64Binary(std::istream& aEncodedStream)
244{233{
245 std::stringstream lSs;234 std::ostringstream oss;
246 while (aEncodedStream.good()) 235 oss << aEncodedStream.rdbuf();
247 {236 std::string const temp( oss.str() );
248 char c = aEncodedStream.get();237 return createBase64Binary( temp.data(), temp.size(), true );
249 if (aEncodedStream.good())
250 {
251 lSs.put(c);
252 }
253 }
254 std::string lContent = lSs.str();
255 return createBase64Binary(lContent.c_str(), lContent.size());
256}238}
257239
258240
@@ -265,8 +247,8 @@
265{247{
266 store::Item_t lItem;248 store::Item_t lItem;
267 theItemFactory->createStreamableBase64Binary(249 theItemFactory->createStreamableBase64Binary(
268 lItem, stream, streamReleaser, seekable, encoded250 lItem, stream, streamReleaser, seekable, encoded
269 );251 );
270 return &*lItem;252 return &*lItem;
271}253}
272254
@@ -281,8 +263,8 @@
281{263{
282 store::Item_t lItem;264 store::Item_t lItem;
283 theItemFactory->createStreamableBase64Binary(265 theItemFactory->createStreamableBase64Binary(
284 lItem, stream, streamReleaser, uri, seekable, encoded266 lItem, stream, streamReleaser, uri, seekable, encoded
285 );267 );
286 return &*lItem;268 return &*lItem;
287}269}
288270
@@ -293,8 +275,8 @@
293 theItemFactory->createBoolean(lItem, aValue);275 theItemFactory->createBoolean(lItem, aValue);
294 return &*lItem;276 return &*lItem;
295}277}
296 278
297 279
298Item ItemFactoryImpl::createDecimalFromLong (unsigned long aValue)280Item ItemFactoryImpl::createDecimalFromLong (unsigned long aValue)
299{281{
300 store::Item_t lItem;282 store::Item_t lItem;
@@ -302,8 +284,8 @@
302 theItemFactory->createDecimal(lItem, lDecimal);284 theItemFactory->createDecimal(lItem, lDecimal);
303 return &*lItem;285 return &*lItem;
304}286}
305 287
306 288
307Item ItemFactoryImpl::createDecimalFromDouble (double aValue)289Item ItemFactoryImpl::createDecimalFromDouble (double aValue)
308{290{
309 store::Item_t lItem;291 store::Item_t lItem;
@@ -357,7 +339,7 @@
357 }339 }
358 return &*lItem;340 return &*lItem;
359}341}
360 342
361343
362Item ItemFactoryImpl::createLong ( long long aLong )344Item ItemFactoryImpl::createLong ( long long aLong )
363{345{
@@ -366,7 +348,7 @@
366 theItemFactory->createLong(lItem, aLong);348 theItemFactory->createLong(lItem, aLong);
367 return &*lItem;349 return &*lItem;
368}350}
369 351
370352
371Item ItemFactoryImpl::createInt ( int aInt )353Item ItemFactoryImpl::createInt ( int aInt )
372{354{
@@ -378,7 +360,7 @@
378360
379 return &*lItem;361 return &*lItem;
380}362}
381 363
382364
383Item ItemFactoryImpl::createShort ( short aShort )365Item ItemFactoryImpl::createShort ( short aShort )
384{366{
@@ -388,8 +370,8 @@
388370
389 return &*lItem;371 return &*lItem;
390}372}
391 373
392 374
393Item ItemFactoryImpl::createByte ( char aValue )375Item ItemFactoryImpl::createByte ( char aValue )
394{376{
395 store::Item_t lItem;377 store::Item_t lItem;
@@ -398,8 +380,8 @@
398380
399 return &*lItem;381 return &*lItem;
400}382}
401 383
402 384
403Item ItemFactoryImpl::createDateTime(short aYear, short aMonth, short aDay,385Item ItemFactoryImpl::createDateTime(short aYear, short aMonth, short aDay,
404 short aHour, short aMinute, double aSecond,386 short aHour, short aMinute, double aSecond,
405 int aTimezone)387 int aTimezone)
@@ -468,7 +450,7 @@
468 return &*lItem;450 return &*lItem;
469}451}
470452
471 453
472Item ItemFactoryImpl::createDouble ( const String& aValue )454Item ItemFactoryImpl::createDouble ( const String& aValue )
473{455{
474 zstring lString = Unmarshaller::getInternalString( aValue );456 zstring lString = Unmarshaller::getInternalString( aValue );
@@ -498,17 +480,17 @@
498Item ItemFactoryImpl::createDuration(480Item ItemFactoryImpl::createDuration(
499 short aYears,481 short aYears,
500 short aMonths,482 short aMonths,
501 short aDays, 483 short aDays,
502 short aHours,484 short aHours,
503 short aMinutes,485 short aMinutes,
504 double aSeconds )486 double aSeconds )
505{487{
506 store::Item_t lItem;488 store::Item_t lItem;
507 489
508 theItemFactory->createDuration(lItem,490 theItemFactory->createDuration(lItem,
509 aYears, aMonths, aDays,491 aYears, aMonths, aDays,
510 aHours, aMinutes, aSeconds);492 aHours, aMinutes, aSeconds);
511 493
512 return &*lItem;494 return &*lItem;
513}495}
514496
@@ -551,7 +533,7 @@
551 try {533 try {
552 xs_float const lFloat(lString);534 xs_float const lFloat(lString);
553 theItemFactory->createFloat(lItem, lFloat);535 theItemFactory->createFloat(lItem, lFloat);
554 } 536 }
555 catch ( std::exception const& ) {537 catch ( std::exception const& ) {
556 // ignore538 // ignore
557 }539 }
@@ -567,7 +549,7 @@
567 return &*lItem;549 return &*lItem;
568}550}
569551
570 552
571Item ItemFactoryImpl::createHexBinary( const char* aHexData, size_t aSize,553Item ItemFactoryImpl::createHexBinary( const char* aHexData, size_t aSize,
572 bool aIsEncoded )554 bool aIsEncoded )
573{555{
@@ -586,7 +568,7 @@
586 }568 }
587 return &*lItem;569 return &*lItem;
588}570}
589 571
590572
591Item ItemFactoryImpl::createNonNegativeInteger ( unsigned long long aValue )573Item ItemFactoryImpl::createNonNegativeInteger ( unsigned long long aValue )
592{574{
@@ -623,41 +605,41 @@
623 store::Item_t lItem;605 store::Item_t lItem;
624606
625 theItemFactory->createGDay(lItem, lString.c_str(), lString.size());607 theItemFactory->createGDay(lItem, lString.c_str(), lString.size());
626 608
627 return &*lItem;609 return &*lItem;
628}610}
629 611
630612
631Item ItemFactoryImpl::createGDay ( short aDay )613Item ItemFactoryImpl::createGDay ( short aDay )
632{614{
633 store::Item_t lItem;615 store::Item_t lItem;
634616
635 theItemFactory->createGDay(lItem, aDay );617 theItemFactory->createGDay(lItem, aDay );
636 618
637 return &*lItem;619 return &*lItem;
638}620}
639 621
640 622
641Item ItemFactoryImpl::createGMonth ( short aMonth )623Item ItemFactoryImpl::createGMonth ( short aMonth )
642{624{
643 store::Item_t lItem;625 store::Item_t lItem;
644626
645 theItemFactory->createGMonth(lItem, aMonth );627 theItemFactory->createGMonth(lItem, aMonth );
646 628
647 return &*lItem;629 return &*lItem;
648}630}
649631
650 632
651Item ItemFactoryImpl::createGMonth ( const String& aValue )633Item ItemFactoryImpl::createGMonth ( const String& aValue )
652{634{
653 zstring lString = Unmarshaller::getInternalString(aValue);635 zstring lString = Unmarshaller::getInternalString(aValue);
654 store::Item_t lItem;636 store::Item_t lItem;
655 637
656 theItemFactory->createGMonth(lItem, lString.c_str(), lString.size());638 theItemFactory->createGMonth(lItem, lString.c_str(), lString.size());
657 639
658 return &*lItem;640 return &*lItem;
659}641}
660 642
661643
662Item ItemFactoryImpl::createGMonthDay(const String& aValue)644Item ItemFactoryImpl::createGMonthDay(const String& aValue)
663{645{
@@ -665,7 +647,7 @@
665 store::Item_t lItem;647 store::Item_t lItem;
666648
667 theItemFactory->createGMonthDay(lItem, lString.c_str(), lString.size());649 theItemFactory->createGMonthDay(lItem, lString.c_str(), lString.size());
668 650
669 return &*lItem;651 return &*lItem;
670}652}
671653
@@ -675,10 +657,10 @@
675 store::Item_t lItem;657 store::Item_t lItem;
676658
677 theItemFactory->createGMonthDay(lItem, aMonth, aDay );659 theItemFactory->createGMonthDay(lItem, aMonth, aDay );
678 660
679 return &*lItem;661 return &*lItem;
680}662}
681 663
682664
683Item ItemFactoryImpl::createGYear(const String& aValue)665Item ItemFactoryImpl::createGYear(const String& aValue)
684{666{
@@ -686,7 +668,7 @@
686 store::Item_t lItem;668 store::Item_t lItem;
687669
688 theItemFactory->createGYear(lItem, lString.c_str(), lString.size() );670 theItemFactory->createGYear(lItem, lString.c_str(), lString.size() );
689 671
690 return &*lItem;672 return &*lItem;
691}673}
692674
@@ -696,10 +678,10 @@
696 store::Item_t lItem;678 store::Item_t lItem;
697679
698 theItemFactory->createGYear(lItem, aYear );680 theItemFactory->createGYear(lItem, aYear );
699 681
700 return &*lItem;682 return &*lItem;
701}683}
702 684
703685
704Item ItemFactoryImpl::createGYearMonth ( const String& aValue )686Item ItemFactoryImpl::createGYearMonth ( const String& aValue )
705{687{
@@ -707,17 +689,17 @@
707 store::Item_t lItem;689 store::Item_t lItem;
708690
709 theItemFactory->createGYearMonth(lItem, lString.c_str(), lString.size());691 theItemFactory->createGYearMonth(lItem, lString.c_str(), lString.size());
710 692
711 return &*lItem;693 return &*lItem;
712}694}
713695
714 696
715Item ItemFactoryImpl::createGYearMonth ( short aYear, short aMonth )697Item ItemFactoryImpl::createGYearMonth ( short aYear, short aMonth )
716{698{
717 store::Item_t lItem;699 store::Item_t lItem;
718700
719 theItemFactory->createGYearMonth(lItem, aYear, aMonth );701 theItemFactory->createGYearMonth(lItem, aYear, aMonth );
720 702
721 return &*lItem;703 return &*lItem;
722}704}
723705
@@ -728,17 +710,17 @@
728 store::Item_t lItem;710 store::Item_t lItem;
729711
730 theItemFactory->createTime(lItem, lString.c_str(), lString.size() );712 theItemFactory->createTime(lItem, lString.c_str(), lString.size() );
731 713
732 return &*lItem;714 return &*lItem;
733}715}
734 716
735717
736Item ItemFactoryImpl::createTime ( short aHour, short aMinute, double aSecond )718Item ItemFactoryImpl::createTime ( short aHour, short aMinute, double aSecond )
737{719{
738 store::Item_t lItem;720 store::Item_t lItem;
739721
740 theItemFactory->createTime(lItem, aHour, aMinute, aSecond );722 theItemFactory->createTime(lItem, aHour, aMinute, aSecond );
741 723
742 return &*lItem;724 return &*lItem;
743}725}
744726
@@ -753,7 +735,7 @@
753 theItemFactory->createTime(lItem, aHour, aMinute, aSecond, aTimezone );735 theItemFactory->createTime(lItem, aHour, aMinute, aSecond, aTimezone );
754 return &*lItem;736 return &*lItem;
755}737}
756 738
757739
758Item ItemFactoryImpl::createUnsignedByte(const unsigned char aValue)740Item ItemFactoryImpl::createUnsignedByte(const unsigned char aValue)
759{741{
@@ -761,19 +743,19 @@
761 theItemFactory->createUnsignedByte(lItem, aValue);743 theItemFactory->createUnsignedByte(lItem, aValue);
762 return &*lItem;744 return &*lItem;
763}745}
764 746
765747
766Item ItemFactoryImpl::createUnsignedInt(unsigned int aValue)748Item ItemFactoryImpl::createUnsignedInt(unsigned int aValue)
767{749{
768 store::Item_t lItem;750 store::Item_t lItem;
769 751
770 if ( aValue <= UINT32_MAX ) {752 if ( aValue <= UINT32_MAX ) {
771 theItemFactory->createUnsignedInt(lItem, aValue);753 theItemFactory->createUnsignedInt(lItem, aValue);
772 }754 }
773755
774 return &*lItem;756 return &*lItem;
775}757}
776 758
777759
778Item ItemFactoryImpl::createUnsignedLong(unsigned long long aValue)760Item ItemFactoryImpl::createUnsignedLong(unsigned long long aValue)
779{761{
@@ -781,7 +763,7 @@
781 theItemFactory->createUnsignedLong(lItem, aValue);763 theItemFactory->createUnsignedLong(lItem, aValue);
782 return &*lItem;764 return &*lItem;
783}765}
784 766
785767
786Item ItemFactoryImpl::createUnsignedShort(unsigned short aValue)768Item ItemFactoryImpl::createUnsignedShort(unsigned short aValue)
787{769{
@@ -973,7 +955,7 @@
973955
974 std::vector<std::pair<Item, Item> >::iterator i = aPairs.begin();956 std::vector<std::pair<Item, Item> >::iterator i = aPairs.begin();
975 std::vector<std::pair<Item, Item> >::iterator end = aPairs.end();957 std::vector<std::pair<Item, Item> >::iterator end = aPairs.end();
976 for (; i != end; i++) 958 for (; i != end; i++)
977 {959 {
978 names.push_back(Unmarshaller::getInternalItem((*i).first));960 names.push_back(Unmarshaller::getInternalItem((*i).first));
979 values.push_back(Unmarshaller::getInternalItem((*i).second));961 values.push_back(Unmarshaller::getInternalItem((*i).second));
@@ -1001,7 +983,7 @@
1001 items.reserve(numItems);983 items.reserve(numItems);
1002 std::vector<Item>::iterator ite = aItems.begin();984 std::vector<Item>::iterator ite = aItems.begin();
1003 std::vector<Item>::iterator end = aItems.end();985 std::vector<Item>::iterator end = aItems.end();
1004 for (; ite != end; ++ite) 986 for (; ite != end; ++ite)
1005 {987 {
1006 items.push_back(Unmarshaller::getInternalItem(*ite));988 items.push_back(Unmarshaller::getInternalItem(*ite));
1007 }989 }
1008990
=== modified file 'src/api/itemfactoryimpl.h'
--- src/api/itemfactoryimpl.h 2013-06-18 23:53:59 +0000
+++ src/api/itemfactoryimpl.h 2013-06-28 04:21:28 +0000
@@ -67,14 +67,11 @@
67 createNCName(const String& aValue);67 createNCName(const String& aValue);
68 68
69 virtual Item 69 virtual Item
70 createBase64Binary(const char* aBinData, size_t aLength);70 createBase64Binary(const char* aBinData, size_t aLength, bool aIsBase64);
7171
72 virtual Item72 virtual Item
73 createBase64Binary(std::istream& aStream);73 createBase64Binary(std::istream& aStream);
74 74
75 virtual Item
76 createBase64Binary(const unsigned char* aBinData, size_t aLength);
77
78 virtual Item75 virtual Item
79 createStreamableBase64Binary(76 createStreamableBase64Binary(
80 std::istream &stream,77 std::istream &stream,
8178
=== modified file 'src/store/naive/atomic_items.cpp'
--- src/store/naive/atomic_items.cpp 2013-06-18 23:53:59 +0000
+++ src/store/naive/atomic_items.cpp 2013-06-28 04:21:28 +0000
@@ -45,6 +45,7 @@
45#include "tree_id.h"45#include "tree_id.h"
4646
47#include "util/ascii_util.h"47#include "util/ascii_util.h"
48#include "util/base64_util.h"
48#include "util/mem_sizeof.h"49#include "util/mem_sizeof.h"
49#include "util/string_util.h"50#include "util/string_util.h"
50#include "util/utf8_util.h"51#include "util/utf8_util.h"
@@ -3516,8 +3517,7 @@
3516 else3517 else
3517 {3518 {
3518 std::vector<char> encoded;3519 std::vector<char> encoded;
3519 encoded.reserve(theValue.size());3520 base64::encode( &theValue[0], theValue.size(), &encoded );
3520 Base64::encode(theValue, encoded);
3521 buf.insert(buf.size(), &encoded[0], encoded.size());3521 buf.insert(buf.size(), &encoded[0], encoded.size());
3522 }3522 }
3523}3523}
@@ -3778,7 +3778,7 @@
3778 buf.insert(buf.size(), &theValue[0], theValue.size());3778 buf.insert(buf.size(), &theValue[0], theValue.size());
3779 else3779 else
3780 {3780 {
3781 std::vector<char> encoded;3781 Base16::value_type encoded;
3782 Base16::encode(theValue, encoded);3782 Base16::encode(theValue, encoded);
3783 buf.insert(buf.size(), &encoded[0], encoded.size());3783 buf.insert(buf.size(), &encoded[0], encoded.size());
3784 }3784 }
37853785
=== modified file 'src/store/naive/simple_item_factory.cpp'
--- src/store/naive/simple_item_factory.cpp 2013-06-18 23:53:59 +0000
+++ src/store/naive/simple_item_factory.cpp 2013-06-28 04:21:28 +0000
@@ -1128,7 +1128,7 @@
1128 store::Item_t& result,1128 store::Item_t& result,
1129 xs_base64Binary const &value)1129 xs_base64Binary const &value)
1130{1130{
1131 const std::vector<char>& data = value.getData();1131 const std::vector<char>& data = value.data();
1132 result = new Base64BinaryItem(store::XS_BASE64BINARY,1132 result = new Base64BinaryItem(store::XS_BASE64BINARY,
1133 data.size() != 0 ? &data[0] : 0,1133 data.size() != 0 ? &data[0] : 0,
1134 data.size(),1134 data.size(),
@@ -1184,7 +1184,7 @@
1184bool BasicItemFactory::createHexBinary(store::Item_t& result,1184bool BasicItemFactory::createHexBinary(store::Item_t& result,
1185 xs_hexBinary const &value)1185 xs_hexBinary const &value)
1186{1186{
1187 std::vector<char> const &data = value.getData();1187 std::vector<char> const &data = value.data();
1188 result = new HexBinaryItem(1188 result = new HexBinaryItem(
1189 store::XS_HEXBINARY, data.empty() ? 0 : &data[0], data.size(), true1189 store::XS_HEXBINARY, data.empty() ? 0 : &data[0], data.size(), true
1190 );1190 );
11911191
=== modified file 'src/types/casting.cpp'
--- src/types/casting.cpp 2013-06-19 22:18:54 +0000
+++ src/types/casting.cpp 2013-06-28 04:21:28 +0000
@@ -1539,12 +1539,8 @@
1539T1_TO_T2(b64, hxB)1539T1_TO_T2(b64, hxB)
1540{1540{
1541 size_t s;1541 size_t s;
1542 const char* c = aItem->getBase64BinaryValue(s);1542 char const *const c = aItem->getBase64BinaryValue(s);
1543 xs_base64Binary tmp;1543 xs_base64Binary tmp( c, s, aItem->isEncoded() );
1544 if (aItem->isEncoded())
1545 xs_base64Binary::parseString(c, s, tmp);
1546 else
1547 xs_base64Binary::encode(c, s, tmp);
1548 aFactory->createHexBinary(result, xs_hexBinary(tmp));1544 aFactory->createHexBinary(result, xs_hexBinary(tmp));
1549}1545}
15501546
@@ -1567,11 +1563,7 @@
1567{1563{
1568 size_t s;1564 size_t s;
1569 char const *const c = aItem->getHexBinaryValue(s);1565 char const *const c = aItem->getHexBinaryValue(s);
1570 xs_hexBinary tmp;1566 xs_hexBinary tmp( c, s, aItem->isEncoded() );
1571 if (aItem->isEncoded())
1572 xs_hexBinary::parseString(c, s, tmp);
1573 else
1574 xs_hexBinary::encode(c, s, tmp);
1575 aFactory->createBase64Binary(result, xs_base64Binary(tmp));1567 aFactory->createBase64Binary(result, xs_base64Binary(tmp));
1576}1568}
15771569
15781570
=== modified file 'src/zorbaserialization/serialize_zorba_types.cpp'
--- src/zorbaserialization/serialize_zorba_types.cpp 2013-06-15 02:57:08 +0000
+++ src/zorbaserialization/serialize_zorba_types.cpp 2013-06-28 04:21:28 +0000
@@ -160,7 +160,7 @@
160********************************************************************************/160********************************************************************************/
161void operator&(Archiver& ar, Base64& obj)161void operator&(Archiver& ar, Base64& obj)
162{162{
163 ar & obj.theData;163 ar & obj.data_;
164}164}
165165
166166
@@ -169,7 +169,7 @@
169********************************************************************************/169********************************************************************************/
170void operator&(Archiver& ar, Base16& obj)170void operator&(Archiver& ar, Base16& obj)
171{171{
172 ar & obj.theData;172 ar & obj.data_;
173}173}
174174
175175
@@ -722,18 +722,8 @@
722722
723 size_t s;723 size_t s;
724 const char* c = obj->getHexBinaryValue(s);724 const char* c = obj->getHexBinaryValue(s);
725 if (obj->isEncoded())725 Base16 tmp( c, s, obj->isEncoded() );
726 {726 ar & tmp;
727 Base16 tmp;
728 Base16::parseString(c, s, tmp);
729 ar & tmp;
730 }
731 else
732 {
733 Base16 tmp(c, s);
734 ar & tmp;
735 }
736
737 ar.set_is_temp_field(false);727 ar.set_is_temp_field(false);
738728
739 break;729 break;
@@ -744,18 +734,8 @@
744734
745 size_t s;735 size_t s;
746 const char* c = obj->getBase64BinaryValue(s);736 const char* c = obj->getBase64BinaryValue(s);
747 if (obj->isEncoded())737 Base64 tmp( c, s, obj->isEncoded() );
748 {738 ar & tmp;
749 Base64 tmp;
750 Base64::parseString(c, s, tmp);
751 ar & tmp;
752 }
753 else
754 {
755 Base64 tmp(c, s);
756 ar & tmp;
757 }
758
759 ar.set_is_temp_field(false);739 ar.set_is_temp_field(false);
760740
761 break;741 break;
762742
=== modified file 'src/zorbatypes/binary.cpp'
--- src/zorbatypes/binary.cpp 2013-05-08 01:05:04 +0000
+++ src/zorbatypes/binary.cpp 2013-06-28 04:21:28 +0000
@@ -36,18 +36,6 @@
3636
37///////////////////////////////////////////////////////////////////////////////37///////////////////////////////////////////////////////////////////////////////
3838
39#define CATCH_BASE64_EXCEPTION() \
40 catch (const base64::exception& e) \
41 { \
42 throw XQUERY_EXCEPTION(err::FORG0001, \
43 ERROR_PARAMS(ZED(FORG0001_Base64BadChar_2), e.invalid_char())); \
44 } \
45 catch (const std::invalid_argument&) \
46 { \
47 throw XQUERY_EXCEPTION(err::FORG0001, \
48 ERROR_PARAMS(ZED(FORG0001_Base64Multiple4))); \
49 }
50
51static size_t copy_without_ws( char const *from, size_t from_len, char *to ) {39static size_t copy_without_ws( char const *from, size_t from_len, char *to ) {
52 char const *const to_orig = to;40 char const *const to_orig = to;
53 for ( char const *const from_end = from + from_len; from < from_end; ++from )41 for ( char const *const from_end = from + from_len; from < from_end; ++from )
@@ -56,106 +44,26 @@
56 return to - to_orig;44 return to - to_orig;
57}45}
5846
5947///////////////////////////////////////////////////////////////////////////////
60bool Base64::parseString(char const *s, size_t len, Base64& aBase64)48
61{49#define CATCH_BASE64_EXCEPTION() \
62 if ( len ) {50 catch ( base64::exception const &e ) { \
63 try 51 throw XQUERY_EXCEPTION( err::FORG0001, \
64 {52 ERROR_PARAMS( ZED(FORG0001_Base64BadChar_2), e.invalid_char() ) ); \
65 base64::validate( s, len, base64::dopt_ignore_ws );53 } \
66 aBase64.theData.resize( len );54 catch ( std::invalid_argument const& ) { \
67 aBase64.theData.resize(55 throw XQUERY_EXCEPTION( err::FORG0001, \
68 copy_without_ws( s, len, &aBase64.theData[0] )56 ERROR_PARAMS( ZED(FORG0001_Base64Multiple4) ) ); \
69 );57 }
70 }58
71 catch (...) 59void Base64::decode( istream &is, zstring *to ) {
72 {
73 return false;
74 }
75 } else
76 aBase64.theData.clear();
77 return true;
78}
79
80
81bool Base64::parseString( char const *s, size_t len, Base64 &aBase64,
82 string &lErrorMessage )
83{
84 if ( len ) {
85 try
86 {
87 base64::validate( s, len, base64::dopt_ignore_ws );
88 aBase64.theData.resize( len );
89 aBase64.theData.resize(
90 copy_without_ws( s, len, &aBase64.theData[0] )
91 );
92 }
93 catch (ZorbaException const& e)
94 {
95 lErrorMessage = e.what();
96 return false;
97 }
98 } else
99 aBase64.theData.clear();
100 return true;
101}
102
103
104void Base64::encode( zstring const &s, Base64 &to )
105{
106 base64::encode( s.data(), s.size(), &to.theData );
107}
108
109
110void Base64::encode( istream &is, Base64 &to )
111{
112 base64::encode( is, &to.theData );
113}
114
115
116zstring Base64::encode( istream &is )
117{
118 zstring result;
119 base64::encode( is, &result );
120 return result;
121}
122
123
124void Base64::encode( vector<char> const &from, vector<char> &to )
125{
126 if ( !from.empty() )
127 base64::encode( &from[0], from.size(), &to );
128}
129
130
131void Base64::encode( char const *from, size_t from_len, Base64 &to )
132{
133 base64::encode( from, from_len, &to.theData );
134}
135
136
137void Base64::decode( istream &is, zstring *to )
138{
139 try {60 try {
140 base64::decode( is, to, base64::dopt_any_len | base64::dopt_ignore_ws );61 base64::decode( is, to, base64::dopt_any_len | base64::dopt_ignore_ws );
141 }62 }
142 CATCH_BASE64_EXCEPTION()63 CATCH_BASE64_EXCEPTION()
143}64}
14465
145void Base64::decode(vector<char> const &from, vector<char> &to )66void Base64::decode( char const *from, size_type from_len, zstring *to ) {
146{
147 if ( !from.empty() ) {
148 try {
149 base64::decode(
150 &from[0], from.size(), &to,
151 base64::dopt_any_len | base64::dopt_ignore_ws
152 );
153 }
154 CATCH_BASE64_EXCEPTION()
155 }
156}
157
158void Base64::decode( char const *from, size_t from_len, zstring *to ) {
159 try {67 try {
160 base64::decode(68 base64::decode(
161 from, from_len, to, base64::dopt_any_len | base64::dopt_ignore_ws69 from, from_len, to, base64::dopt_any_len | base64::dopt_ignore_ws
@@ -164,150 +72,96 @@
164 CATCH_BASE64_EXCEPTION()72 CATCH_BASE64_EXCEPTION()
165}73}
16674
16775Base64::Base64( Base16 const &b16 ) {
168Base64::Base64( Base16 const &aBase16 )76 value_type tmp;
169{77 hexbinary::decode( &b16.data()[0], b16.size(), &tmp );
170 vector<char> tmp;78 base64::encode( &tmp[0], tmp.size(), &data_ );
171 Base16::decode( aBase16.getData(), tmp );
172 Base64::encode( tmp, theData );
173}79}
17480
17581Base64& Base64::assign( char const *data, size_type size, bool is_encoded ) {
176Base64::Base64( char const *bin_data, size_t len )
177{
178 try {82 try {
179 base64::encode( bin_data, len, &theData );83 if ( is_encoded ) {
84 base64::validate( data, size, base64::dopt_ignore_ws );
85 data_.resize( size );
86 data_.resize( copy_without_ws( data, size, &data_[0] ) );
87 } else
88 base64::encode( data, size, &data_ );
89 return *this;
180 }90 }
181 CATCH_BASE64_EXCEPTION()91 CATCH_BASE64_EXCEPTION()
182}92}
18393
18494uint32_t Base64::hash() const {
18595 return data_.size() ? ztd::hash_bytes( &data_[0], data_.size() ) : 0;
186bool Base64::equal( Base64 const &aBase64 ) const96}
187{97
188 if ( size() != aBase64.size() )98bool Base64::parseString( char const *s, size_type size, Base64 &b64 ) {
189 return false;99 if ( size ) {
190 return ::strncmp( &theData[0], &aBase64.theData[0], size() ) == 0;100 try {
191}101 base64::validate( s, size, base64::dopt_ignore_ws );
192102 b64.data_.resize( size );
193103 b64.data_.resize( copy_without_ws( s, size, &b64.data_[0] ) );
194zstring Base64::str() const 104 }
195{105 catch ( std::exception const& ) {
196 zstring result;106 return false;
197 if ( theData.size() )107 }
198 result.assign( &theData[0], theData.size() );108 } else
199 return result;109 b64.data_.clear();
200}110 return true;
201
202
203zstring Base64::decode() const
204{
205 zstring result;
206 if ( !theData.empty() )
207 base64::decode( &theData[0], theData.size(), &result );
208 return result;
209}
210
211
212void Base64::decode( vector<char> &to )
213{
214 if ( !theData.empty() )
215 base64::decode( &theData[0], theData.size(), &to );
216}
217
218
219uint32_t Base64::hash() const
220{
221 return theData.size() ? ztd::hash_bytes( &theData[0], theData.size() ) : 0;
222}
223
224
225ostream& operator<<(ostream& os, const Base64& aBase64)
226{
227 if ( aBase64.size() )
228 os.write( &aBase64.getData()[0], aBase64.size() );
229 return os;
230}111}
231112
232///////////////////////////////////////////////////////////////////////////////113///////////////////////////////////////////////////////////////////////////////
233114
234#define CATCH_HEXBINARY_EXCEPTION() \115#define CATCH_HEXBINARY_EXCEPTION() \
235 catch (const hexbinary::exception& e) \116 catch ( hexbinary::exception const &e ) { \
236 { \117 throw XQUERY_EXCEPTION( err::FORG0001, \
237 throw XQUERY_EXCEPTION(err::FORG0001, \118 ERROR_PARAMS( ZED(FORG0001_BadHexDigit_2), e.invalid_char() ) ); \
238 ERROR_PARAMS(ZED(FORG0001_BadHexDigit_2), e.invalid_char())); \
239 } \119 } \
240 catch (const std::invalid_argument&) \120 catch ( std::invalid_argument const& ) { \
241 { \121 throw XQUERY_EXCEPTION( err::FORG0001, \
242 throw XQUERY_EXCEPTION(err::FORG0001, \122 ERROR_PARAMS(ZED(FORG0001_HexBinaryMustBeEven) ) ); \
243 ERROR_PARAMS(ZED(FORG0001_HexBinaryMustBeEven))); \123 }
244 }124
245125Base16::Base16( Base64 const &b64 ) {
246Base16::Base16( char const *bin_data, size_t len )126 value_type temp;
247{127 base64::decode( &b64.data()[0], b64.size(), &temp );
248 try {128 assign( &temp[0], temp.size(), false );
249 hexbinary::encode( bin_data, len, &theData );129}
250 }130
251 CATCH_HEXBINARY_EXCEPTION()131Base16& Base16::assign( char const *data, size_type size, bool is_encoded ) {
252}132 if ( !size )
253133 data_.clear();
254Base16::Base16(Base64 const &aBase64)134 else {
255{135 try {
256 vector<char> lOrig;136 if ( is_encoded ) {
257 Base64::decode(aBase64.getData(), lOrig);137 hexbinary::validate( data, size, hexbinary::dopt_ignore_ws );
258 Base16::encode(lOrig, theData);138 data_.resize( size );
259}139 data_.resize( copy_without_ws( data, size, &data_[0] ) );
260140 } else
261141 hexbinary::encode( data, size, &data_ );
262bool Base16::parseString(char const *s, size_t len, Base16& aBase16)142 }
263{143 CATCH_HEXBINARY_EXCEPTION()
264 if ( len ) {144 }
265 try 145 return *this;
266 {146}
267 hexbinary::validate( s, len, hexbinary::dopt_ignore_ws );147
268 aBase16.theData.resize( len );148bool Base16::parseString( char const *data, size_type size, Base16 &b16 ) {
269 aBase16.theData.resize(149 if ( !size )
270 copy_without_ws( s, len, &aBase16.theData[0] )150 b16.data_.clear();
271 );151 else {
272 }152 try {
273 catch (...)153 hexbinary::validate( data, size, hexbinary::dopt_ignore_ws );
274 {154 b16.data_.resize( size );
155 b16.data_.resize( copy_without_ws( data, size, &b16.data_[0] ) );
156 }
157 catch ( std::exception const& ) {
275 return false;158 return false;
276 }159 }
277 } else160 }
278 aBase16.theData.clear();
279 return true;161 return true;
280}162}
281163
282164void Base16::encode( value_type const &from, value_type &to ) {
283void Base16::insertData(char const *s, size_t len)
284{
285 s = ascii::trim_space( s, &len );
286 try {
287 hexbinary::encode( s, len, &theData );
288 }
289 CATCH_HEXBINARY_EXCEPTION()
290}
291
292
293bool Base16::equal( Base16 const &other ) const
294{
295 if ( size() != other.size() )
296 return false;
297 return ::strncmp( &theData[0], &other.theData[0], theData.size() ) == 0;
298}
299
300
301zstring Base16::str() const
302{
303 if ( size() )
304 return zstring( &theData[0], size() );
305 return zstring();
306}
307
308
309void Base16::encode( vector<char> const &from, vector<char> &to )
310{
311 if ( !from.empty() ) {165 if ( !from.empty() ) {
312 try {166 try {
313 hexbinary::encode( &from[0], from.size(), &to );167 hexbinary::encode( &from[0], from.size(), &to );
@@ -316,34 +170,8 @@
316 }170 }
317}171}
318172
319void Base16::encode( char const *from, size_t from_len, Base16 &to )173uint32_t Base16::hash() const {
320{174 return data_.size() ? ztd::hash_bytes( &data_[0], data_.size() ) : 0;
321 hexbinary::encode( from, from_len, &to.theData );
322}
323
324void Base16::decode( vector<char> const &from, vector<char> &to )
325{
326 if ( !from.empty() ) {
327 try {
328 hexbinary::decode(
329 &from[0], from.size(), &to, hexbinary::dopt_ignore_ws
330 );
331 }
332 CATCH_HEXBINARY_EXCEPTION()
333 }
334}
335
336uint32_t Base16::hash() const
337{
338 return theData.size() ? ztd::hash_bytes( &theData[0], theData.size() ) : 0;
339}
340
341
342ostream& operator<<( ostream &os, Base16 const &b16 )
343{
344 if ( b16.size() )
345 os.write( &b16.getData()[0], b16.size() );
346 return os;
347}175}
348176
349///////////////////////////////////////////////////////////////////////////////177///////////////////////////////////////////////////////////////////////////////
350178
=== modified file 'src/zorbatypes/binary.h'
--- src/zorbatypes/binary.h 2013-03-17 04:02:46 +0000
+++ src/zorbatypes/binary.h 2013-06-28 04:21:28 +0000
@@ -26,160 +26,170 @@
2626
27namespace zorba {27namespace zorba {
2828
29
30class Base16;29class Base16;
31class Base64;30class Base64;
3231
33namespace serialization 32namespace serialization {
34{
35 class Archiver;33 class Archiver;
36 void operator&(Archiver& ar, Base64& obj);34 void operator&( Archiver&, Base64& );
37 void operator&(Archiver& ar, Base16& obj);35 void operator&( Archiver&, Base16& );
38}36}
3937
40///////////////////////////////////////////////////////////////////////////////38///////////////////////////////////////////////////////////////////////////////
4139
42class Base6440class Base64 {
43{
44 friend void serialization::operator&(serialization::Archiver&, Base64&);
45
46private:
47 std::vector<char> theData; // stored encoded
48
49public:41public:
50 static bool parseString( zstring const &s, Base64 &to )42 typedef std::vector<char> value_type;
51 {43 typedef value_type::size_type size_type;
44
45 static bool parseString( char const *data, size_type size, Base64 &to );
46
47 static bool parseString( zstring const &s, Base64 &to ) {
52 return parseString( s.data(), s.size(), to );48 return parseString( s.data(), s.size(), to );
53 }49 }
5450
55 static bool parseString(char const *s, size_t aLength, Base64& to);51 static void decode( std::istream&, zstring* );
5652
57 static bool parseString(53 static void decode( char const*, size_type, zstring* );
58 const char* aString,
59 size_t aLength,
60 Base64& aBase64,
61 std::string& lErrorMessage);
62
63 static zstring encode(std::istream& aStream);
64
65 static void encode(std::istream& aStream, Base64& to);
66
67 static void encode(const zstring& aString, Base64&);
68
69 static void encode(const std::vector<char>&, std::vector<char>&);
70
71 static void encode(char const *from, size_t from_len, Base64 &to);
72
73 static void encode(unsigned char const *from, size_t from_len, Base64& to) {
74 return encode( (char const*)from, from_len, to );
75 }
76
77 static void decode(const std::vector<char>&, std::vector<char>&);
78
79 static void decode(std::istream& aStream, zstring*);
80
81 static void decode(char const*, size_t, zstring*);
8254
83public:55public:
84 Base64(const Base64& aBase64) 56 Base64();
85 {57 Base64( Base64 const &b64 );
86 theData = aBase64.theData;58 Base64( const char *data, size_type size, bool is_encoded );
87 }59 explicit Base64( Base16 const &b16 );
8860
89 explicit Base64(const Base16& aBase16);61 size_t alloc_size() const;
9062 Base64& assign( char const *data, size_type size, bool is_encoded );
91 Base64(char const *bin_data, size_t len);63 value_type const& data() const;
9264 uint32_t hash() const;
93 Base64() { }65 size_type size() const;
94
95 const std::vector<char>& getData() const { return theData; }
96
97 size_t size() const { return theData.size(); }
98
99 bool equal(const Base64& aBase64) const;
100
101 zstring str() const;66 zstring str() const;
10267
103 zstring decode() const;68private:
10469 value_type data_; // stored encoded
105 void decode(std::vector<char>&);70
10671 friend void serialization::operator&( serialization::Archiver&, Base64& );
107 uint32_t hash() const;
108
109 size_t alloc_size() const {
110 return ztd::alloc_sizeof( theData );
111 }
112};72};
11373
74///////////////////////////////////////////////////////////////////////////////
75
76inline Base64::Base64() {
77}
78
79inline Base64::Base64( Base64 const &b64 ) : data_( b64.data_ ) {
80}
81
82inline Base64::Base64( const char *data, size_type size, bool is_encoded ) {
83 assign( data, size, is_encoded );
84}
85
86inline size_t Base64::alloc_size() const {
87 return ztd::alloc_sizeof( data_ );
88}
89
90inline Base64::value_type const& Base64::data() const {
91 return data_;
92}
93
94inline Base64::size_type Base64::size() const {
95 return data_.size();
96}
97
98inline zstring Base64::str() const {
99 return size() ? zstring( &data_[0], size() ) : zstring();
100}
101
114inline bool operator==( Base64 const &a, Base64 const &b ) {102inline bool operator==( Base64 const &a, Base64 const &b ) {
115 return a.equal( b );103 return a.size() == b.size()
104 && std::strncmp( &a.data()[0], &b.data()[0], a.size() ) == 0;
116}105}
117106
118inline bool operator!=( Base64 const &a, Base64 const &b ) {107inline bool operator!=( Base64 const &a, Base64 const &b ) {
119 return !(a == b);108 return !(a == b);
120}109}
121110
122std::ostream& operator<<( std::ostream&, Base64 const& );111inline std::ostream& operator<<( std::ostream &o, Base64 const &b64 ) {
112 if ( b64.size() )
113 o.write( &b64.data()[0], b64.size() );
114 return o;
115}
123116
124///////////////////////////////////////////////////////////////////////////////117///////////////////////////////////////////////////////////////////////////////
125118
126class Base16119class Base16 {
127{120public:
121 typedef std::vector<char> value_type;
122 typedef value_type::size_type size_type;
123
124 static bool parseString( char const *data, size_type size, Base16 &to );
125
126 static bool parseString( zstring const &s, Base16 &to ) {
127 return parseString( s.data(), s.size(), to );
128 }
129
130 static void encode( value_type const&, value_type& );
131
132public:
133 Base16();
134 Base16( Base16 const &from );
135 Base16( char const *data, size_type size, bool is_encoded );
136 explicit Base16( Base64 const& );
137
138 size_t alloc_size() const;
139 Base16& assign( char const *data, size_type size, bool is_encoded );
140 value_type const& data() const;
141 uint32_t hash() const;
142 size_type size() const;
143 zstring str() const;
144
145private:
146 value_type data_; // stored encoded
147
128 friend void serialization::operator&(serialization::Archiver&, Base16&);148 friend void serialization::operator&(serialization::Archiver&, Base16&);
129
130private:
131 std::vector<char> theData; // stored encoded
132
133public:
134 static bool parseString( zstring const &s, Base16 &to )
135 {
136 return parseString( s.data(), s.size(), to );
137 }
138
139 static bool parseString( char const *from, size_t from_len, Base16 &to );
140
141 static void encode( std::vector<char> const&, std::vector<char>& );
142
143 static void encode( char const *from, size_t from_len, Base16 &to );
144
145 static void decode( std::vector<char> const&, std::vector<char>& );
146
147public:
148 Base16() { }
149
150 Base16( Base16 const &from ) : theData( from.theData ) { }
151
152 Base16( char const *bin_data, size_t len );
153
154 explicit Base16( Base64 const& );
155
156 const std::vector<char>& getData() const { return theData; }
157
158 size_t size() const { return theData.size(); }
159
160 bool equal( Base16 const& ) const;
161
162 zstring str() const;
163
164 uint32_t hash() const;
165
166 size_t alloc_size() const {
167 return ztd::alloc_sizeof( theData );
168 }
169
170private:
171 void insertData( char const *from, size_t len );
172};149};
173150
151///////////////////////////////////////////////////////////////////////////////
152
153inline Base16::Base16() {
154}
155
156inline Base16::Base16( Base16 const &b16 ) : data_( b16.data_ ) {
157}
158
159inline Base16::Base16( char const *data, size_type size, bool is_encoded ) {
160 assign( data, size, is_encoded );
161}
162
163inline size_t Base16::alloc_size() const {
164 return ztd::alloc_sizeof( data_ );
165}
166
167inline Base16::value_type const& Base16::data() const {
168 return data_;
169}
170
171inline Base16::size_type Base16::size() const {
172 return data_.size();
173}
174
175inline zstring Base16::str() const {
176 return size() ? zstring( &data_[0], size() ) : zstring();
177}
178
174inline bool operator==( Base16 const &a, Base16 const &b ) {179inline bool operator==( Base16 const &a, Base16 const &b ) {
175 return a.equal( b );180 return a.size() == b.size()
181 && std::strncmp( &a.data()[0], &b.data()[0], a.size() ) == 0;
176}182}
177183
178inline bool operator!=( Base16 const &a, Base16 const &b ) {184inline bool operator!=( Base16 const &a, Base16 const &b ) {
179 return !(a == b);185 return !(a == b);
180}186}
181187
182std::ostream& operator<<(std::ostream&s, const Base16& );188inline std::ostream& operator<<( std::ostream &o, Base16 const &b16 ) {
189 if ( b16.size() )
190 o.write( &b16.data()[0], b16.size() );
191 return o;
192}
183193
184///////////////////////////////////////////////////////////////////////////////194///////////////////////////////////////////////////////////////////////////////
185195
186196
=== modified file 'swig/ItemFactory.h'
--- swig/ItemFactory.h 2013-06-18 23:53:59 +0000
+++ swig/ItemFactory.h 2013-06-28 04:21:28 +0000
@@ -64,11 +64,13 @@
64 /** \brief Creates a Base64Binary Item64 /** \brief Creates a Base64Binary Item
65 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]65 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
66 *66 *
67 * @param aBinData a pointer to the base64 binary data.67 * @param aData a pointer to the base64 binary data.
68 * @param aLength the length of the base64 binary data.68 * @param aLength the length of the base64 binary data.
69 * @param aIsBase64 if \c true, \a aData is already Base-64 encoded; if
70 * \c false, \a aData is raw binary data to be encoded.
69 * @return The Base64Binary Item.71 * @return The Base64Binary Item.
70 */72 */
71 Item createBase64Binary (const char *aBinData, size_t aLength);73 Item createBase64Binary (const char *aData, size_t aLength, bool aIsBase64);
7274
73 /** \brief Creates a Base64Binary Item75 /** \brief Creates a Base64Binary Item
74 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]76 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
@@ -78,15 +80,6 @@
78 */80 */
79 Item createBase64Binary (std::istream &aStream);81 Item createBase64Binary (std::istream &aStream);
8082
81 /** \brief Creates a Base64Binary Item
82 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
83 *
84 * @param aBinData the data in binary form. The data is copied from aBinData.
85 * @param aLength the length of the data
86 * @return the Base64Binary Item.
87 */
88 Item createBase64Binary (const unsigned char *aBinData, size_t aLength);
89
90 /** \brief Creates a Boolean Item83 /** \brief Creates a Boolean Item
91 * see [http://www.w3.org/TR/xmlschema-2/#bool]84 * see [http://www.w3.org/TR/xmlschema-2/#bool]
92 *85 *
9386
=== modified file 'swig/ItemFactory.i'
--- swig/ItemFactory.i 2013-06-18 23:53:59 +0000
+++ swig/ItemFactory.i 2013-06-28 04:21:28 +0000
@@ -22,15 +22,12 @@
22 return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue ));22 return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue ));
23 }23 }
24 24
25 Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){25 Item ItemFactory::createBase64Binary (const char *aData, size_t aLength, bool aIsBase64){
26 return Item( theItemFactory->createBase64Binary(aBinData, aLength));26 return Item( theItemFactory->createBase64Binary(aData, aLength, aIsBase64));
27 }27 }
28 Item ItemFactory::createBase64Binary (std::istream &aStream){28 Item ItemFactory::createBase64Binary (std::istream &aStream){
29 return Item( theItemFactory->createBase64Binary(aStream));29 return Item( theItemFactory->createBase64Binary(aStream));
30 }30 }
31 Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){
32 return Item( theItemFactory->createBase64Binary(aBinData, aLength));
33 }
34 Item ItemFactory::createBoolean (bool aValue){31 Item ItemFactory::createBoolean (bool aValue){
35 return Item( theItemFactory->createBoolean(aValue));32 return Item( theItemFactory->createBoolean(aValue));
36 }33 }
3734
=== modified file 'swig/xqj/ZorbaXQConnection.java'
--- swig/xqj/ZorbaXQConnection.java 2013-02-07 17:24:36 +0000
+++ swig/xqj/ZorbaXQConnection.java 2013-06-28 04:21:28 +0000
@@ -522,7 +522,7 @@
522 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createAnyURI(value), type);522 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createAnyURI(value), type);
523 break;523 break;
524 case XQItemType.XQBASETYPE_BASE64BINARY:524 case XQItemType.XQBASETYPE_BASE64BINARY:
525 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createBase64Binary(value, value.length()), type);525 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createBase64Binary(value, value.length(), true), type);
526 break;526 break;
527 case XQItemType.XQBASETYPE_BYTE:527 case XQItemType.XQBASETYPE_BYTE:
528 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createByte(value.charAt(0)), type);528 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createByte(value.charAt(0)), type);
@@ -947,7 +947,7 @@
947 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createAnyURI(value.toString()), type);947 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createAnyURI(value.toString()), type);
948 break;948 break;
949 case XQItemType.XQBASETYPE_BASE64BINARY:949 case XQItemType.XQBASETYPE_BASE64BINARY:
950 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createBase64Binary(value.toString(), (value.toString()).length()), type);950 item = new org.zorbaxquery.api.xqj.ZorbaXQItem(itemFactory.createBase64Binary(value.toString(), (value.toString()).length(), true), type);
951 break;951 break;
952 case XQItemType.XQBASETYPE_BYTE:952 case XQItemType.XQBASETYPE_BYTE:
953 if (value instanceof Byte) {953 if (value instanceof Byte) {
954954
=== modified file 'test/api/itemfactory.cpp'
--- test/api/itemfactory.cpp 2013-05-22 16:12:01 +0000
+++ test/api/itemfactory.cpp 2013-06-28 04:21:28 +0000
@@ -168,14 +168,14 @@
168 CHECK_NOT_IMPLEMENTED (lItem, getBooleanValue() );168 CHECK_NOT_IMPLEMENTED (lItem, getBooleanValue() );
169169
170 /** Base64Binary */170 /** Base64Binary */
171 lItem = lFactory->createBase64Binary("", 0);171 lItem = lFactory->createBase64Binary("", 0, false);
172 UNIT_ASSERT ( checkType(lItem.getType(), "base64Binary") );172 UNIT_ASSERT ( checkType(lItem.getType(), "base64Binary") );
173 UNIT_ASSERT ( lItem.isAtomic() );173 UNIT_ASSERT ( lItem.isAtomic() );
174 UNIT_ASSERT ( lItem.getStringValue() == "" );174 UNIT_ASSERT ( lItem.getStringValue() == "" );
175 UNIT_ASSERT ( lItem.getStringValue().length() == 0 );175 UNIT_ASSERT ( lItem.getStringValue().length() == 0 );
176 UNIT_ASSERT ( !lItem.getAtomizationValue().isNull() );176 UNIT_ASSERT ( !lItem.getAtomizationValue().isNull() );
177177
178 lItem = lFactory->createBase64Binary("cmxjZ3R4c3JidnllcmVuZG91aWpsbXV5Z2NhamxpcmJkaWFhbmFob2VsYXVwZmJ1Z2dmanl2eHlzYmhheXFtZXR0anV2dG1q", 96);178 lItem = lFactory->createBase64Binary("cmxjZ3R4c3JidnllcmVuZG91aWpsbXV5Z2NhamxpcmJkaWFhbmFob2VsYXVwZmJ1Z2dmanl2eHlzYmhheXFtZXR0anV2dG1q", 96, true);
179 UNIT_ASSERT ( checkType(lItem.getType(), "base64Binary") );179 UNIT_ASSERT ( checkType(lItem.getType(), "base64Binary") );
180 UNIT_ASSERT ( lItem.isAtomic() );180 UNIT_ASSERT ( lItem.isAtomic() );
181 UNIT_ASSERT ( lItem.getStringValue() == "cmxjZ3R4c3JidnllcmVuZG91aWpsbXV5Z2NhamxpcmJkaWFhbmFob2VsYXVwZmJ1Z2dmanl2eHlzYmhheXFtZXR0anV2dG1q" );181 UNIT_ASSERT ( lItem.getStringValue() == "cmxjZ3R4c3JidnllcmVuZG91aWpsbXV5Z2NhamxpcmJkaWFhbmFob2VsYXVwZmJ1Z2dmanl2eHlzYmhheXFtZXR0anV2dG1q" );

Subscribers

People subscribed via source and target branches