Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba
- pjl-misc
- Merge into trunk
Proposed by
Paul J. Lucas
Status: | Merged |
---|---|
Approved by: | Paul J. Lucas |
Approved revision: | 11317 |
Merged at revision: | 11598 |
Proposed branch: | lp:~paul-lucas/zorba/pjl-misc |
Merge into: | lp:zorba |
Diff against target: |
565 lines (+77/-291) 13 files modified
CMakeLists.txt (+7/-7) NOTICE.txt (+1/-1) NOTICE.xml (+1/-1) README.txt (+46/-48) include/zorba/zorba_string.h (+4/-4) modules/w3c/pregenerated/xqt-errors.xq (+5/-2) src/diagnostics/diagnostic_en.xml (+6/-3) src/diagnostics/pregenerated/dict_en.cpp (+1/-1) src/util/string/rstring.h (+6/-6) src/zorbaserialization/CMakeLists.txt (+0/-1) src/zorbaserialization/base64impl.cpp (+0/-176) src/zorbaserialization/base64impl.h (+0/-40) src/zorbaserialization/serialize_basic_types.cpp (+0/-1) |
To merge this branch: | bzr merge lp:~paul-lucas/zorba/pjl-misc |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Paul J. Lucas | Approve | ||
Review via email: mp+180271@code.launchpad.net |
Commit message
Fixed stemmer files location in NOTICE.
Removed unused base64 class.
Fixed typos in comments.
Clean-up.
Description of the change
Fixed stemmer files location in NOTICE.
Removed unused base64 class.
Fixed typos in comments.
Clean-up.
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
Matthias Brantner (matthias-brantner) : | # |
review:
Approve
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
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2013-05-07 08:39:33 +0000 | |||
3 | +++ CMakeLists.txt 2013-08-15 00:15:23 +0000 | |||
4 | @@ -150,17 +150,17 @@ | |||
5 | 150 | "int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT) | 150 | "int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT) |
6 | 151 | 151 | ||
7 | 152 | # C++11 standard library types | 152 | # C++11 standard library types |
10 | 153 | CHECK_CXX_SOURCE_COMPILES ( | 153 | CHECK_CXX_SOURCE_COMPILES(" |
11 | 154 | "#include <type_traits> | 154 | #include <type_traits> |
12 | 155 | int main() { std::enable_if<true,int> x; }" ZORBA_HAVE_ENABLE_IF) | 155 | int main() { std::enable_if<true,int> x; }" ZORBA_HAVE_ENABLE_IF) |
14 | 156 | CHECK_CXX_SOURCE_COMPILES (" | 156 | CHECK_CXX_SOURCE_COMPILES(" |
15 | 157 | #include <memory> | 157 | #include <memory> |
16 | 158 | int main() { std::unique_ptr<int> p; }" ZORBA_HAVE_UNIQUE_PTR) | 158 | int main() { std::unique_ptr<int> p; }" ZORBA_HAVE_UNIQUE_PTR) |
19 | 159 | CHECK_CXX_SOURCE_COMPILES ( | 159 | CHECK_CXX_SOURCE_COMPILES(" |
20 | 160 | "#include <unordered_map> | 160 | #include <unordered_map> |
21 | 161 | int main() { std::unordered_map<int,int> m; }" ZORBA_HAVE_UNORDERED_MAP) | 161 | int main() { std::unordered_map<int,int> m; }" ZORBA_HAVE_UNORDERED_MAP) |
24 | 162 | CHECK_CXX_SOURCE_COMPILES ( | 162 | CHECK_CXX_SOURCE_COMPILES(" |
25 | 163 | "#include <unordered_set> | 163 | #include <unordered_set> |
26 | 164 | int main() { std::unordered_set<int> s; }" ZORBA_HAVE_UNORDERED_SET) | 164 | int main() { std::unordered_set<int> s; }" ZORBA_HAVE_UNORDERED_SET) |
27 | 165 | 165 | ||
28 | 166 | ################################################################################ | 166 | ################################################################################ |
29 | 167 | 167 | ||
30 | === modified file 'NOTICE.txt' | |||
31 | --- NOTICE.txt 2013-05-07 08:39:33 +0000 | |||
32 | +++ NOTICE.txt 2013-08-15 00:15:23 +0000 | |||
33 | @@ -83,7 +83,7 @@ | |||
34 | 83 | 83 | ||
35 | 84 | ---------------------------------------------------- | 84 | ---------------------------------------------------- |
36 | 85 | 85 | ||
38 | 86 | src/zorbautils/stemmer/ | 86 | src/runtime/full_text/stemmer/ |
39 | 87 | 87 | ||
40 | 88 | Copyright: 2001 Dr. Martin Porter | 88 | Copyright: 2001 Dr. Martin Porter |
41 | 89 | 89 | ||
42 | 90 | 90 | ||
43 | === modified file 'NOTICE.xml' | |||
44 | --- NOTICE.xml 2013-08-09 09:04:36 +0000 | |||
45 | +++ NOTICE.xml 2013-08-15 00:15:23 +0000 | |||
46 | @@ -71,7 +71,7 @@ | |||
47 | 71 | </foreign-notice> | 71 | </foreign-notice> |
48 | 72 | </foreign-files> | 72 | </foreign-files> |
49 | 73 | <foreign-files> | 73 | <foreign-files> |
51 | 74 | <file>src/zorbautils/stemmer/</file> | 74 | <file>src/runtime/full_text/stemmer/</file> |
52 | 75 | <copyright>2001 Dr. Martin Porter</copyright> | 75 | <copyright>2001 Dr. Martin Porter</copyright> |
53 | 76 | <foreign-notice> | 76 | <foreign-notice> |
54 | 77 | All the software given out on this Snowball site is covered by the BSD | 77 | All the software given out on this Snowball site is covered by the BSD |
55 | 78 | 78 | ||
56 | === modified file 'README.txt' | |||
57 | --- README.txt 2013-08-09 09:04:36 +0000 | |||
58 | +++ README.txt 2013-08-15 00:15:23 +0000 | |||
59 | @@ -1,48 +1,46 @@ | |||
108 | 1 | -------------------------------------------------------------- | 1 | -------------------------------------------------------------- |
109 | 2 | Zorba - The XQuery Processor developed by the FLWOR Foundation | 2 | Zorba - The XQuery Processor developed by the FLWOR Foundation |
110 | 3 | -------------------------------------------------------------- | 3 | -------------------------------------------------------------- |
111 | 4 | 4 | ||
112 | 5 | The Latest Version | 5 | The Latest Version |
113 | 6 | ------------------ | 6 | ------------------ |
114 | 7 | 7 | ||
115 | 8 | The latest version can be found at http://www.zorba.io/. | 8 | The latest version can be found at <http://www.zorba.io/>. |
116 | 9 | 9 | ||
117 | 10 | Documentation | 10 | Documentation |
118 | 11 | ------------- | 11 | ------------- |
119 | 12 | 12 | ||
120 | 13 | The documentation is included in the doc directory, as well as | 13 | The documentation is included in the doc directory as well as on the web site |
121 | 14 | on the website of the project at http://www.zorba-xquery.org/html/documentation | 14 | of the project at <http://www.zorba-xquery.org/html/documentation>. |
122 | 15 | 15 | ||
123 | 16 | Build & Installation | 16 | Build & Installation |
124 | 17 | -------------------- | 17 | -------------------- |
125 | 18 | 18 | ||
126 | 19 | Please see the documentation on the web site or in the doc directory | 19 | Please see the documentation on the web site or in the doc directory of the |
127 | 20 | of the package. | 20 | package. |
128 | 21 | 21 | ||
129 | 22 | Bugs and errors | 22 | Bugs and errors |
130 | 23 | --------------- | 23 | --------------- |
131 | 24 | 24 | ||
132 | 25 | Bug or error reports should be sent to | 25 | Bug or error reports should be sent to |
133 | 26 | https://bugs.launchpad.net/zorba. | 26 | <https://bugs.launchpad.net/zorba>. |
134 | 27 | 27 | ||
135 | 28 | 28 | ||
136 | 29 | Licensing | 29 | Licensing |
137 | 30 | --------- | 30 | --------- |
138 | 31 | 31 | ||
139 | 32 | Please see the file called LICENSE.txt. | 32 | Please see the file called LICENSE.txt. |
140 | 33 | 33 | ||
141 | 34 | 34 | ||
142 | 35 | Contacts | 35 | Contacts |
143 | 36 | -------- | 36 | -------- |
144 | 37 | 37 | ||
145 | 38 | o If you want to be informed about new code releases, bug fixes | 38 | o If you want to be informed about new code releases, bug fixes and general |
146 | 39 | and general news and information about the Zorba XQuery Processor | 39 | news and information about the Zorba XQuery Processor, subscribe to the |
147 | 40 | subscribe to the Zorba Users mailing list as described under | 40 | Zorba Users mailing list <zorba-users@googlegroups.com> |
148 | 41 | <zorba-users@lists.sourceforge.net> | 41 | |
149 | 42 | 42 | o If you have a concrete bug report for Zorba, please go to Zorba's Bug | |
150 | 43 | o If you have a concrete bug report for Zorba please go to the | 43 | Database and submit your report <https://bugs.launchpad.net/zorba>. |
151 | 44 | Zorba's Bug Database and submit your report: | 44 | |
152 | 45 | https://bugs.launchpad.net/zorba. | 45 | o If you want to participate in actively developing or supporting Zorba, |
153 | 46 | 46 | please send an e-mail to <zorba-dev@googlegroups.com>. | |
106 | 47 | o If you want to participate in actively developing Zorba or | ||
107 | 48 | support Zorba, please write a mail to: zorba-dev@googlegroups.com | ||
154 | 49 | 47 | ||
155 | === modified file 'include/zorba/zorba_string.h' | |||
156 | --- include/zorba/zorba_string.h 2013-02-07 17:24:36 +0000 | |||
157 | +++ include/zorba/zorba_string.h 2013-08-15 00:15:23 +0000 | |||
158 | @@ -239,7 +239,7 @@ | |||
159 | 239 | * Appends a substring of the given string to this string. | 239 | * Appends a substring of the given string to this string. |
160 | 240 | * | 240 | * |
161 | 241 | * @param s The string to append. | 241 | * @param s The string to append. |
163 | 242 | * @param s_pos The starting position is \a s. | 242 | * @param s_pos The starting position in \a s. |
164 | 243 | * @param s_n The number of characters of \a s to append. | 243 | * @param s_n The number of characters of \a s to append. |
165 | 244 | * @return this string. | 244 | * @return this string. |
166 | 245 | */ | 245 | */ |
167 | @@ -257,7 +257,7 @@ | |||
168 | 257 | * Appends a substring of the given string to this string. | 257 | * Appends a substring of the given string to this string. |
169 | 258 | * | 258 | * |
170 | 259 | * @param s The string to append. | 259 | * @param s The string to append. |
172 | 260 | * @param s_pos The starting position is \a s. | 260 | * @param s_pos The starting position in \a s. |
173 | 261 | * @param s_n The number of characters of \a s to append. | 261 | * @param s_n The number of characters of \a s to append. |
174 | 262 | * @return this string. | 262 | * @return this string. |
175 | 263 | */ | 263 | */ |
176 | @@ -1000,7 +1000,7 @@ | |||
177 | 1000 | * @param pos The position within this string to replace at. | 1000 | * @param pos The position within this string to replace at. |
178 | 1001 | * @param n The number of characters to replace. | 1001 | * @param n The number of characters to replace. |
179 | 1002 | * @param s The replacement string. | 1002 | * @param s The replacement string. |
181 | 1003 | * @param s_pos The starting position is \a s. | 1003 | * @param s_pos The starting position in \a s. |
182 | 1004 | * @param s_n The number of characters of \a s to use. | 1004 | * @param s_n The number of characters of \a s to use. |
183 | 1005 | * @return this string. | 1005 | * @return this string. |
184 | 1006 | */ | 1006 | */ |
185 | @@ -1014,7 +1014,7 @@ | |||
186 | 1014 | * @param pos The position within this string to replace at. | 1014 | * @param pos The position within this string to replace at. |
187 | 1015 | * @param n The number of characters to replace. | 1015 | * @param n The number of characters to replace. |
188 | 1016 | * @param s The replacement string. | 1016 | * @param s The replacement string. |
190 | 1017 | * @param s_pos The starting position is \a s. | 1017 | * @param s_pos The starting position in \a s. |
191 | 1018 | * @param s_n The number of characters of \a s to use. | 1018 | * @param s_n The number of characters of \a s to use. |
192 | 1019 | * @return this string. | 1019 | * @return this string. |
193 | 1020 | */ | 1020 | */ |
194 | 1021 | 1021 | ||
195 | === modified file 'modules/w3c/pregenerated/xqt-errors.xq' | |||
196 | --- modules/w3c/pregenerated/xqt-errors.xq 2013-06-25 00:41:44 +0000 | |||
197 | +++ modules/w3c/pregenerated/xqt-errors.xq 2013-08-15 00:15:23 +0000 | |||
198 | @@ -1110,7 +1110,9 @@ | |||
199 | 1110 | 1110 | ||
200 | 1111 | (:~ | 1111 | (:~ |
201 | 1112 | : | 1112 | : |
203 | 1113 | : String to be cast to decimal has too many digits of precision. | 1113 | : Raised when casting a string to xs:decimal if the string has more |
204 | 1114 | : digits of precision than the implementation can represent (the | ||
205 | 1115 | : implementation also has the option of rounding). | ||
206 | 1114 | : | 1116 | : |
207 | 1115 | : @see http://www.w3.org/2005/xqt-errors | 1117 | : @see http://www.w3.org/2005/xqt-errors |
208 | 1116 | :) | 1118 | :) |
209 | @@ -1166,7 +1168,8 @@ | |||
210 | 1166 | 1168 | ||
211 | 1167 | (:~ | 1169 | (:~ |
212 | 1168 | : | 1170 | : |
214 | 1169 | : Function stability not defined. | 1171 | : Raised by fn:doc, fn:collection to indicate that it is not possible to |
215 | 1172 | : return a result that is guaranteed deterministic. | ||
216 | 1170 | : | 1173 | : |
217 | 1171 | : @see http://www.w3.org/2005/xqt-errors | 1174 | : @see http://www.w3.org/2005/xqt-errors |
218 | 1172 | :) | 1175 | :) |
219 | 1173 | 1176 | ||
220 | === modified file 'src/diagnostics/diagnostic_en.xml' | |||
221 | --- src/diagnostics/diagnostic_en.xml 2013-08-01 09:41:39 +0000 | |||
222 | +++ src/diagnostics/diagnostic_en.xml 2013-08-15 00:15:23 +0000 | |||
223 | @@ -1452,7 +1452,9 @@ | |||
224 | 1452 | 1452 | ||
225 | 1453 | <diagnostic code="FOCA0006"> | 1453 | <diagnostic code="FOCA0006"> |
226 | 1454 | <comment> | 1454 | <comment> |
228 | 1455 | String to be cast to decimal has too many digits of precision. | 1455 | Raised when casting a string to xs:decimal if the string has more |
229 | 1456 | digits of precision than the implementation can represent (the | ||
230 | 1457 | implementation also has the option of rounding). | ||
231 | 1456 | </comment> | 1458 | </comment> |
232 | 1457 | <value>"$1": string to be cast to decimal has too many digits of precision</value> | 1459 | <value>"$1": string to be cast to decimal has too many digits of precision</value> |
233 | 1458 | </diagnostic> | 1460 | </diagnostic> |
234 | @@ -1501,9 +1503,10 @@ | |||
235 | 1501 | 1503 | ||
236 | 1502 | <diagnostic code="FODC0003"> | 1504 | <diagnostic code="FODC0003"> |
237 | 1503 | <comment> | 1505 | <comment> |
239 | 1504 | Function stability not defined. | 1506 | Raised by fn:doc, fn:collection to indicate that it is not possible to |
240 | 1507 | return a result that is guaranteed deterministic. | ||
241 | 1505 | </comment> | 1508 | </comment> |
243 | 1506 | <value>function stability not defined</value> | 1509 | <value>$1 function result not guaranteed deterministic</value> |
244 | 1507 | </diagnostic> | 1510 | </diagnostic> |
245 | 1508 | 1511 | ||
246 | 1509 | <diagnostic code="FODC0004"> | 1512 | <diagnostic code="FODC0004"> |
247 | 1510 | 1513 | ||
248 | === modified file 'src/diagnostics/pregenerated/dict_en.cpp' | |||
249 | --- src/diagnostics/pregenerated/dict_en.cpp 2013-08-01 09:41:39 +0000 | |||
250 | +++ src/diagnostics/pregenerated/dict_en.cpp 2013-08-15 00:15:23 +0000 | |||
251 | @@ -42,7 +42,7 @@ | |||
252 | 42 | { "FOCZ0001", "invalid content passed to $1: $2" }, | 42 | { "FOCZ0001", "invalid content passed to $1: $2" }, |
253 | 43 | { "FODC0001", "no context document for $1() function" }, | 43 | { "FODC0001", "no context document for $1() function" }, |
254 | 44 | { "FODC0002", "\"$1\": error retrieving resource${: 2}" }, | 44 | { "FODC0002", "\"$1\": error retrieving resource${: 2}" }, |
256 | 45 | { "FODC0003", "function stability not defined" }, | 45 | { "FODC0003", "$1 function result not guaranteed deterministic" }, |
257 | 46 | { "FODC0004", "\"$1\": invalid argument to fn:collection()${: 2}" }, | 46 | { "FODC0004", "\"$1\": invalid argument to fn:collection()${: 2}" }, |
258 | 47 | { "FODC0005", "\"$1\": invalid argument to fn:doc() or fn:doc-available()" }, | 47 | { "FODC0005", "\"$1\": invalid argument to fn:doc() or fn:doc-available()" }, |
259 | 48 | { "FODC0006", "invalid content passed to $1: $2" }, | 48 | { "FODC0006", "invalid content passed to $1: $2" }, |
260 | 49 | 49 | ||
261 | === modified file 'src/util/string/rstring.h' | |||
262 | --- src/util/string/rstring.h 2013-06-01 00:30:39 +0000 | |||
263 | +++ src/util/string/rstring.h 2013-08-15 00:15:23 +0000 | |||
264 | @@ -447,7 +447,7 @@ | |||
265 | 447 | * Appends a substring of the given string to this string. | 447 | * Appends a substring of the given string to this string. |
266 | 448 | * | 448 | * |
267 | 449 | * @param s The string to append. | 449 | * @param s The string to append. |
269 | 450 | * @param s_pos The starting position is \a s. | 450 | * @param s_pos The starting position in \a s. |
270 | 451 | * @param s_n The number of characters of \a s to append. | 451 | * @param s_n The number of characters of \a s to append. |
271 | 452 | * @return Returns this string. | 452 | * @return Returns this string. |
272 | 453 | */ | 453 | */ |
273 | @@ -459,7 +459,7 @@ | |||
274 | 459 | * | 459 | * |
275 | 460 | * @tparam RepType2 The string representation of \a s. | 460 | * @tparam RepType2 The string representation of \a s. |
276 | 461 | * @param s The string to append. | 461 | * @param s The string to append. |
278 | 462 | * @param s_pos The starting position is \a s. | 462 | * @param s_pos The starting position in \a s. |
279 | 463 | * @param s_n The number of characters of \a s to append. | 463 | * @param s_n The number of characters of \a s to append. |
280 | 464 | * @return Returns this string. | 464 | * @return Returns this string. |
281 | 465 | */ | 465 | */ |
282 | @@ -480,7 +480,7 @@ | |||
283 | 480 | * Appends a substring of the given string to this string. | 480 | * Appends a substring of the given string to this string. |
284 | 481 | * | 481 | * |
285 | 482 | * @param s The string to append. | 482 | * @param s The string to append. |
287 | 483 | * @param s_pos The starting position is \a s. | 483 | * @param s_pos The starting position in \a s. |
288 | 484 | * @param s_n The number of characters of \a s to append. | 484 | * @param s_n The number of characters of \a s to append. |
289 | 485 | * @return Returns this string. | 485 | * @return Returns this string. |
290 | 486 | */ | 486 | */ |
291 | @@ -1579,7 +1579,7 @@ | |||
292 | 1579 | * @param pos The position within this string to replace at. | 1579 | * @param pos The position within this string to replace at. |
293 | 1580 | * @param n The number of characters to replace. | 1580 | * @param n The number of characters to replace. |
294 | 1581 | * @param s The replacement string. | 1581 | * @param s The replacement string. |
296 | 1582 | * @param s_pos The starting position is \a s. | 1582 | * @param s_pos The starting position in \a s. |
297 | 1583 | * @param s_n The number of characters of \a s to use. | 1583 | * @param s_n The number of characters of \a s to use. |
298 | 1584 | * @return Returns this string. | 1584 | * @return Returns this string. |
299 | 1585 | */ | 1585 | */ |
300 | @@ -1595,7 +1595,7 @@ | |||
301 | 1595 | * @param pos The position within this string to replace at. | 1595 | * @param pos The position within this string to replace at. |
302 | 1596 | * @param n The number of characters to replace. | 1596 | * @param n The number of characters to replace. |
303 | 1597 | * @param s The replacement string. | 1597 | * @param s The replacement string. |
305 | 1598 | * @param s_pos The starting position is \a s. | 1598 | * @param s_pos The starting position in \a s. |
306 | 1599 | * @param s_n The number of characters of \a s to use. | 1599 | * @param s_n The number of characters of \a s to use. |
307 | 1600 | * @return Returns this string. | 1600 | * @return Returns this string. |
308 | 1601 | */ | 1601 | */ |
309 | @@ -1611,7 +1611,7 @@ | |||
310 | 1611 | * @param pos The position within this string to replace at. | 1611 | * @param pos The position within this string to replace at. |
311 | 1612 | * @param n The number of characters to replace. | 1612 | * @param n The number of characters to replace. |
312 | 1613 | * @param s The replacement string. | 1613 | * @param s The replacement string. |
314 | 1614 | * @param s_pos The starting position is \a s. | 1614 | * @param s_pos The starting position in \a s. |
315 | 1615 | * @param s_n The number of characters of \a s to use. | 1615 | * @param s_n The number of characters of \a s to use. |
316 | 1616 | * @return Returns this string. | 1616 | * @return Returns this string. |
317 | 1617 | */ | 1617 | */ |
318 | 1618 | 1618 | ||
319 | === modified file 'src/zorbaserialization/CMakeLists.txt' | |||
320 | --- src/zorbaserialization/CMakeLists.txt 2013-02-07 17:24:36 +0000 | |||
321 | +++ src/zorbaserialization/CMakeLists.txt 2013-08-15 00:15:23 +0000 | |||
322 | @@ -23,5 +23,4 @@ | |||
323 | 23 | bin_archiver.cpp | 23 | bin_archiver.cpp |
324 | 24 | serialize_basic_types.cpp | 24 | serialize_basic_types.cpp |
325 | 25 | serialize_zorba_types.cpp | 25 | serialize_zorba_types.cpp |
326 | 26 | base64impl.cpp | ||
327 | 27 | ) | 26 | ) |
328 | 28 | 27 | ||
329 | === removed file 'src/zorbaserialization/base64impl.cpp' | |||
330 | --- src/zorbaserialization/base64impl.cpp 2013-02-07 17:24:36 +0000 | |||
331 | +++ src/zorbaserialization/base64impl.cpp 1970-01-01 00:00:00 +0000 | |||
332 | @@ -1,176 +0,0 @@ | |||
333 | 1 | /* | ||
334 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
335 | 3 | * | ||
336 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
337 | 5 | * you may not use this file except in compliance with the License. | ||
338 | 6 | * You may obtain a copy of the License at | ||
339 | 7 | * | ||
340 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
341 | 9 | * | ||
342 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
343 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
344 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
345 | 13 | * See the License for the specific language governing permissions and | ||
346 | 14 | * limitations under the License. | ||
347 | 15 | */ | ||
348 | 16 | #include "stdafx.h" | ||
349 | 17 | |||
350 | 18 | #include "zorbaserialization/base64impl.h" | ||
351 | 19 | |||
352 | 20 | |||
353 | 21 | namespace zorba{ | ||
354 | 22 | namespace serialization{ | ||
355 | 23 | |||
356 | 24 | ////Base64 | ||
357 | 25 | |||
358 | 26 | const char Base64Impl::base64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | ||
359 | 27 | |||
360 | 28 | /* | ||
361 | 29 | Transform each 6 bits into a character | ||
362 | 30 | |||
363 | 31 | dataout len must be 8/6*datalen+2 | ||
364 | 32 | return dataoutlen | ||
365 | 33 | */ | ||
366 | 34 | size_t | ||
367 | 35 | Base64Impl::Encode(const unsigned char *datain, size_t datalen, | ||
368 | 36 | char *dataout)///pre-allocated at the right size | ||
369 | 37 | { | ||
370 | 38 | unsigned char rembits6; | ||
371 | 39 | unsigned char rembits8; | ||
372 | 40 | unsigned char temp6; | ||
373 | 41 | unsigned char temp8; | ||
374 | 42 | unsigned int index; | ||
375 | 43 | char *orig_dataout = dataout; | ||
376 | 44 | |||
377 | 45 | temp6 = 0; | ||
378 | 46 | rembits6 = 6; | ||
379 | 47 | rembits8 = 8; | ||
380 | 48 | index = 0; | ||
381 | 49 | temp8 = datain[0]; | ||
382 | 50 | |||
383 | 51 | while(index < datalen) | ||
384 | 52 | { | ||
385 | 53 | temp6 <<= 1; | ||
386 | 54 | if(temp8 & 0x80) | ||
387 | 55 | temp6 |= 1; | ||
388 | 56 | temp8 <<= 1; | ||
389 | 57 | rembits8--; | ||
390 | 58 | if(rembits8 == 0) | ||
391 | 59 | { | ||
392 | 60 | rembits8 = 8; | ||
393 | 61 | datain++; | ||
394 | 62 | temp8 = datain[0]; | ||
395 | 63 | index++; | ||
396 | 64 | } | ||
397 | 65 | rembits6--; | ||
398 | 66 | if(rembits6 == 0) | ||
399 | 67 | { | ||
400 | 68 | rembits6 = 6; | ||
401 | 69 | dataout[0] = base64chars[temp6]; | ||
402 | 70 | dataout++; | ||
403 | 71 | temp6 = 0; | ||
404 | 72 | } | ||
405 | 73 | } | ||
406 | 74 | if(rembits6 != 6) | ||
407 | 75 | { | ||
408 | 76 | temp6 <<= rembits6; | ||
409 | 77 | rembits6 = 0; | ||
410 | 78 | dataout[0] = base64chars[temp6]; | ||
411 | 79 | dataout++; | ||
412 | 80 | } | ||
413 | 81 | if((datalen%3) == 1) | ||
414 | 82 | { | ||
415 | 83 | ///add two more 6bit bytes | ||
416 | 84 | dataout[0] = dataout[1] = '='; | ||
417 | 85 | dataout += 2; | ||
418 | 86 | } | ||
419 | 87 | if((datalen%3) == 2) | ||
420 | 88 | { | ||
421 | 89 | ///add two more 6bit bytes | ||
422 | 90 | dataout[0] = '='; | ||
423 | 91 | dataout++; | ||
424 | 92 | } | ||
425 | 93 | dataout[0] = 0; | ||
426 | 94 | |||
427 | 95 | return dataout - orig_dataout; | ||
428 | 96 | } | ||
429 | 97 | |||
430 | 98 | //static const char base64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | ||
431 | 99 | unsigned char | ||
432 | 100 | Base64Impl::getChar6BitIndex(char c) | ||
433 | 101 | { | ||
434 | 102 | if((c >= 'A') && (c <= 'Z')) | ||
435 | 103 | return c-'A'; | ||
436 | 104 | if((c >= 'a') && (c <= 'z')) | ||
437 | 105 | return c-'a' + 'Z' - 'A' + 1; | ||
438 | 106 | if((c >= '0') && (c <= '9')) | ||
439 | 107 | return c-'0' + 'Z' - 'A' + 1 + 'z' - 'a' + 1; | ||
440 | 108 | if(c == '+') | ||
441 | 109 | return 62; | ||
442 | 110 | if(c == '/') | ||
443 | 111 | return 63; | ||
444 | 112 | return 0xFF;///special case for '=' | ||
445 | 113 | } | ||
446 | 114 | |||
447 | 115 | /* | ||
448 | 116 | dataout must be pre-allocated for 6/8*datalen | ||
449 | 117 | return dataoutlen | ||
450 | 118 | */ | ||
451 | 119 | size_t | ||
452 | 120 | Base64Impl::Decode(const unsigned char *datain, size_t datalen, | ||
453 | 121 | unsigned char *dataout) | ||
454 | 122 | { | ||
455 | 123 | unsigned char *orig_dataout = dataout; | ||
456 | 124 | unsigned char rembits6; | ||
457 | 125 | unsigned char rembits8; | ||
458 | 126 | unsigned char temp8; | ||
459 | 127 | unsigned char temp6; | ||
460 | 128 | |||
461 | 129 | rembits6 = 6; | ||
462 | 130 | rembits8 = 8; | ||
463 | 131 | temp8 = 0; | ||
464 | 132 | temp6 = getChar6BitIndex(datain[0]); | ||
465 | 133 | |||
466 | 134 | while(datalen) | ||
467 | 135 | { | ||
468 | 136 | temp8 <<= 1; | ||
469 | 137 | if(temp6 & 0x20) | ||
470 | 138 | temp8 |= 1; | ||
471 | 139 | temp6 <<= 1; | ||
472 | 140 | rembits8--; | ||
473 | 141 | if(rembits8 == 0) | ||
474 | 142 | { | ||
475 | 143 | dataout[0] = temp8; | ||
476 | 144 | dataout++; | ||
477 | 145 | rembits8 = 8; | ||
478 | 146 | temp8 = 0; | ||
479 | 147 | } | ||
480 | 148 | rembits6--; | ||
481 | 149 | if(rembits6 == 0) | ||
482 | 150 | { | ||
483 | 151 | do{ | ||
484 | 152 | datain++; | ||
485 | 153 | datalen--; | ||
486 | 154 | }while(((datain[0] == '\r')||(datain[0] == '\n'))&&datalen); | ||
487 | 155 | if(!datalen) | ||
488 | 156 | break; | ||
489 | 157 | if(datain[0] == '=') | ||
490 | 158 | break; | ||
491 | 159 | temp6 = getChar6BitIndex(datain[0]); | ||
492 | 160 | if(temp6 > 0x40) | ||
493 | 161 | break; | ||
494 | 162 | rembits6 = 6; | ||
495 | 163 | } | ||
496 | 164 | } | ||
497 | 165 | |||
498 | 166 | if(rembits8 != 8) | ||
499 | 167 | { | ||
500 | 168 | ///something wrong here, but ignore partially written last byte at returning len | ||
501 | 169 | } | ||
502 | 170 | |||
503 | 171 | return dataout - orig_dataout; | ||
504 | 172 | |||
505 | 173 | } | ||
506 | 174 | |||
507 | 175 | }} | ||
508 | 176 | /* vim:set et sw=2 ts=2: */ | ||
509 | 177 | 0 | ||
510 | === removed file 'src/zorbaserialization/base64impl.h' | |||
511 | --- src/zorbaserialization/base64impl.h 2013-02-07 17:24:36 +0000 | |||
512 | +++ src/zorbaserialization/base64impl.h 1970-01-01 00:00:00 +0000 | |||
513 | @@ -1,40 +0,0 @@ | |||
514 | 1 | /* | ||
515 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | ||
516 | 3 | * | ||
517 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
518 | 5 | * you may not use this file except in compliance with the License. | ||
519 | 6 | * You may obtain a copy of the License at | ||
520 | 7 | * | ||
521 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
522 | 9 | * | ||
523 | 10 | * Unless required by applicable law or agreed to in writing, software | ||
524 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
525 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
526 | 13 | * See the License for the specific language governing permissions and | ||
527 | 14 | * limitations under the License. | ||
528 | 15 | */ | ||
529 | 16 | #pragma once | ||
530 | 17 | #ifndef ZORBA_BASE64_IMPLEMENTATION | ||
531 | 18 | #define ZORBA_BASE64_IMPLEMENTATION | ||
532 | 19 | |||
533 | 20 | #include <stdlib.h> | ||
534 | 21 | |||
535 | 22 | namespace zorba{ | ||
536 | 23 | namespace serialization{ | ||
537 | 24 | |||
538 | 25 | class Base64Impl | ||
539 | 26 | { | ||
540 | 27 | public: | ||
541 | 28 | static const char base64chars[]; | ||
542 | 29 | public: | ||
543 | 30 | static size_t Encode(const unsigned char *datain, size_t datalen, | ||
544 | 31 | char *dataout);///pre-allocated at the right size | ||
545 | 32 | static size_t Decode(const unsigned char *datain, size_t datalen, | ||
546 | 33 | unsigned char *dataout); | ||
547 | 34 | protected: | ||
548 | 35 | static unsigned char getChar6BitIndex(char c); | ||
549 | 36 | }; | ||
550 | 37 | |||
551 | 38 | }} | ||
552 | 39 | #endif | ||
553 | 40 | /* vim:set et sw=2 ts=2: */ | ||
554 | 41 | 0 | ||
555 | === modified file 'src/zorbaserialization/serialize_basic_types.cpp' | |||
556 | --- src/zorbaserialization/serialize_basic_types.cpp 2013-06-18 23:53:59 +0000 | |||
557 | +++ src/zorbaserialization/serialize_basic_types.cpp 2013-08-15 00:15:23 +0000 | |||
558 | @@ -20,7 +20,6 @@ | |||
559 | 20 | 20 | ||
560 | 21 | #include "zorbaserialization/serialize_basic_types.h" | 21 | #include "zorbaserialization/serialize_basic_types.h" |
561 | 22 | #include "zorbaserialization/archiver.h" | 22 | #include "zorbaserialization/archiver.h" |
562 | 23 | #include "zorbaserialization/base64impl.h" | ||
563 | 24 | 23 | ||
564 | 25 | #include "zorbatypes/m_apm.h" | 24 | #include "zorbatypes/m_apm.h" |
565 | 26 | #include "zorbatypes/float.h" | 25 | #include "zorbatypes/float.h" |
Validation queue starting for the following merge proposals: /code.launchpad .net/~paul- lucas/zorba/ pjl-misc/ +merge/ 180271
https:/
Progress dashboard at http:// jenkins. lambda. nu/view/ ValidationQueue