Merge lp:~zorba-coders/zorba/xqxq-bug-1056704 into lp:zorba/xqxq-module

Proposed by Juan Zacarias
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/xqxq-bug-1056704
Merge into: lp:zorba/xqxq-module
Prerequisite: lp:~zorba-coders/zorba/bug-1056704
Diff against target: 73 lines (+13/-32)
2 files modified
src/xqxq.xq.src/xqxq.cpp (+13/-24)
src/xqxq.xq.src/xqxq.h (+0/-8)
To merge this branch: bzr merge lp:~zorba-coders/zorba/xqxq-bug-1056704
Reviewer Review Type Date Requested Status
Juan Zacarias Approve
Sorin Marian Nasoi Approve
Review via email: mp+127374@code.launchpad.net

This proposal has been superseded by a proposal from 2012-10-02.

Commit message

Fix for bug-1056704:
Changed xqxq-module implementation to zorba's util/uuid.h

To post a comment you must log in.
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

I have checked these changes in XQXQ together with the changes made by Paul in the public API and the reported problem was fixed.

Thanks for the help,
Sorin

review: Approve
Revision history for this message
Juan Zacarias (juan457) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

No proposals found for merge of lp:~zorba-coders/zorba/bug-1056704 into lp:zorba/xqxq-module.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/xqxq.xq.src/xqxq.cpp'
2--- src/xqxq.xq.src/xqxq.cpp 2011-11-30 21:57:52 +0000
3+++ src/xqxq.xq.src/xqxq.cpp 2012-10-01 21:44:25 +0000
4@@ -10,7 +10,7 @@
5 #include <zorba/xquery.h>
6 #include <time.h>
7 #include <stdio.h>
8-
9+#include <zorba/util/uuid.h>
10 #include <vector>
11
12 #include "xqxq.h"
13@@ -269,29 +269,18 @@
14 e.diagnostic().qname().ns(), e.diagnostic().qname().localname());
15 throw USER_EXCEPTION(errQName, err.str());
16 }
17-
18- String lUUID = getUUID();
19-
20- lQueryMap->storeQuery(lUUID, lQuery);
21-
22- return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createAnyURI(lUUID)));
23- }
24-
25- String
26- PrepareMainModuleFunction::S4 ()
27- {
28- unsigned long randNum = (1 + rand() * 0x10000)|0;
29- char* randBuff= new char[20];
30- sprintf(randBuff, "%lx", randNum);
31- String lString(randBuff);
32- delete[] randBuff;
33- return lString;
34- }
35-
36- String
37- PrepareMainModuleFunction::getUUID()
38- {
39- return (String("urn:uuid:") + S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4());
40+
41+ uuid lUUID;
42+ uuid::create(&lUUID);
43+
44+ std::stringstream lStream;
45+ lStream << lUUID;
46+
47+ String lStrUUID = lStream.str();
48+
49+ lQueryMap->storeQuery(lStrUUID, lQuery);
50+
51+ return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createAnyURI(lStrUUID)));
52 }
53
54 /*******************************************************************************************
55
56=== modified file 'src/xqxq.xq.src/xqxq.h'
57--- src/xqxq.xq.src/xqxq.h 2011-11-28 23:55:59 +0000
58+++ src/xqxq.xq.src/xqxq.h 2012-10-01 21:44:25 +0000
59@@ -126,14 +126,6 @@
60 evaluate(const Arguments_t&,
61 const zorba::StaticContext*,
62 const zorba::DynamicContext*) const;
63-
64- protected:
65- static String
66- getUUID();
67-
68- static String
69- S4();
70-
71 };
72
73 class PrepareLibraryModuleFunction : public XQXQFunction{

Subscribers

People subscribed via source and target branches

to all changes: